Flutter Android PreferenceScreen settings page. In Flutter the easiest way to make a PreferenceScreen page is with a ListView and ListTiles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ListView(children: <Widget>[ ListTile( title: Text('Enable Feature'), trailing: Checkbox( value: PrefService.getBool('feature_enabled'), onChanged: (val) { setState(() { PrefService.setBool('feature_enabled', val); }); }, ), onTap: () { setState(() { PrefService.setBool( 'feature_enabled', !PrefService.getBool('feature_enabled')); }); }, ) ]), |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.