Style BottomNavigationBar in Flutter











up vote
7
down vote

favorite
6












I am trying out Flutter and I am trying to change the colour of the BottomNavigationBar on the app but all I could achieve was change the colour of the BottomNavigationItem (icon and text).



Here is where i declare my BottomNavigationBar:



class _BottomNavigationState extends State<BottomNavigationHolder>{

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: null,
body: pages(),
bottomNavigationBar:new BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
icon: const Icon(Icons.home),
title: new Text("Home")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.work),
title: new Text("Self Help")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.face),
title: new Text("Profile")
)
],
currentIndex: index,
onTap: (int i){setState((){index = i;});},
fixedColor: Colors.white,
),
);
}


Earlier I thought I had it figured out by editing canvasColor to green on my main app theme but it messed up the entire app colour scheme:



class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
canvasColor: Colors.green
),
home: new FirstScreen(),
);
}
}









share|improve this question






















  • I also wanted to change much of the bottomnav, I ended up just copying all the code of the bottomnav and change what I wanted. I guess that is one of the main benefits of Flutter, the openness and ease to do that. I made this: pbs.twimg.com/media/DPkoxKWX0AEg9tF.jpg:large
    – Rene
    Mar 16 at 9:21















up vote
7
down vote

favorite
6












I am trying out Flutter and I am trying to change the colour of the BottomNavigationBar on the app but all I could achieve was change the colour of the BottomNavigationItem (icon and text).



Here is where i declare my BottomNavigationBar:



class _BottomNavigationState extends State<BottomNavigationHolder>{

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: null,
body: pages(),
bottomNavigationBar:new BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
icon: const Icon(Icons.home),
title: new Text("Home")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.work),
title: new Text("Self Help")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.face),
title: new Text("Profile")
)
],
currentIndex: index,
onTap: (int i){setState((){index = i;});},
fixedColor: Colors.white,
),
);
}


Earlier I thought I had it figured out by editing canvasColor to green on my main app theme but it messed up the entire app colour scheme:



class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
canvasColor: Colors.green
),
home: new FirstScreen(),
);
}
}









share|improve this question






















  • I also wanted to change much of the bottomnav, I ended up just copying all the code of the bottomnav and change what I wanted. I guess that is one of the main benefits of Flutter, the openness and ease to do that. I made this: pbs.twimg.com/media/DPkoxKWX0AEg9tF.jpg:large
    – Rene
    Mar 16 at 9:21













up vote
7
down vote

favorite
6









up vote
7
down vote

favorite
6






6





I am trying out Flutter and I am trying to change the colour of the BottomNavigationBar on the app but all I could achieve was change the colour of the BottomNavigationItem (icon and text).



Here is where i declare my BottomNavigationBar:



class _BottomNavigationState extends State<BottomNavigationHolder>{

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: null,
body: pages(),
bottomNavigationBar:new BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
icon: const Icon(Icons.home),
title: new Text("Home")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.work),
title: new Text("Self Help")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.face),
title: new Text("Profile")
)
],
currentIndex: index,
onTap: (int i){setState((){index = i;});},
fixedColor: Colors.white,
),
);
}


Earlier I thought I had it figured out by editing canvasColor to green on my main app theme but it messed up the entire app colour scheme:



class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
canvasColor: Colors.green
),
home: new FirstScreen(),
);
}
}









share|improve this question













I am trying out Flutter and I am trying to change the colour of the BottomNavigationBar on the app but all I could achieve was change the colour of the BottomNavigationItem (icon and text).



Here is where i declare my BottomNavigationBar:



class _BottomNavigationState extends State<BottomNavigationHolder>{

@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: null,
body: pages(),
bottomNavigationBar:new BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
icon: const Icon(Icons.home),
title: new Text("Home")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.work),
title: new Text("Self Help")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.face),
title: new Text("Profile")
)
],
currentIndex: index,
onTap: (int i){setState((){index = i;});},
fixedColor: Colors.white,
),
);
}


Earlier I thought I had it figured out by editing canvasColor to green on my main app theme but it messed up the entire app colour scheme:



class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
canvasColor: Colors.green
),
home: new FirstScreen(),
);
}
}






dart flutter bottomnavigationview






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 15 at 19:34









spongyboss

630625




