Верхняя часть экрана при запуске приложения показывает этикетку с заголовком приложения ⇐ Android
-
Anonymous
Верхняя часть экрана при запуске приложения показывает этикетку с заголовком приложения
, ребята, я не знаю, что делать, вдруг этот этикет Решено.
Это мой домашний файл, но я на самом деле считаю, что это проблема в файле manifest.xml < /p>
import 'dart:async';
import 'package:dices_app/icons/d6_icons.dart';
import 'package:dices_app/icons/d8_icons.dart';
import 'package:dices_app/icons/percent_icons.dart';
import 'package:firebase_admob/firebase_admob.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'icons/dices_icons.dart';
import 'functions.dart';
import 'icons/skulls_icons.dart';
import 'icons/nice_icons_icons.dart';
import 'history.dart';
import 'dice.dart';
import 'dart:io';
import 'package:firebase_admob/firebase_admob.dart';
import 'package:firebase_core/firebase_core.dart';
String AD_REWARDED_ID = 'ca-app-pub-3940256099942544/5224354917';
String AD_BANNER_ID = 'ca-app-pub-6798357699412375/6371632425';
String AD_INTERSTITIAL_ID = 'ca-app-pub-3940256099942544/1033173712';
String APP_ID = 'ca-app-pub-6798357699412375~3611228404';
RewardedVideoAd videoAd = RewardedVideoAd.instance;
InterstitialAd interstitialAd;
BannerAd myBanner = BannerAd(
adUnitId: BannerAd.testAdUnitId,
size: AdSize.smartBanner,
listener: (event) => ('banner event is $event'),
targetingInfo: targetingInfo
);
InterstitialAd myInterstitial() {
return InterstitialAd(
adUnitId: InterstitialAd.testAdUnitId,
targetingInfo: targetingInfo,
listener: (MobileAdEvent event) {
if (event == MobileAdEvent.failedToLoad) {
interstitialAd..load();
} else if (event == MobileAdEvent.closed) {
interstitialAd = myInterstitial()..load();
}
},
);
}
Color bgColor = isDarkMode ? Color(0x2D050401) : Color(0xff03ed19);
Color appBarColor = isDarkMode ? Colors.grey[900] : Color(0xd66a994e);
Color iconColor = isDarkMode ? Color(0xE9F02D3A) : Colors.black;
Color textColor = isDarkMode ? Color(0xE9F02D3A) : Colors.black;
Color cardColor = isDarkMode ? Colors.white10 : Colors.white;
Color buttonColor = isDarkMode ? Colors.grey[900] : Colors.grey[350];
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
keywords: ['games', 'dices', 'random', 'boardgames'],
childDirected: false,
);
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
bool noAds = false;
bool switchValue = true;
bool isDarkMode = true;
class _HomeState extends State with SingleTickerProviderStateMixin {
TabController _tabController;
List tabs = [
Tab(
child: Text(
'Dices',
style: TextStyle(fontSize: 30),
),
),
Tab(
child: Text(
'History',
style: TextStyle(fontSize: 30),
),
),
];
@override
void dispose() {
interstitialAd?.dispose();
if (noAds == true) {
myBanner?.dispose();
super.dispose();
}
}
@override
void initState() {
super.initState();
noAds = false;
FirebaseAdMob.instance.initialize(appId: FirebaseAdMob.testAppId);
_tabController = TabController(vsync: this, length: tabs.length);
if (noAds != true) {
myBanner
..load()
..show(
// Positions the banner ad 60 pixels from the bottom of the screen
anchorType: AnchorType.bottom,
);
}
interstitialAd = myInterstitial()..load();
videoAd.load(adUnitId: AD_REWARDED_ID);
videoAd.listener =
(RewardedVideoAdEvent event, {String rewardType, int rewardAmount}) {
print('rewarded video ad $event');
if (event == RewardedVideoAdEvent.rewarded) {
noAds = true;
Timer(Duration(minutes: rewardAmount), () {
noAds = false;
});
}
if (event == RewardedVideoAdEvent.closed) {
videoAd.load(adUnitId: RewardedVideoAd.testAdUnitId);
}
};
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: appBarColor,
iconTheme: IconThemeData(color: iconColor),
bottom: TabBar(
controller: _tabController,
tabs: tabs,
labelColor: textColor,
indicatorColor: iconColor,
),
),
drawer: Drawer(
child: Container(
color: isDarkMode ? Colors.grey[900] : Color(0x35A6A6A8),
child: ListView(children: [
SizedBox(
height: 50,
),
ListTile(
title: Text(
'DarkMode / Light Mode',
style: TextStyle(
color: textColor,
fontWeight: FontWeight.bold,
fontSize: 20,
),
textAlign: TextAlign.center,
),
subtitle: Stack(alignment: Alignment.center, children: [
Switch(
value: switchValue,
onChanged: (val) {
setState(() {
isDarkMode = val;
switchValue = val;
bgColor = isDarkMode
? Color(0x2D050401)
: Color(0xff03ed19);
appBarColor = isDarkMode
? Colors.grey[900]
: Color(0xd66a994e);
iconColor = isDarkMode
? Color(0xE9F02D3A)
: Colors.black;
textColor =
isDarkMode ? Color(0xE9F02D3A) : Colors.black;
cardColor =
isDarkMode ? Colors.white10 : Colors.white;
buttonColor = isDarkMode
? Colors.grey[900]
: Colors.grey[350];
});
},
),
]),
),
SizedBox(
height: 20,
),
Divider(color: Colors.black,),
SizedBox(
height: 20,
),
Column(children: [
ListTile(
title: Text(
'Watch a video to get 30 minutes of no ads',
style: TextStyle(
fontSize: 20,
color: textColor,
fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
onTap: () {
},
),
FlatButton.icon(
icon: Icon(
Icons.play_circle_filled,
size: 80,
),
onPressed: () {
videoAd.show();
}, label: Text(''),
),
])
]))),
backgroundColor: bgColor,
body: Container(
//height: MediaQuery.of(context).size.height - 60,
margin: EdgeInsets.only(bottom: 50),
child: TabBarView(controller: _tabController, children: [
ListView(children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Dice(
icon: D6.dice_6,
func: roll6,
type: 'D6',
),
SizedBox(
height: 20.0,
),
Text(' 6 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
icon: NiceIcons.d4,
func: roll4,
type: 'D4',
),
SizedBox(
height: 20.0,
),
Text(' 4 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
icon: NiceIcons.d20,
func: roll20,
type: 'D20',
),
SizedBox(
height: 20.0,
),
Text(' 20 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
icon: NiceIcons.d10,
func: roll10,
type: 'D10',
),
SizedBox(
height: 20.0,
),
Text(' 10 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
type: 'D8',
func: roll8,
icon: D8.dice_eight_faces_eight,
),
SizedBox(
height: 20.0,
),
Text(' 8 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
func: cluedo,
icon: cluedoIcon,
type: 'Cluedo',
),
SizedBox(
height: 20.0,
),
Text(' Cluedo dices',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
]),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Dice(
icon: Skulls.monetization_on,
func: flipACoin,
type: 'Coin Flip',
),
SizedBox(
height: 20.0,
),
Text('Flip a coin ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton.icon(
onPressed: () {
Navigator.pushNamed(context, '/xfaced',
arguments: {
'isDarkMode': isDarkMode,
});
},
icon: Icon(
NiceIcons.xfaced,
size: 120,
color: iconColor,
),
label: Text(''),
),
],
),
SizedBox(
height: 20.0,
),
Text('X faced dice ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black,
)),
SizedBox(
height: 20.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton.icon(
onPressed: () {
Navigator.pushNamed(context, '/deathroll',
arguments: {
'isDarkMode': isDarkMode,
});
},
icon: Icon(
Skulls.skull,
size: 120,
color: iconColor,
),
label: Text(''),
),
],
),
SizedBox(
height: 20.0,
),
Text('Roll to death! ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black,
)),
SizedBox(
height: 20.0,
),
Dice(
type: 'D12',
func: roll12,
icon: NiceIcons.d12,
),
SizedBox(
height: 20.0,
),
Text('12 faced dice ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
type: 'Monopoly Speedy',
image: Image.asset(
'images/pngbarn.png',
scale: 4,
),
func: speedy,
),
SizedBox(
height: 20.0,
),
Text('Monopoly Dices + speedy',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
type: 'D%',
icon: Percent.percent,
func: rollPercent,
),
SizedBox(
height: 20.0,
),
Text(' Percent dice ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
],
)
],
),
]),
History()
]),
));
}
< /code>
android manifest.xml:
Подробнее здесь: https://stackoverflow.com/questions/634 ... -app-title
, ребята, я не знаю, что делать, вдруг этот этикет Решено.
Это мой домашний файл, но я на самом деле считаю, что это проблема в файле manifest.xml < /p>
import 'dart:async';
import 'package:dices_app/icons/d6_icons.dart';
import 'package:dices_app/icons/d8_icons.dart';
import 'package:dices_app/icons/percent_icons.dart';
import 'package:firebase_admob/firebase_admob.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'icons/dices_icons.dart';
import 'functions.dart';
import 'icons/skulls_icons.dart';
import 'icons/nice_icons_icons.dart';
import 'history.dart';
import 'dice.dart';
import 'dart:io';
import 'package:firebase_admob/firebase_admob.dart';
import 'package:firebase_core/firebase_core.dart';
String AD_REWARDED_ID = 'ca-app-pub-3940256099942544/5224354917';
String AD_BANNER_ID = 'ca-app-pub-6798357699412375/6371632425';
String AD_INTERSTITIAL_ID = 'ca-app-pub-3940256099942544/1033173712';
String APP_ID = 'ca-app-pub-6798357699412375~3611228404';
RewardedVideoAd videoAd = RewardedVideoAd.instance;
InterstitialAd interstitialAd;
BannerAd myBanner = BannerAd(
adUnitId: BannerAd.testAdUnitId,
size: AdSize.smartBanner,
listener: (event) => ('banner event is $event'),
targetingInfo: targetingInfo
);
InterstitialAd myInterstitial() {
return InterstitialAd(
adUnitId: InterstitialAd.testAdUnitId,
targetingInfo: targetingInfo,
listener: (MobileAdEvent event) {
if (event == MobileAdEvent.failedToLoad) {
interstitialAd..load();
} else if (event == MobileAdEvent.closed) {
interstitialAd = myInterstitial()..load();
}
},
);
}
Color bgColor = isDarkMode ? Color(0x2D050401) : Color(0xff03ed19);
Color appBarColor = isDarkMode ? Colors.grey[900] : Color(0xd66a994e);
Color iconColor = isDarkMode ? Color(0xE9F02D3A) : Colors.black;
Color textColor = isDarkMode ? Color(0xE9F02D3A) : Colors.black;
Color cardColor = isDarkMode ? Colors.white10 : Colors.white;
Color buttonColor = isDarkMode ? Colors.grey[900] : Colors.grey[350];
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
keywords: ['games', 'dices', 'random', 'boardgames'],
childDirected: false,
);
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
bool noAds = false;
bool switchValue = true;
bool isDarkMode = true;
class _HomeState extends State with SingleTickerProviderStateMixin {
TabController _tabController;
List tabs = [
Tab(
child: Text(
'Dices',
style: TextStyle(fontSize: 30),
),
),
Tab(
child: Text(
'History',
style: TextStyle(fontSize: 30),
),
),
];
@override
void dispose() {
interstitialAd?.dispose();
if (noAds == true) {
myBanner?.dispose();
super.dispose();
}
}
@override
void initState() {
super.initState();
noAds = false;
FirebaseAdMob.instance.initialize(appId: FirebaseAdMob.testAppId);
_tabController = TabController(vsync: this, length: tabs.length);
if (noAds != true) {
myBanner
..load()
..show(
// Positions the banner ad 60 pixels from the bottom of the screen
anchorType: AnchorType.bottom,
);
}
interstitialAd = myInterstitial()..load();
videoAd.load(adUnitId: AD_REWARDED_ID);
videoAd.listener =
(RewardedVideoAdEvent event, {String rewardType, int rewardAmount}) {
print('rewarded video ad $event');
if (event == RewardedVideoAdEvent.rewarded) {
noAds = true;
Timer(Duration(minutes: rewardAmount), () {
noAds = false;
});
}
if (event == RewardedVideoAdEvent.closed) {
videoAd.load(adUnitId: RewardedVideoAd.testAdUnitId);
}
};
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: appBarColor,
iconTheme: IconThemeData(color: iconColor),
bottom: TabBar(
controller: _tabController,
tabs: tabs,
labelColor: textColor,
indicatorColor: iconColor,
),
),
drawer: Drawer(
child: Container(
color: isDarkMode ? Colors.grey[900] : Color(0x35A6A6A8),
child: ListView(children: [
SizedBox(
height: 50,
),
ListTile(
title: Text(
'DarkMode / Light Mode',
style: TextStyle(
color: textColor,
fontWeight: FontWeight.bold,
fontSize: 20,
),
textAlign: TextAlign.center,
),
subtitle: Stack(alignment: Alignment.center, children: [
Switch(
value: switchValue,
onChanged: (val) {
setState(() {
isDarkMode = val;
switchValue = val;
bgColor = isDarkMode
? Color(0x2D050401)
: Color(0xff03ed19);
appBarColor = isDarkMode
? Colors.grey[900]
: Color(0xd66a994e);
iconColor = isDarkMode
? Color(0xE9F02D3A)
: Colors.black;
textColor =
isDarkMode ? Color(0xE9F02D3A) : Colors.black;
cardColor =
isDarkMode ? Colors.white10 : Colors.white;
buttonColor = isDarkMode
? Colors.grey[900]
: Colors.grey[350];
});
},
),
]),
),
SizedBox(
height: 20,
),
Divider(color: Colors.black,),
SizedBox(
height: 20,
),
Column(children: [
ListTile(
title: Text(
'Watch a video to get 30 minutes of no ads',
style: TextStyle(
fontSize: 20,
color: textColor,
fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
onTap: () {
},
),
FlatButton.icon(
icon: Icon(
Icons.play_circle_filled,
size: 80,
),
onPressed: () {
videoAd.show();
}, label: Text(''),
),
])
]))),
backgroundColor: bgColor,
body: Container(
//height: MediaQuery.of(context).size.height - 60,
margin: EdgeInsets.only(bottom: 50),
child: TabBarView(controller: _tabController, children: [
ListView(children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Dice(
icon: D6.dice_6,
func: roll6,
type: 'D6',
),
SizedBox(
height: 20.0,
),
Text(' 6 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
icon: NiceIcons.d4,
func: roll4,
type: 'D4',
),
SizedBox(
height: 20.0,
),
Text(' 4 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
icon: NiceIcons.d20,
func: roll20,
type: 'D20',
),
SizedBox(
height: 20.0,
),
Text(' 20 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
icon: NiceIcons.d10,
func: roll10,
type: 'D10',
),
SizedBox(
height: 20.0,
),
Text(' 10 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
type: 'D8',
func: roll8,
icon: D8.dice_eight_faces_eight,
),
SizedBox(
height: 20.0,
),
Text(' 8 faced dice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
func: cluedo,
icon: cluedoIcon,
type: 'Cluedo',
),
SizedBox(
height: 20.0,
),
Text(' Cluedo dices',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
]),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Dice(
icon: Skulls.monetization_on,
func: flipACoin,
type: 'Coin Flip',
),
SizedBox(
height: 20.0,
),
Text('Flip a coin ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton.icon(
onPressed: () {
Navigator.pushNamed(context, '/xfaced',
arguments: {
'isDarkMode': isDarkMode,
});
},
icon: Icon(
NiceIcons.xfaced,
size: 120,
color: iconColor,
),
label: Text(''),
),
],
),
SizedBox(
height: 20.0,
),
Text('X faced dice ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black,
)),
SizedBox(
height: 20.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton.icon(
onPressed: () {
Navigator.pushNamed(context, '/deathroll',
arguments: {
'isDarkMode': isDarkMode,
});
},
icon: Icon(
Skulls.skull,
size: 120,
color: iconColor,
),
label: Text(''),
),
],
),
SizedBox(
height: 20.0,
),
Text('Roll to death! ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black,
)),
SizedBox(
height: 20.0,
),
Dice(
type: 'D12',
func: roll12,
icon: NiceIcons.d12,
),
SizedBox(
height: 20.0,
),
Text('12 faced dice ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
type: 'Monopoly Speedy',
image: Image.asset(
'images/pngbarn.png',
scale: 4,
),
func: speedy,
),
SizedBox(
height: 20.0,
),
Text('Monopoly Dices + speedy',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
Dice(
type: 'D%',
icon: Percent.percent,
func: rollPercent,
),
SizedBox(
height: 20.0,
),
Text(' Percent dice ',
style: TextStyle(
fontWeight: FontWeight.bold,
color: isDarkMode ? Colors.white : Colors.black)),
SizedBox(
height: 20.0,
),
],
)
],
),
]),
History()
]),
));
}
< /code>
android manifest.xml:
Подробнее здесь: https://stackoverflow.com/questions/634 ... -app-title
Мобильная версия