DateTime.parse(json['modified_gmt']+'Z' as String)
Thứ Năm, 11 tháng 6, 2020
Thứ Tư, 10 tháng 6, 2020
How to set timeout when connect api in flutter
try {
final request = await client.get(...);
final response = await request.close()
.timeout(const Duration(seconds: 2));
// rest of the code
...
} on TimeoutException catch (_) {
// A timeout occurred.
} on SocketException catch (_) {
// Other exception
}
Thứ Ba, 9 tháng 6, 2020
How to Get/set in flutter
class Foo { String bar; // normal field (getter/setter) final String baz; // read-only (getter) int _weight; set weight(int value) { assert(weight >= 0); _weight = value; } int get weight => _weight }
Thứ Hai, 8 tháng 6, 2020
Thứ Năm, 4 tháng 6, 2020
Fomat number in flutter
final formatter = new NumberFormat("#,###");
new Text(formatter.format(1234)), // formatted number will be: 1,234
Đăng ký:
Bài đăng (Atom)
How to reload app in flutter
Phoenix . rebirth (context);
-
Wrap( children: [ MyWidget(), MyWidget(), MyWidget(), MyWidget(), MyWidget(), ], ),
-
DateTime. parse (json[ 'modified_gmt' ]+ 'Z' as String)
-
dependencies : flutter : sdk : flutter carousel_pro : git : url : git : //github.com/jlouage/flutter-carousel-pro.g...