630625












  • I also wanted to change much of the bottomnav, I ended up just copying all the code of the bottomnav and change what I wanted. I guess that is one of the main benefits of Flutter, the openness and ease to do that. I made this: pbs.twimg.com/media/DPkoxKWX0AEg9tF.jpg:large
    – Rene
    Mar 16 at 9:21


















  • I also wanted to change much of the bottomnav, I ended up just copying all the code of the bottomnav and change what I wanted. I guess that is one of the main benefits of Flutter, the openness and ease to do that. I made this: pbs.twimg.com/media/DPkoxKWX0AEg9tF.jpg:large
    – Rene
    Mar 16 at 9:21
















I also wanted to change much of the bottomnav, I ended up just copying all the code of the bottomnav and change what I wanted. I guess that is one of the main benefits of Flutter, the openness and ease to do that. I made this: pbs.twimg.com/media/DPkoxKWX0AEg9tF.jpg:large
– Rene
Mar 16 at 9:21




I also wanted to change much of the bottomnav, I ended up just copying all the code of the bottomnav and change what I wanted. I guess that is one of the main benefits of Flutter, the openness and ease to do that. I made this: pbs.twimg.com/media/DPkoxKWX0AEg9tF.jpg:large
– Rene
Mar 16 at 9:21












2 Answers
2






active

oldest

votes

















up vote
28
down vote



accepted










There is no option to specify the background color of BottomNavigationBar but to change the canvasColor. One way you can achieve it without messing up the whole app would be by wrapping BottomNavigationBar in a Theme with desired canvasColor.



Example:



  bottomNavigationBar: new Theme(
data: Theme.of(context).copyWith(
// sets the background color of the `BottomNavigationBar`
canvasColor: Colors.green,
// sets the active color of the `BottomNavigationBar` if `Brightness` is light
primaryColor: Colors.red,
textTheme: Theme
.of(context)
.textTheme
.copyWith(caption: new TextStyle(color: Colors.yellow))), // sets the inactive color of the `BottomNavigationBar`
child: new BottomNavigationBar(
type: BottomNavigationBarType.fixed,
currentIndex: 0,
items: [
new BottomNavigationBarItem(
icon: new Icon(Icons.add),
title: new Text("Add"),
),
new BottomNavigationBarItem(
icon: new Icon(Icons.delete),
title: new Text("Delete"),
)
],
),
),


Hope that helps!






share|improve this answer























  • Thank you so much good Sir. Worked perfectly. Do you know anyway of changing the colours of the inactive icons on the bottom navigation bar?
    – spongyboss
    Mar 16 at 11:26










  • ThemeData has a disabledColor property, try setting it.
    – Hemanth Raj
    Mar 16 at 11:35










  • I have actually tried setting all the available attributes under ThemeData to change the inactive icon colour and none of them had an effect hey. Even disabledColor
    – spongyboss
    Mar 16 at 11:54








  • 1




    Actually the disabled color is fetched from caption of textTheme. I've updated my answer to show how can you achive it. Hope that helps!
    – Hemanth Raj
    Mar 16 at 12:01










  • man you the best! Thank you so much.. I doubt I would've figured that out by myself honestly! Thank you so so much!!
    – spongyboss
    Mar 16 at 12:08


















up vote
0
down vote













Try wrapping your BottomNavigationBar in a Container then set its color.



Example:






@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: null,
body: pages(),
bottomNavigationBar:new Container(
color: Colors.green,
child: BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
icon: const Icon(Icons.home),
title: new Text("Home")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.work),
title: new Text("Self Help")
),
new BottomNavigationBarItem(
icon: const Icon(Icons.face),
title: new Text("Profile")
)
],
currentIndex: index,
onTap: (int i){setState((){index = i;});},
fixedColor: Colors.white,
),
);
);
};








