使用.obs 扩展更使用嘎嘎简洁,对于需要监测的对象来说,加上.obs
扩展即可。
万物皆可obs
final name = ''.obs;
final isUsed = false.obs;
final num = 0.obs;
final items = <String>[].obs;
final map = <String,int>{}.obs;
//自定义类
final user = User().obs;
final items = <Item>[].obs;
使用.obs 扩展更使用嘎嘎简洁,对于需要监测的对象来说,加上.obs
扩展即可。
万物皆可obs
final name = ''.obs;
final isUsed = false.obs;
final num = 0.obs;
final items = <String>[].obs;
final map = <String,int>{}.obs;
//自定义类
final user = User().obs;
final items = <Item>[].obs;