Answers for "com.google.android.material.bottomnavigation.bottomnavigationview"

0

flutter bottomNavigationBar

Scaffold(
  body: Container(
    color: Colors.white,
    child: Center(child: Text("Flutter"),),
  ),
  bottomNavigationBar: new Container(
    padding: EdgeInsets.all(0.0),
    child: Row(
      mainAxisSize: MainAxisSize.max,
      children: <Widget>[

        Expanded(
          flex: 1,
          child: FlatButton.icon(
            onPressed: () {
            },
            icon: Icon(Icons.search),
            label: Text("Search"),
          ),
        ),
        Expanded(
          flex: 1,
          child: FlatButton.icon(
            onPressed: () {
            },
            icon: Icon(Icons.search),
            label: Text("Search"),
          ),
        ),
        Expanded(
          flex: 1,
          child: FlatButton.icon(
            onPressed: () {
            },
            icon: Icon(Icons.search),
            label: Text("Search"),
          ),
        ),
      ],
    ),
  ),
);
Posted by: Guest on December-01-2021
1

android bottomnavigationview set current item

BottomNavigationView bottomNavigationView;
bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigationView);
bottomNavigationView.setOnNavigationItemSelectedListener(myNavigationItemListener);
bottomNavigationView.setSelectedItemId(R.id.my_menu_item_id);
Posted by: Guest on August-13-2020
0

How to add one BottomNavigationBarItem only flutter

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Scaffold(
        body: SafeArea(
          child: Text('Hi'),
        ),
        bottomNavigationBar: Container(
          height: 60,
          color: Colors.black12,
          child: InkWell(
            onTap: () => print('tap on close'),
            child: Padding(
              padding: EdgeInsets.only(top: 8.0),
              child: Column(
                children: <Widget>[
                  Icon(
                    Icons.close,
                    color: Theme.of(context).accentColor,
                  ),
                  Text('close'),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
Posted by: Guest on November-29-2021

Browse Popular Code Answers by Language