share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49307858%2fstyle-bottomnavigationbar-in-flutter%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    28
    down vote



    accepted










    There is no option to specify the background color of BottomNavigationBar but to change the canvasColor. One way you can achieve it without messing up the whole app would be by wrapping BottomNavigationBar in a Theme with desired canvasColor.



    Example:



      bottomNavigationBar: new Theme(
    data: Theme.of(context).copyWith(
    // sets the background color of the `BottomNavigationBar`
    canvasColor: Colors.green,
    // sets the active color of the `BottomNavigationBar` if `Brightness` is light
    primaryColor: Colors.red,
    textTheme: Theme
    .of(context)
    .textTheme
    .copyWith(caption: new TextStyle(color: Colors.yellow))), // sets the inactive color of the `BottomNavigationBar`
    child: new BottomNavigationBar(
    type: BottomNavigationBarType.fixed,
    currentIndex: 0,
    items: [
    new BottomNavigationBarItem(
    icon: new Icon(Icons.add),
    title: new Text("Add"),
    ),
    new BottomNavigationBarItem(
    icon: new Icon(Icons.delete),
    title: new Text("Delete"),
    )
    ],
    ),
    ),


    Hope that helps!






    share|improve this answer























    • Thank you so much good Sir. Worked perfectly. Do you know anyway of changing the colours of the inactive icons on the bottom navigation bar?
      – spongyboss
      Mar 16 at 11:26










    • ThemeData has a disabledColor property, try setting it.
      – Hemanth Raj
      Mar 16 at 11:35










    • I have actually tried setting all the available attributes under ThemeData to change the inactive icon colour and none of them had an effect hey. Even disabledColor
      – spongyboss
      Mar 16 at 11:54








    • 1




      Actually the disabled color is fetched from caption of textTheme. I've updated my answer to show how can you achive it. Hope that helps!
      – Hemanth Raj
      Mar 16 at 12:01










    • man you the best! Thank you so much.. I doubt I would've figured that out by myself honestly! Thank you so so much!!
      – spongyboss
      Mar 16 at 12:08















    up vote
    28
    down vote



    accepted










    There is no option to specify the background color of BottomNavigationBar but to change the canvasColor. One way you can achieve it without messing up the whole app would be by wrapping BottomNavigationBar in a Theme with desired canvasColor.



    Example:



      bottomNavigationBar: new Theme(
    data: Theme.of(context).copyWith(
    // sets the background color of the `BottomNavigationBar`
    canvasColor: Colors.green,
    // sets the active color of the `BottomNavigationBar` if `Brightness` is light
    primaryColor: Colors.red,
    textTheme: Theme
    .of(context)
    .textTheme
    .copyWith(caption: new TextStyle(color: Colors.yellow))), // sets the inactive color of the `BottomNavigationBar`
    child: new BottomNavigationBar(
    type: BottomNavigationBarType.fixed,
    currentIndex: 0,
    items: [
    new BottomNavigationBarItem(
    icon: new Icon(Icons.add),
    title: new Text("Add"),
    ),
    new BottomNavigationBarItem(
    icon: new Icon(Icons.delete),
    title: new Text("Delete"),
    )
    ],
    ),
    ),


    Hope that helps!






    share|improve this answer























    • Thank you so much good Sir. Worked perfectly. Do you know anyway of changing the colours of the inactive icons on the bottom navigation bar?
      – spongyboss
      Mar 16 at 11:26










    • ThemeData has a disabledColor property, try setting it.
      – Hemanth Raj
      Mar 16 at 11:35










    • I have actually tried setting all the available attributes under ThemeData to change the inactive icon colour and none of them had an effect hey. Even disabledColor
      – spongyboss
      Mar 16 at 11:54








    • 1




      Actually the disabled color is fetched from caption of textTheme. I've updated my answer to show how can you achive it. Hope that helps!
      – Hemanth Raj
      Mar 16 at 12:01










    • man you the best! Thank you so much.. I doubt I would've figured that out by myself honestly! Thank you so so much!!
      – spongyboss
      Mar 16 at 12:08













    up vote
    28
    down vote



    accepted







    up vote
    28
    down vote



    accepted






    There is no option to specify the background color of BottomNavigationBar but to change the canvasColor. One way you can achieve it without messing up the whole app would be by wrapping BottomNavigationBar in a Theme with desired canvasColor.



    Example:



      bottomNavigationBar: new Theme(
    data: Theme.of(context).copyWith(
    // sets the background color of the `BottomNavigationBar`
    canvasColor: Colors.green,
    // sets the active color of the `BottomNavigationBar` if `Brightness` is light
    primaryColor: Colors.red,
    textTheme: Theme
    .of(context)
    .textTheme
    .copyWith(caption: new TextStyle(color: Colors.yellow))), // sets the inactive color of the `BottomNavigationBar`
    child: new BottomNavigationBar(
    type: BottomNavigationBarType.fixed,
    currentIndex: 0,
    items: [
    new BottomNavigationBarItem(
    icon: new Icon(Icons.add),
    title: new Text("Add"),
    ),
    new BottomNavigationBarItem(
    icon: new Icon(Icons.delete),
    title: new Text("Delete"),
    )
    ],
    ),
    ),


    Hope that helps!






    share|improve this answer














    There is no option to specify the background color of BottomNavigationBar but to change the canvasColor. One way you can achieve it without messing up the whole app would be by wrapping BottomNavigationBar in a Theme with desired canvasColor.



    Example:



      bottomNavigationBar: new Theme(
    data: Theme.of(context).copyWith(
    // sets the background color of the `BottomNavigationBar`
    canvasColor: Colors.green,
    // sets the active color of the `BottomNavigationBar` if `Brightness` is light
    primaryColor: Colors.red,
    textTheme: Theme
    .of(context)
    .textTheme
    .copyWith(caption: new TextStyle(color: Colors.yellow))), // sets the inactive color of the `BottomNavigationBar`
    child: new BottomNavigationBar(
    type: BottomNavigationBarType.fixed,
    currentIndex: 0,
    items: [
    new BottomNavigationBarItem(
    icon: new Icon(Icons.add),
    title: new Text("Add"),
    ),
    new BottomNavigationBarItem(
    icon: new Icon(Icons.delete),
    title: new Text("Delete"),
    )
    ],
    ),
    ),


    Hope that helps!







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 16 at 12:04

























    answered Mar 16 at 7:28









    Hemanth Raj

    3,8071025




    3,8071025












    • Thank you so much good Sir. Worked perfectly. Do you know anyway of changing the colours of the inactive icons on the bottom navigation bar?
      – spongyboss
      Mar 16 at 11:26










    • ThemeData has a disabledColor property, try setting it.
      – Hemanth Raj
      Mar 16 at 11:35










    • I have actually tried setting all the available attributes under ThemeData to change the inactive icon colour and none of them had an effect hey. Even disabledColor
      – spongyboss
      Mar 16 at 11:54








    • 1




      Actually the disabled color is fetched from caption of textTheme. I've updated my answer to show how can you achive it. Hope that helps!
      – Hemanth Raj
      Mar 16 at 12:01










    • man you the best! Thank you so much.. I doubt I would've figured that out by myself honestly! Thank you so so much!!
      – spongyboss
      Mar 16 at 12:08


















    • Thank you so much good Sir. Worked perfectly. Do you know anyway of changing the colours of the inactive icons on the bottom navigation bar?
      – spongyboss
      Mar 16 at 11:26










    • ThemeData has a disabledColor property, try setting it.
      – Hemanth Raj
      Mar 16 at 11:35










    • I have actually tried setting all the available attributes under ThemeData to change the inactive icon colour and none of them had an effect hey. Even disabledColor
      – spongyboss
      Mar 16 at 11:54








    • 1




      Actually the disabled color is fetched from caption of textTheme. I've updated my answer to show how can you achive it. Hope that helps!
      – Hemanth Raj
      Mar 16 at 12:01










    • man you the best! Thank you so much.. I doubt I would've figured that out by myself honestly! Thank you so so much!!
      – spongyboss
      Mar 16 at 12:08
















    Thank you so much good Sir. Worked perfectly. Do you know anyway of changing the colours of the inactive icons on the bottom navigation bar?
    – spongyboss
    Mar 16 at 11:26




    Thank you so much good Sir. Worked perfectly. Do you know anyway of changing the colours of the inactive icons on the bottom navigation bar?
    – spongyboss
    Mar 16 at 11:26












    ThemeData has a disabledColor property, try setting it.
    – Hemanth Raj
    Mar 16 at 11:35




    ThemeData has a disabledColor property, try setting it.
    – Hemanth Raj
    Mar 16 at 11:35












    I have actually tried setting all the available attributes under ThemeData to change the inactive icon colour and none of them had an effect hey. Even disabledColor
    – spongyboss
    Mar 16 at 11:54






    I have actually tried setting all the available attributes under ThemeData to change the inactive icon colour and none of them had an effect hey. Even disabledColor
    – spongyboss
    Mar 16 at 11:54






    1




    1




    Actually the disabled color is fetched from caption of textTheme. I've updated my answer to show how can you achive it. Hope that helps!
    – Hemanth Raj
    Mar 16 at 12:01




    Actually the disabled color is fetched from caption of textTheme. I've updated my answer to show how can you achive it. Hope that helps!
    – Hemanth Raj
    Mar 16 at 12:01












    man you the best! Thank you so much.. I doubt I would've figured that out by myself honestly! Thank you so so much!!
    – spongyboss
    Mar 16 at 12:08




    man you the best! Thank you so much.. I doubt I would've figured that out by myself honestly! Thank you so so much!!
    – spongyboss
    Mar 16 at 12:08












    up vote
    0
    down vote













    Try wrapping your BottomNavigationBar in a Container then set its color.



    Example:






    @override
    Widget build(BuildContext context) {
    return new Scaffold(
    appBar: null,
    body: pages(),
    bottomNavigationBar:new Container(
    color: Colors.green,
    child: BottomNavigationBar(
    items: <BottomNavigationBarItem>[
    new BottomNavigationBarItem(
    icon: const Icon(Icons.home),
    title: new Text("Home")
    ),
    new BottomNavigationBarItem(
    icon: const Icon(Icons.work),
    title: new Text("Self Help")
    ),
    new BottomNavigationBarItem(
    icon: const Icon(Icons.face),
    title: new Text("Profile")
    )
    ],
    currentIndex: index,
    onTap: (int i){setState((){index = i;});},
    fixedColor: Colors.white,
    ),
    );
    );
    };








    share|improve this answer



























      up vote
      0
      down vote













      Try wrapping your BottomNavigationBar in a Container then set its color.



      Example:






      @override
      Widget build(BuildContext context) {
      return new Scaffold(
      appBar: null,
      body: pages(),
      bottomNavigationBar:new Container(
      color: Colors.green,
      child: BottomNavigationBar(
      items: <BottomNavigationBarItem>[
      new BottomNavigationBarItem(
      icon: const Icon(Icons.home),
      title: new Text("Home")
      ),
      new BottomNavigationBarItem(
      icon: const Icon(Icons.work),
      title: new Text("Self Help")
      ),
      new BottomNavigationBarItem(
      icon: const Icon(Icons.face),
      title: new Text("Profile")
      )
      ],
      currentIndex: index,
      onTap: (int i){setState((){index = i;});},
      fixedColor: Colors.white,
      ),
      );
      );
      };








      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        Try wrapping your BottomNavigationBar in a Container then set its color.



        Example:






        @override
        Widget build(BuildContext context) {
        return new Scaffold(
        appBar: null,
        body: pages(),
        bottomNavigationBar:new Container(
        color: Colors.green,
        child: BottomNavigationBar(
        items: <BottomNavigationBarItem>[
        new BottomNavigationBarItem(
        icon: const Icon(Icons.home),
        title: new Text("Home")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.work),
        title: new Text("Self Help")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.face),
        title: new Text("Profile")
        )
        ],
        currentIndex: index,
        onTap: (int i){setState((){index = i;});},
        fixedColor: Colors.white,
        ),
        );
        );
        };








        share|improve this answer














        Try wrapping your BottomNavigationBar in a Container then set its color.



        Example:






        @override
        Widget build(BuildContext context) {
        return new Scaffold(
        appBar: null,
        body: pages(),
        bottomNavigationBar:new Container(
        color: Colors.green,
        child: BottomNavigationBar(
        items: <BottomNavigationBarItem>[
        new BottomNavigationBarItem(
        icon: const Icon(Icons.home),
        title: new Text("Home")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.work),
        title: new Text("Self Help")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.face),
        title: new Text("Profile")
        )
        ],
        currentIndex: index,
        onTap: (int i){setState((){index = i;});},
        fixedColor: Colors.white,
        ),
        );
        );
        };








        @override
        Widget build(BuildContext context) {
        return new Scaffold(
        appBar: null,
        body: pages(),
        bottomNavigationBar:new Container(
        color: Colors.green,
        child: BottomNavigationBar(
        items: <BottomNavigationBarItem>[
        new BottomNavigationBarItem(
        icon: const Icon(Icons.home),
        title: new Text("Home")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.work),
        title: new Text("Self Help")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.face),
        title: new Text("Profile")
        )
        ],
        currentIndex: index,
        onTap: (int i){setState((){index = i;});},
        fixedColor: Colors.white,
        ),
        );
        );
        };





        @override
        Widget build(BuildContext context) {
        return new Scaffold(
        appBar: null,
        body: pages(),
        bottomNavigationBar:new Container(
        color: Colors.green,
        child: BottomNavigationBar(
        items: <BottomNavigationBarItem>[
        new BottomNavigationBarItem(
        icon: const Icon(Icons.home),
        title: new Text("Home")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.work),
        title: new Text("Self Help")
        ),
        new BottomNavigationBarItem(
        icon: const Icon(Icons.face),
        title: new Text("Profile")
        )
        ],
        currentIndex: index,
        onTap: (int i){setState((){index = i;});},
        fixedColor: Colors.white,
        ),
        );
        );
        };






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 7 at 18:25

























        answered Nov 7 at 18:19









        Billybogz

        33




        33






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49307858%2fstyle-bottomnavigationbar-in-flutter%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()