1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Container( child: Selector<PersonInfoState, String>( selector: (context, personState) => personState.name, builder: (context, name, child) { return Column( children: [ Text(name), child, ], ); }, child: Container( color: Colors.yellow, height: 200.0, width: 100, child: Text('我不会刷新'), ), ), ),
Container( child: Selector<PersonInfoState, Tuple2<String,bool>>( selector: (context, personState) => Tuple2(personState.name, personState.autoNext), builder: (context, data, child) { return Column( children: [ Text(data.item1), Text('bool:${data.item2}'), child, ], ); }, child: Container( color: Colors.yellow, height: 200.0, width: 100, child: Text('我不会刷新'), ), ), ),
|