Created
April 12, 2021 23:55
-
-
Save YasuoFromDeadScream/bb2b7e15200ead1d3e2716a9d7232208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'bottom_navi_bar.dart'; | |
void main() => runApp(const App()); | |
class App extends StatelessWidget { | |
const App({Key key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: const _HomePage(), | |
); | |
} | |
} | |
class _HomePage extends StatefulWidget { | |
const _HomePage({Key key}) : super(key: key); | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<_HomePage> { | |
var _currentIndex = 1; | |
void callback(int index) { | |
setState(() { | |
this._currentIndex = index; | |
debugPrint("this._currentIndex:" + this._currentIndex.toString()); | |
}); | |
} | |
@override | |
Widget build(BuildContext context) { | |
BottomNavigationDemo b = new BottomNavigationDemo(callback: callback); | |
return Scaffold( | |
body: Center( | |
child: Text(this._currentIndex.toString()), | |
), | |
bottomNavigationBar: b, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment