AppBar hides automatically when banner ads loads. With this simple code it hides the appbar when the appbar loaded
See original GitHub issueclass CheckEligibility extends StatefulWidget {
CheckEligibility({Key? key}) : super(key: key);
@override
_CheckEligibilityState createState() => _CheckEligibilityState();
}
class _CheckEligibilityState extends State<CheckEligibility> {
// final double height = 45;
final _formKey = GlobalKey<FormState>();
final salary = TextEditingController();
final existingEMI = TextEditingController();
final interest = TextEditingController();
final year = TextEditingController();
final month = TextEditingController();
final property = TextEditingController();
final agreement = TextEditingController();
final _scrollController = ScrollController();
var data;
late bool salaryError, interestError, yearError, propertyError, agreementError;
late String choosenPercentageOfSalary, choosenPercentageOfProperty, choosenPercentageOfAgreement;
late double netEmi;
late double minLoanAmount = data == null ? double.infinity : data.totalAmount;
late bool isLoading;
late BannerAd _ad2;
void initState() {
super.initState();
netEmi = 0;
minLoanAmount = 0;
choosenPercentageOfSalary = '35';
choosenPercentageOfProperty = choosenPercentageOfAgreement = '60';
isLoading = false;
salaryError = interestError = yearError = propertyError = agreementError = false;
loadBannerAds();
}
void loadBannerAds() {
_ad2 = BannerAd(
size: AdSize.banner,
adUnitId: AdHelper.bannerAdUnitID,
listener: BannerAdListener(
onAdLoaded: (_) {
setState(() {
isLoading = true;
});
},
onAdFailedToLoad: (_, error) {}),
request: AdRequest());
_ad2.load();
}
Widget checkForAd2() {
if (isLoading) {
return Container(
width: _ad2.size.width.toDouble(),
height: _ad2.size.height.toDouble(),
child: AdWidget(
ad: _ad2,
));
} else
return Container();
}
final List<FocusNode> focus = List.generate(7, (index) => FocusNode());
@override
Widget build(BuildContext context) {
return Scaffold(
// appBar: AppBar(
// elevation: 0,
// title: "Check Eligibility".text.make(),
// backgroundColor: primaryColor,
// // leading: IconButton(
// // splashRadius: 20,
// // icon: Icon(Icons.arrow_back),
// // onPressed: () {
// // Navigator.pop(context);
// // Provider.of<AnimateTransition>(context, listen: false).updateHome();
// // },
// // ),
// actions: [
// Tooltip(
// margin: EdgeInsets.only(top: 25),
// height: 60,
// message: 'history',
// child: IconButton(
// padding: EdgeInsets.only(right: 10),
// splashRadius: 20,
// onPressed: () {
// Navigator.push(context,
// EnterExitRoute(enterPage: EmiCalculatorHistory(), exitPage: this.widget, context: context));
// // log('clicked');
// // setState(() {});
// },
// icon: Icon(
// Icons.history,
// size: 39,
// )),
// ),
// ],
// ),
body: Stack(
alignment: Alignment.topCenter,
children: [
Center(child: checkForAd2()),
],
),
);
}
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Place a floating app bar above a list - Flutter documentation
Interactive example. To make it easier for users to view a list of items, you might want to hide the app bar as...
Read more >Flutter - How can I dynamically show or hide App Bars on pages
Now i want to hide app bar when intent from navigation drawer, so please guide me, below is my code. Navigation Screen code....
Read more >Set up the app bar - Android Developers
In its most basic form, the action bar displays the title for the activity on one side and an overflow menu on the...
Read more >Use a keyboard to customize the Quick Access Toolbar
Show or hide the Quick Access Toolbar. In any Microsoft 365 app, press the Alt key. Press Z and then R to expand...
Read more >The Tableau Workspace
In Tableau Desktop, you can hide or display the Tableau toolbar by selecting Window > Show Toolbar. The table below explains the functions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same problem. I still have a part of the user interface disappearing when the ad loads.
flutter doctor -v
I don’t know the actual fix but I will suggest you to do a manual downgrade of all packages one by one and check whether the AppBar is disappeared or not.