화면 깨짐현상 버그들 조치
This commit is contained in:
parent
eb51a6f6ee
commit
e8734b0df4
@ -20,8 +20,8 @@ android {
|
|||||||
applicationId "com.allscore_app"
|
applicationId "com.allscore_app"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 34
|
targetSdkVersion 34
|
||||||
versionCode 4
|
versionCode 6
|
||||||
versionName "1.0.3"
|
versionName "1.0.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
@ -14,6 +14,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth_client": [
|
"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_id": "452355332155-t29ceato8o62c9kq9drefe7b6hd1ka1d.apps.googleusercontent.com",
|
||||||
"client_type": 1,
|
"client_type": 1,
|
||||||
@ -38,6 +46,13 @@
|
|||||||
{
|
{
|
||||||
"client_id": "452355332155-jv26k1rs4tro38tc99mffid2e3gbra6j.apps.googleusercontent.com",
|
"client_id": "452355332155-jv26k1rs4tro38tc99mffid2e3gbra6j.apps.googleusercontent.com",
|
||||||
"client_type": 3
|
"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">
|
android:icon="@mipmap/ic_launcher">
|
||||||
|
|
||||||
<!-- ★ 여기에 meta-data 추가 ★ -->
|
<!-- ★ 여기에 meta-data 추가 ★ -->
|
||||||
<meta-data
|
<!-- <meta-data
|
||||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
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" -->
|
<!-- android:value="ca-app-pub-6461991944599918~9492697896" -->
|
||||||
|
|
||||||
<!-- 구글 로그인 관련 -->
|
<!-- 구글 로그인 관련 -->
|
||||||
<meta-data
|
<!-- <meta-data
|
||||||
android:name="com.google.android.gms.auth.api.signin.client_id"
|
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
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
@ -383,15 +383,19 @@ class _UserInfoPrivateDialogState extends State<UserInfoPrivateDialog> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
] else ...[
|
] else ...[
|
||||||
ElevatedButton(
|
SizedBox(
|
||||||
onPressed: () => Navigator.pop(context),
|
width: 80 * scaleFactor,
|
||||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.black, padding: EdgeInsets.zero, minimumSize: Size(0, 30), tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
height: 40 * scaleFactor,
|
||||||
child: FittedBox(
|
child: ElevatedButton(
|
||||||
fit: BoxFit.contain,
|
onPressed: () => Navigator.pop(context),
|
||||||
child: Text(
|
style: ElevatedButton.styleFrom(backgroundColor: Colors.black, padding: EdgeInsets.zero, minimumSize: Size(0, 30), tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
||||||
'OK'
|
child: FittedBox(
|
||||||
/* '확인' */,
|
fit: BoxFit.contain,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12 * scaleFactor),
|
child: Text(
|
||||||
|
'OK'
|
||||||
|
/* '확인' */,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 12 * scaleFactor),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -428,15 +428,18 @@ class _UserInfoTeamDialogState extends State<UserInfoTeamDialog> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
] else ...[
|
] else ...[
|
||||||
// If not the master, only "OK" (일반 유저는 "확인"만)
|
SizedBox(
|
||||||
ElevatedButton(
|
width: 80 * scaleFactor,
|
||||||
onPressed: () => Navigator.pop(context),
|
height: 40 * scaleFactor,
|
||||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.black, padding: EdgeInsets.zero, minimumSize: Size(0, 30), tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
child: ElevatedButton(
|
||||||
child: AutoSizeText(
|
onPressed: () => Navigator.pop(context),
|
||||||
'OK'
|
style: ElevatedButton.styleFrom(backgroundColor: Colors.black, padding: EdgeInsets.zero, minimumSize: Size(0, 30), tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
||||||
/* '확인' */,
|
child: AutoSizeText(
|
||||||
maxLines: 1,
|
'OK'
|
||||||
style: const TextStyle(color: Colors.white),
|
/* '확인' */,
|
||||||
|
maxLines: 1,
|
||||||
|
style: const TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -25,6 +25,12 @@ void main() async {
|
|||||||
// 모바일 광고 초기화
|
// 모바일 광고 초기화
|
||||||
MobileAds.instance.initialize();
|
MobileAds.instance.initialize();
|
||||||
|
|
||||||
|
RequestConfiguration configuration = RequestConfiguration(
|
||||||
|
testDeviceIds: ["CF2323B16A2434EF4291F29404AD42AC"], // 여기에 자신의 기기 ID 추가
|
||||||
|
);
|
||||||
|
|
||||||
|
MobileAds.instance.updateRequestConfiguration(configuration);
|
||||||
|
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,85 +1,83 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
// import 'package:google_mobile_ads/google_mobile_ads.dart';
|
import 'package:google_mobile_ads/google_mobile_ads.dart';
|
||||||
// import '../config/config.dart';
|
import '../config/config.dart';
|
||||||
|
|
||||||
/*
|
|
||||||
// ================== 기존 코드 (전체 주석 처리) ==================
|
// ================== 기존 코드 (전체 주석 처리) ==================
|
||||||
|
|
||||||
// class AdBannerWidget extends StatefulWidget {
|
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 {
|
|
||||||
const AdBannerWidget({Key? key}) : super(key: key);
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// (예시) 50dp 높이의 빈 영역을 차지
|
// 로딩 전/실패 시 _bannerAd가 null → 빈 위젯 반환
|
||||||
// or return SizedBox.shrink() 로 아예 공간을 안 쓰는 방법도 가능
|
if (_bannerAd == null) {
|
||||||
return const SizedBox(
|
return const SizedBox.shrink();
|
||||||
height: 50, // 원하는 높이
|
}
|
||||||
child: ColoredBox(color: Colors.white), // 배경 흰색
|
// 로딩 완료 시 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
|
name: allscore_app
|
||||||
description: "A new Flutter project."
|
description: "A new Flutter project."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 1.0.3+4
|
version: 1.0.5+6
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.6.0
|
sdk: ^3.6.0
|
||||||
|
Loading…
Reference in New Issue
Block a user