Advertisement
mrblab24

walfy_explore_app_bar

May 3rd, 2021
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.96 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:wallpaper_app/widgets/new_items.dart';
  3. import 'package:wallpaper_app/widgets/popular_items.dart';
  4.  
  5. class ExplorePage extends StatefulWidget {
  6.   ExplorePage({Key key}) : super(key: key);
  7.  
  8.   @override
  9.   _ExplorePageState createState() => _ExplorePageState();
  10. }
  11.  
  12. class _ExplorePageState extends State<ExplorePage>
  13.     with TickerProviderStateMixin {
  14.   var scaffoldKey = GlobalKey<ScaffoldState>();
  15.   TabController tabController;
  16.  
  17.   @override
  18.   void initState() {
  19.     tabController = TabController(length: 2, vsync: this);
  20.     super.initState();
  21.   }
  22.  
  23.   @override
  24.   Widget build(BuildContext context) {
  25.     return Scaffold(
  26.       key: scaffoldKey,
  27.       appBar: AppBar(
  28.         title: Text('Explore'),
  29.         bottom: TabBar(
  30.               controller: tabController,
  31.               labelStyle: TextStyle(
  32.                   fontSize: 15,
  33.                   fontFamily: 'Poppins',
  34.                   fontWeight: FontWeight.w500),
  35.               tabs: <Widget>[
  36.                 Tab(
  37.                   child: Text('Popular Walfies'),
  38.                 ),
  39.                 Tab(
  40.                   child: Text(
  41.                     'New Walfies',
  42.                   ),
  43.                 )
  44.               ],
  45.               labelColor: Colors.black,
  46.               indicatorColor: Colors.grey[900],
  47.               unselectedLabelColor: Colors.grey,
  48.         ),
  49.       ),
  50.       body: Column(
  51.         children: [
  52.           Expanded(
  53.             child: TabBarView(
  54.               controller: tabController,
  55.               children: <Widget>[
  56.                 PopularItems(),
  57.                 NewItems()
  58.                
  59.               ],
  60.             ),
  61.           ),
  62.           // Align(
  63.           //   alignment: Alignment(0, 1.0),
  64.           //   child: Container(
  65.           //     color: Colors.deepPurpleAccent,
  66.           //     child: facebookBannerAd,
  67.           //   ),
  68.           // ),
  69.         ],
  70.       ),
  71.     );
  72.   }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement