ImageIcon(
AssetImage("images/icon_more.png"),
color: Color(0xFF3A5A98),
),
Thứ Sáu, 15 tháng 11, 2019
Cập nhật ImageIcon trong flutter
Thứ Năm, 14 tháng 11, 2019
Load data before Widget build in flutter
@override
initState() {
super.initState();
loadData().then((result) {
print(result);
setState(() {
asyncWidget = result;
});
});
}
loadData() async {
var widget = new AsyncWidget();
return widget.build();
}
@override
Widget build(BuildContext context) {
if(asyncWidget == null) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Loading..."),
),
);
} else {
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Center(
child: this.asyncWidget,
),
);
}
}
}
Thứ Tư, 13 tháng 11, 2019
Bo viền flutter
Container(
margin: EdgeInsets.all(32),
decoration: BoxDecoration(border: Border.all(color: Colors.red)),
child: ListView(
shrinkWrap: false,
children: <Widget>[
ListTile(title: Text('Item 1')),
ListTile(title: Text('Item 2')),
ListTile(title: Text('Item 3')),
],
),
Thứ Năm, 24 tháng 10, 2019
Thứ Ba, 22 tháng 10, 2019
Check the device in Flutter
f (Platform.isIOS) {
print('is a IOS');
} else if (Platform.isAndroid) {
print('is a Andriod');
}
Thứ Sáu, 18 tháng 10, 2019
a snackbar in flutter
final snackBar = SnackBar(content: Text('Yay! A SnackBar!'));
// Find the Scaffold in the widget tree and use it to show a SnackBar.
Scaffold.of(context).showSnackBar(snackBar);
Đăng ký:
Bài đăng (Atom)
How to reload app in flutter
Phoenix . rebirth (context);
-
final formatter = new NumberFormat ( "#,###" ); new Text ( formatter . format ( 1234 )), // formatted number will be: 1,234 ...
-
try { final request = await client . get (...); final response = await request . close () . timeout ( const Duration ( se...
-
Wrap( children: [ MyWidget(), MyWidget(), MyWidget(), MyWidget(), MyWidget(), ], ),