From 89f0d8598430a63a478df49d5f696b604a58a5a2 Mon Sep 17 00:00:00 2001 From: Aquarius-blake Date: Sat, 2 Dec 2023 23:24:51 +0000 Subject: [PATCH] update Group_explore.dart and home.dart --- .../Home/Mobilepages/Group_explore.dart | 25 ++++++++++++------- lib/Screens/Home/home.dart | 25 ++++++++++++++++++- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/lib/Screens/Home/Mobilepages/Group_explore.dart b/lib/Screens/Home/Mobilepages/Group_explore.dart index 4e6881f4..e91f7014 100644 --- a/lib/Screens/Home/Mobilepages/Group_explore.dart +++ b/lib/Screens/Home/Mobilepages/Group_explore.dart @@ -18,15 +18,17 @@ class _GroupExploreState extends State { BannerAd? _bannerAd; Widget ad(index){ - if ((_bannerAd != null) && (index % 6 == 0)){ - return Align( - alignment: Alignment.topCenter, - child: Container( - width: _bannerAd!.size.width.toDouble(), - height: _bannerAd!.size.height.toDouble(), - child: AdWidget(ad: _bannerAd!), + if ((_bannerAd != null) && (index == 0)){ + return StatefulBuilder( + builder: (context,setState) => Align( + alignment: Alignment.topCenter, + child: Container( + width: _bannerAd!.size.width.toDouble(), + height: _bannerAd!.size.height.toDouble(), + child: new AdWidget(ad: _bannerAd!,), + ), ), - ); + ); } else { return Container(); } @@ -41,7 +43,7 @@ class _GroupExploreState extends State { listener: BannerAdListener( onAdLoaded: (ad) { setState(() { - _bannerAd = ad as BannerAd; + _bannerAd = ad as BannerAd; }); }, onAdFailedToLoad: (ad, err) { @@ -54,6 +56,11 @@ class _GroupExploreState extends State { super.initState(); } +@override + void dispose() { + super.dispose(); + } + @override Widget build(BuildContext context) { late UserThemeData themedata= Provider.of(context).getUserThemeData; diff --git a/lib/Screens/Home/home.dart b/lib/Screens/Home/home.dart index dd9c9ecc..7fbf7134 100644 --- a/lib/Screens/Home/home.dart +++ b/lib/Screens/Home/home.dart @@ -11,6 +11,7 @@ import 'package:forum3/Models/Settings.dart'; import 'package:forum3/Models/Users1.dart'; import 'package:forum3/Provider/Settings_provider.dart'; import 'package:forum3/Screens/Forum/Dynamiclink_page.dart'; +import 'package:forum3/Screens/Home/Mobilepages/Group_explore.dart'; import 'package:forum3/Screens/Home/Mobilepages/Group_page.dart'; import 'package:forum3/Screens/Home/Mobilepages/Group_search.dart'; import 'package:forum3/Screens/Home/Mobilepages/MDprofile.dart'; @@ -27,7 +28,6 @@ import 'package:forum3/Services/Upload.dart'; import 'package:forum3/shared/Networkconnection.dart'; import 'package:forum3/shared/Pop_up.dart'; import 'package:get/get.dart'; -import 'package:google_mobile_ads/google_mobile_ads.dart'; import 'package:image_picker/image_picker.dart'; import 'package:line_icons/line_icons.dart'; import 'package:package_info_plus/package_info_plus.dart'; @@ -359,6 +359,29 @@ class _HomeState extends State { }, ), const SizedBox( + height: 5.0, + ),ListTile( + leading: FaIcon( + FontAwesomeIcons.compass, + color: Color(themedata.DrawerIconColor!), + size:35.0, + ), + title: Text( + "Explore Colonies", + style:TextStyle( + color: Color(themedata.DrawerTextColor!), + fontSize: 22.0, + ) + ), + onTap: ()async{ + Navigator.of(context).push( + MaterialPageRoute( + builder: (context)=>GroupExplore(), + ) + ); + }, + ), + SizedBox( height: 5.0, ), ListTile(