Row Map Using Bottom Menu Bar In Flutter

Row Map Using Bottom Menu Bar In Flutter :

Row Map Using Bottom Menu Bar In Flutter
import 'package:flutter/material.dart';

void main() => runApp(MaterialApp(
      home: MyApp(),
      debugShowCheckedModeBanner: false,
    ));

class MyApp extends StatefulWidget {
  final Widget child;

  MyApp({Key key, this.child}) : super(key: key);

  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int _currentIndex = 0;
  List<Widget> bottomNavIconList = [
    Icon(
      Icons.home,
      size: 32.0,
    ),
    Icon(
      Icons.search,
      size: 32.0,
    ),
    Icon(
      Icons.favorite,
      size: 32.0,
    ),
    Icon(
      Icons.shop,
      size: 32.0,
    ),
    Icon(
      Icons.settings,
      size: 32.0,
    ),
  ];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white,
        body: ListView(children: <Widget>[
          Padding(
              padding:
                  const EdgeInsets.symmetric(horizontal: 30.0, vertical: 30.0),
              child: Column(children: <Widget>[Text('Title')]))
        ]),
        bottomNavigationBar: Container(
          height: 70.0,
          decoration: BoxDecoration(color: Colors.white, boxShadow: [
            BoxShadow(
                color: Colors.black12.withOpacity(0.065),
                offset: Offset(0.0, -3.0),
                blurRadius: 10.0)
          ]),
          child: Row(
              children: bottomNavIconList.map((item) {
            var index = bottomNavIconList.indexOf(item);
            return Expanded(
                child: GestureDetector(
              onTap: () {
                setState(() {
                  _currentIndex = index;
                });
              },
              child: bottomNavItem(item, index == _currentIndex),
            ));
          }).toList()),
        ));
  }
}

bottomNavItem(Widget item, bool isSelected) => Container(
      decoration: BoxDecoration(
          boxShadow: isSelected
              ? [
                  BoxShadow(
                    color: Colors.black12.withOpacity(.2),
                    offset: Offset(0.0, 5.0),
                    blurRadius: 10.0,
                  )
                ]
              : []),
      child: item,
    );

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit www.fluttertutorial.in