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
child: RaisedButton( | |
child: Text('go to first tab'), | |
onPressed: () { | |
_tabController.animateTo(0, curve: Curves.ease, duration: Duration(seconds: 2)); | |
}, | |
), |
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
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
initialRoute: '/', | |
routes: { | |
'/': (BuildContext context) => HomePage(), | |
'/page1': (BuildContext context) => Page1(), | |
'/page4': (BuildContext context) => Page4(), |
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
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('RichText Widget Demo'), | |
), | |
body: Center( | |
child: ListView( | |
padding: const EdgeInsets.all(20.0), |
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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('RichText Widget Demo'), | |
), | |
body: Center( | |
child: ListView( | |
padding: const EdgeInsets.all(20.0), | |
children: <Widget>[ |
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
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('RichText Widget Demo'), | |
), | |
body: Center( | |
child: ListView( | |
padding: const EdgeInsets.all(20.0), | |
children: <Widget>[ |
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
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('BottomAppBar demo'), | |
), | |
body: Center( | |
child: Text('body'), | |
), |
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
class _ClickCounterState extends State<ClickCounter> { | |
int _count = 0; | |
var keys = [1, 2, 3]; | |
var colors = [Colors.red, Colors.blue, Colors.green]; | |
var borderRadius = [50.0, 30.0, 0.0]; | |
Widget createBox(int key) => Container( | |
decoration: BoxDecoration( | |
color: colors[key], | |
borderRadius: BorderRadius.circular(borderRadius[key]), |
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
transitionBuilder: (Widget child, Animation<double> animation) { | |
return FadeTransition(opacity: animation, child: child); | |
} |
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
class _MyHomePageState extends State<MyHomePage> { | |
AlertDialog _dialog(String title) { | |
return AlertDialog( | |
title: Text(title), | |
actions: <Widget>[ | |
FlatButton( | |
child: Text('back'), | |
onPressed: () { | |
Navigator.pop(context); | |
}, |
OlderNewer