我刚刚开始学习 flutter,我使用 Stateful widget 下面的代码是 main.dart 文件
void main() {
runApp(App());
}
class App extends StatefulWidget {
@override
_AppState createState() => _AppState();
}
class _AppState extends State<App> {
@override
Widget build(BuildContext context) {
// TODO: implement build
return MaterialApp(
home: new Scaffold(backgroundColor: Colors.blueGrey.shade100,
body: Home.Homescreen(HomeText: "default",), //initially setting text to default
appBar: new AppBar(
centerTitle: true,
title: new Text("newApp",
textDirection: TextDirection.ltr,
style: TextStyle(fontSize:20 ,color: Colors.white)),
),
bottomNavigationBar: new BottomNavigationBar(items: [
new BottomNavigationBarItem(
icon: Icon(Icons.home),
title: new Text(
"Home",
textDirection: TextDirection.ltr, …Run Code Online (Sandbox Code Playgroud)