CopyPastor

Detecting plagiarism made easy.

Score: 0.8212217688560486; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2022-11-04
by eamirho3ein

Original Post

Original - Posted on 2020-03-20
by Newaj



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Try this:

InkWell( onTap: () async { showModalBottomSheet( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16.0), ), backgroundColor: Colors.white, builder: (BuildContext context) { return Column( children: [ ElevatedButton( onPressed: () { Navigator.pop(context); }, child: Text('Botton 1')), SizedBox( height: 20, ), ElevatedButton( onPressed: () {}, child: Text('Botton 2')) ], ); }, context: context); }, child: Text('show'), ),
For keeping state in `BottomNavigationBar`, you can use `IndexedStack`
@override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: BottomNavigationBar( onTap: (index) { setState(() { current_tab = index; }); }, currentIndex: current_tab, items: [ BottomNavigationBarItem( ... ), BottomNavigationBarItem( ... ), ], ), body: IndexedStack( children: <Widget>[ PageOne(), PageTwo(), ], index: current_tab, ), ); }

        
Present in both answers; Present only in the new answer; Present only in the old answer;