Closed
Description
I create a new flutter app in IDEA, firstly, there are default codes in main.dart, and I ran it normally in my Android phone. I changed main.dart with codes showed in Tutorial. However, after I ran again, the content didn't change any.
my codes in main.dart were :
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
title: "Jean's app",
home: new MyScaffold()
));
}
class MyAppBar extends StatelessWidget {
MyAppBar({this.title});
final Widget title;
@override
Widget build(BuildContext context) {
return new Container(
height: 56.0,
padding: const EdgeInsets.symmetric(horizontal: 8.0),
decoration: new BoxDecoration(backgroundColor: Colors.blue[500]),
child: new Row(
children: <Widget>[
new IconButton(
icon: new Icon(Icons.menu),
tooltip: 'Navigation Menu',
onPressed: null
),
new Flexible(
child: title
),
new IconButton(
icon: new Icon(Icons.search),
tooltip: 'Search',
onPressed: null
)
]
)
);
}
}
class MyScaffold extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Material(
child: new Column(
children: <Widget>[
new AppBar(
title: new Text(
'Example',
style: Theme.of(context).primaryTextTheme.title
)
),
new Flexible(
child: new Center(
child: new Text('Hello Jean')
)
)
]
)
);
}
}