화면 깨짐현상 버그들 조치
This commit is contained in:
parent
eb51a6f6ee
commit
e8734b0df4
@ -20,8 +20,8 @@ android {
|
||||
applicationId "com.allscore_app"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 34
|
||||
versionCode 4
|
||||
versionName "1.0.3"
|
||||
versionCode 6
|
||||
versionName "1.0.5"
|
||||
}
|
||||
|
||||
// ...
|
||||
|
@ -14,6 +14,14 @@
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "452355332155-lqtr6l2qg0pn62vi5nccggldmcm21qdl.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.allscore_app",
|
||||
"certificate_hash": "761f8d2290ebb091acdf3cf8400df65245047fb8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "452355332155-t29ceato8o62c9kq9drefe7b6hd1ka1d.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
@ -38,6 +46,13 @@
|
||||
{
|
||||
"client_id": "452355332155-jv26k1rs4tro38tc99mffid2e3gbra6j.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
},
|
||||
{
|
||||
"client_id": "452355332155-fo49j1u3qfup1sa3gj33bko6q269pqo4.apps.googleusercontent.com",
|
||||
"client_type": 2,
|
||||
"ios_info": {
|
||||
"bundle_id": "com.example.allscoreApp"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -11,15 +11,15 @@
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
|
||||
<!-- ★ 여기에 meta-data 추가 ★ -->
|
||||
<meta-data
|
||||
<!-- <meta-data
|
||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||
android:value="ca-app-pub-3940256099942544~3347511713" />
|
||||
android:value="ca-app-pub-3940256099942544~3347511713" /> -->
|
||||
<!-- android:value="ca-app-pub-6461991944599918~9492697896" -->
|
||||
|
||||
<!-- 구글 로그인 관련 -->
|
||||
<meta-data
|
||||
<!-- <meta-data
|
||||
android:name="com.google.android.gms.auth.api.signin.client_id"
|
||||
android:value="19981745655-3dadv7n64jqcada6mtc1ao25k1m90gp3.apps.googleusercontent.com" />
|
||||
android:value="19981745655-3dadv7n64jqcada6mtc1ao25k1m90gp3.apps.googleusercontent.com" /> -->
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
@ -383,7 +383,10 @@ class _UserInfoPrivateDialogState extends State<UserInfoPrivateDialog> {
|
||||
],
|
||||
),
|
||||
] else ...[
|
||||
ElevatedButton(
|
||||
SizedBox(
|
||||
width: 80 * scaleFactor,
|
||||
height: 40 * scaleFactor,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.black, padding: EdgeInsets.zero, minimumSize: Size(0, 30), tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
||||
child: FittedBox(
|
||||
@ -395,6 +398,7 @@ class _UserInfoPrivateDialogState extends State<UserInfoPrivateDialog> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
|
@ -428,8 +428,10 @@ class _UserInfoTeamDialogState extends State<UserInfoTeamDialog> {
|
||||
],
|
||||
),
|
||||
] else ...[
|
||||
// If not the master, only "OK" (일반 유저는 "확인"만)
|
||||
ElevatedButton(
|
||||
SizedBox(
|
||||
width: 80 * scaleFactor,
|
||||
height: 40 * scaleFactor,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.black, padding: EdgeInsets.zero, minimumSize: Size(0, 30), tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
||||
child: AutoSizeText(
|
||||
@ -439,6 +441,7 @@ class _UserInfoTeamDialogState extends State<UserInfoTeamDialog> {
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
|
@ -25,6 +25,12 @@ void main() async {
|
||||
// 모바일 광고 초기화
|
||||
MobileAds.instance.initialize();
|
||||
|
||||
RequestConfiguration configuration = RequestConfiguration(
|
||||
testDeviceIds: ["CF2323B16A2434EF4291F29404AD42AC"], // 여기에 자신의 기기 ID 추가
|
||||
);
|
||||
|
||||
MobileAds.instance.updateRequestConfiguration(configuration);
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
@ -1,85 +1,83 @@
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
// import '../config/config.dart';
|
||||
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||
import '../config/config.dart';
|
||||
|
||||
/*
|
||||
// ================== 기존 코드 (전체 주석 처리) ==================
|
||||
|
||||
// class AdBannerWidget extends StatefulWidget {
|
||||
// const AdBannerWidget({Key? key}) : super(key: key);
|
||||
|
||||
// @override
|
||||
// State<AdBannerWidget> createState() => _AdBannerWidgetState();
|
||||
// }
|
||||
|
||||
// class _AdBannerWidgetState extends State<AdBannerWidget> {
|
||||
// BannerAd? _bannerAd; // 광고 객체
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// _initBannerAd();
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _bannerAd?.dispose();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
// /// 배너 광고를 초기화 & 로드
|
||||
// void _initBannerAd() {
|
||||
// _bannerAd = BannerAd(
|
||||
// size: AdSize.banner, // 배너 사이즈(고정)
|
||||
// adUnitId: Config.adUnitId, // 광고 단위 ID (Config에서 직접 가져옴)
|
||||
// listener: BannerAdListener(
|
||||
// onAdLoaded: (Ad ad) {
|
||||
// // 로드 성공 시: _bannerAd를 그대로 두면 됨.
|
||||
// setState(() {/* 굳이 아무 것도 안 해도 됨 */});
|
||||
// },
|
||||
// onAdFailedToLoad: (Ad ad, LoadAdError error) {
|
||||
// // 실패 시: 자원 정리 & null 처리
|
||||
// ad.dispose();
|
||||
// setState(() {
|
||||
// _bannerAd = null;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// request: const AdRequest(),
|
||||
// );
|
||||
|
||||
// // 실제 로드 시작
|
||||
// _bannerAd!.load();
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// // 로딩 전/실패 시 _bannerAd가 null → 빈 위젯 반환
|
||||
// if (_bannerAd == null) {
|
||||
// return const SizedBox.shrink();
|
||||
// }
|
||||
// // 로딩 완료 시 Container에 AdWidget으로 표시
|
||||
// return Container(
|
||||
// color: Colors.white, // 배경색 흰색으로 고정
|
||||
// width: _bannerAd!.size.width.toDouble(),
|
||||
// height: _bannerAd!.size.height.toDouble(),
|
||||
// child: AdWidget(ad: _bannerAd!),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
*/
|
||||
|
||||
// ================== 임시/빈 컴포넌트 ==================
|
||||
class AdBannerWidget extends StatelessWidget {
|
||||
class AdBannerWidget extends StatefulWidget {
|
||||
const AdBannerWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AdBannerWidget> createState() => _AdBannerWidgetState();
|
||||
}
|
||||
|
||||
class _AdBannerWidgetState extends State<AdBannerWidget> {
|
||||
BannerAd? _bannerAd; // 광고 객체
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_initBannerAd();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_bannerAd?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 배너 광고를 초기화 & 로드
|
||||
void _initBannerAd() {
|
||||
_bannerAd = BannerAd(
|
||||
size: AdSize.banner, // 배너 사이즈(고정)
|
||||
adUnitId: Config.adUnitId, // 광고 단위 ID (Config에서 직접 가져옴)
|
||||
listener: BannerAdListener(
|
||||
onAdLoaded: (Ad ad) {
|
||||
// 로드 성공 시: _bannerAd를 그대로 두면 됨.
|
||||
setState(() {/* 굳이 아무 것도 안 해도 됨 */});
|
||||
},
|
||||
onAdFailedToLoad: (Ad ad, LoadAdError error) {
|
||||
// 실패 시: 자원 정리 & null 처리
|
||||
ad.dispose();
|
||||
setState(() {
|
||||
_bannerAd = null;
|
||||
});
|
||||
},
|
||||
),
|
||||
request: const AdRequest(),
|
||||
);
|
||||
|
||||
// 실제 로드 시작
|
||||
_bannerAd!.load();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// (예시) 50dp 높이의 빈 영역을 차지
|
||||
// or return SizedBox.shrink() 로 아예 공간을 안 쓰는 방법도 가능
|
||||
return const SizedBox(
|
||||
height: 50, // 원하는 높이
|
||||
child: ColoredBox(color: Colors.white), // 배경 흰색
|
||||
// 로딩 전/실패 시 _bannerAd가 null → 빈 위젯 반환
|
||||
if (_bannerAd == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
// 로딩 완료 시 Container에 AdWidget으로 표시
|
||||
return Container(
|
||||
color: Colors.white, // 배경색 흰색으로 고정
|
||||
width: _bannerAd!.size.width.toDouble(),
|
||||
height: _bannerAd!.size.height.toDouble(),
|
||||
child: AdWidget(ad: _bannerAd!),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ================== 임시/빈 컴포넌트 ==================
|
||||
// class AdBannerWidget extends StatelessWidget {
|
||||
// const AdBannerWidget({Key? key}) : super(key: key);
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// // (예시) 50dp 높이의 빈 영역을 차지
|
||||
// // or return SizedBox.shrink() 로 아예 공간을 안 쓰는 방법도 가능
|
||||
// return const SizedBox(
|
||||
// height: 50, // 원하는 높이
|
||||
// child: ColoredBox(color: Colors.white), // 배경 흰색
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: allscore_app
|
||||
description: "A new Flutter project."
|
||||
publish_to: 'none'
|
||||
version: 1.0.3+4
|
||||
version: 1.0.5+6
|
||||
|
||||
environment:
|
||||
sdk: ^3.6.0
|
||||
|
Loading…
Reference in New Issue
Block a user