@@ -239,74 +239,76 @@ class _HomePageState extends ConsumerState<HomePage> {
239239 }
240240 return const SizedBox .shrink ();
241241 }),
242- body: NavbarRouter (
243- errorBuilder: (context) {
244- return const Center (child: Text ('Error 404' ));
245- },
246- isDesktop: size.width > 600 ? true : false ,
247- onBackButtonPressed: (isExitingApp) {
248- if (isExitingApp) {
249- newTime = DateTime .now ();
250- int difference = newTime.difference (oldTime).inMilliseconds;
251- oldTime = newTime;
252- if (difference < 1000 ) {
253- NavbarNotifier .hideSnackBar (context);
254- return isExitingApp;
242+ body: Builder (builder: (context) {
243+ return NavbarRouter (
244+ errorBuilder: (context) {
245+ return const Center (child: Text ('Error 404' ));
246+ },
247+ isDesktop: size.width > 600 ? true : false ,
248+ onBackButtonPressed: (isExitingApp) {
249+ if (isExitingApp) {
250+ newTime = DateTime .now ();
251+ int difference = newTime.difference (oldTime).inMilliseconds;
252+ oldTime = newTime;
253+ if (difference < 1000 ) {
254+ NavbarNotifier .hideSnackBar (context);
255+ return isExitingApp;
256+ } else {
257+ final state = Scaffold .of (context);
258+ NavbarNotifier .showSnackBar (
259+ context,
260+ "Tap back button again to exit" ,
261+ bottom: state.hasFloatingActionButton ? 0 : kNavbarHeight,
262+ );
263+ return false ;
264+ }
255265 } else {
256- final state = Scaffold .of (context);
257- NavbarNotifier .showSnackBar (
258- context,
259- "Tap back button again to exit" ,
260- bottom: state.hasFloatingActionButton ? 0 : kNavbarHeight,
261- );
262- return false ;
266+ return isExitingApp;
263267 }
264- } else {
265- return isExitingApp;
266- }
267- },
268- initialIndex: 0 ,
269- type: NavbarType .floating,
270- destinationAnimationCurve: Curves .fastOutSlowIn,
271- destinationAnimationDuration: 200 ,
272- decoration: FloatingNavbarDecoration (
273- height: 80 ,
274- // minExtendedWidth: 226,
275- // minWidth: 92,
276- borderRadius: BorderRadius .circular (20 ),
277- isExtended: size.width > 800 ? true : false ,
278- // labelTextStyle: const TextStyle(
279- // color: Color.fromARGB(255, 176, 207, 233), fontSize: 14),
280- // elevation: 3.0,
281- // indicatorShape: const RoundedRectangleBorder(
282- // borderRadius: BorderRadius.all(Radius.circular(20)),
283- // ),
284- backgroundColor:
285- Theme .of (context).colorScheme.surfaceContainerHighest,
286- // indicatorColor: const Color.fromARGB(255, 176, 207, 233),
287- // // iconTheme: const IconThemeData(color: Colors.indigo),
288- // /// labelTextStyle: const TextStyle(color: Colors.white, fontSize: 14),
289- // labelBehavior: NavigationDestinationLabelBehavior.alwaysShow
290- ),
291- onChanged: (x) {
292- ref.read (appProvider.notifier).setIndex (x);
293- },
294- backButtonBehavior: BackButtonBehavior .rememberHistory,
295- destinations: [
296- for (int i = 0 ; i < items.length; i++ )
297- DestinationRouter (
298- navbarItem: items[i],
299- destinations: [
300- for (int j = 0 ; j < _routes[i]! .keys.length; j++ )
301- Destination (
302- route: _routes[i]! .keys.elementAt (j),
303- widget: _routes[i]! .values.elementAt (j),
304- ),
305- ],
306- initialRoute: _routes[i]! .keys.first,
307- ),
308- ],
309- ),
268+ },
269+ initialIndex: 0 ,
270+ type: NavbarType .floating,
271+ destinationAnimationCurve: Curves .fastOutSlowIn,
272+ destinationAnimationDuration: 200 ,
273+ decoration: FloatingNavbarDecoration (
274+ height: 80 ,
275+ // minExtendedWidth: 226,
276+ // minWidth: 92,
277+ borderRadius: BorderRadius .circular (20 ),
278+ isExtended: size.width > 800 ? true : false ,
279+ // labelTextStyle: const TextStyle(
280+ // color: Color.fromARGB(255, 176, 207, 233), fontSize: 14),
281+ // elevation: 3.0,
282+ // indicatorShape: const RoundedRectangleBorder(
283+ // borderRadius: BorderRadius.all(Radius.circular(20)),
284+ // ),
285+ backgroundColor:
286+ Theme .of (context).colorScheme.surfaceContainerHighest,
287+ // indicatorColor: const Color.fromARGB(255, 176, 207, 233),
288+ // // iconTheme: const IconThemeData(color: Colors.indigo),
289+ // /// labelTextStyle: const TextStyle(color: Colors.white, fontSize: 14),
290+ // labelBehavior: NavigationDestinationLabelBehavior.alwaysShow
291+ ),
292+ onChanged: (x) {
293+ ref.read (appProvider.notifier).setIndex (x);
294+ },
295+ backButtonBehavior: BackButtonBehavior .rememberHistory,
296+ destinations: [
297+ for (int i = 0 ; i < items.length; i++ )
298+ DestinationRouter (
299+ navbarItem: items[i],
300+ destinations: [
301+ for (int j = 0 ; j < _routes[i]! .keys.length; j++ )
302+ Destination (
303+ route: _routes[i]! .keys.elementAt (j),
304+ widget: _routes[i]! .values.elementAt (j),
305+ ),
306+ ],
307+ initialRoute: _routes[i]! .keys.first,
308+ ),
309+ ],
310+ );
311+ }),
310312 );
311313 }
312314}
@@ -416,9 +418,10 @@ class FeedTile extends StatelessWidget {
416418 Container (
417419 padding: const EdgeInsets .symmetric (horizontal: 8.0 ),
418420 alignment: Alignment .center,
419- child: Text (
420- placeHolderText.substring (0 , 200 ),
421- textAlign: TextAlign .justify,
421+ child: const Text (
422+ placeHolderText,
423+ maxLines: 4 ,
424+ overflow: TextOverflow .ellipsis,
422425 ))
423426 ],
424427 ),
0 commit comments