Skip to content

Commit 6a89171

Browse files
committed
enhancement to options to show the required access
1 parent 4551aaa commit 6a89171

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

lib/constants/appconstants.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class AppConstants {
5050
static const String FEEDBACK_URL =
5151
'https://github.com/debuggdapps/nitnem/issues/new';
5252
static const String OPTIONS_SHAREDPREF_KEY = 'OPTIONS';
53+
static const double OPTIONS_SUBTITLE_FONT_SIZE = 10.0;
5354
static const int DEVICE_SMALL_RES = 320;
5455
static const bool LOGGING_ENABLED = !kReleaseMode;
5556
}

lib/pages/options.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ class _OptionsItem extends StatelessWidget {
4343
}
4444

4545
class _BooleanItem extends StatelessWidget {
46-
const _BooleanItem(this.title, this.value, this.onChanged, {this.switchKey});
46+
const _BooleanItem(this.title, this.subtitle, this.value, this.onChanged,
47+
{this.switchKey});
4748

4849
final String title;
50+
final String subtitle;
4951
final bool value;
5052
final ValueChanged<bool> onChanged;
5153
// [switchKey] is used for accessing the switch from driver tests.
@@ -58,6 +60,13 @@ class _BooleanItem extends StatelessWidget {
5860
child: Row(
5961
children: <Widget>[
6062
Expanded(child: Text(title)),
63+
Expanded(
64+
child: Text(
65+
subtitle,
66+
style: TextStyle(
67+
fontSize: AppConstants.OPTIONS_SUBTITLE_FONT_SIZE,
68+
),
69+
)),
6170
Switch(
6271
key: switchKey,
6372
value: value,
@@ -136,6 +145,7 @@ class _BoldItem extends StatelessWidget {
136145
Widget build(BuildContext context) {
137146
return _BooleanItem(
138147
'Bold Text',
148+
'',
139149
StoreProvider.of<AppState>(context).state.options.bold == true,
140150
(bool value) {
141151
StoreProvider.of<AppState>(context).dispatch(ToggleBoldAction(value));
@@ -152,6 +162,7 @@ class _KeepScreenAwakeItem extends StatelessWidget {
152162
Widget build(BuildContext context) {
153163
return _BooleanItem(
154164
'Keep Screen Awake',
165+
'Requires Wake Lock Permission',
155166
StoreProvider.of<AppState>(context).state.options.screenAwake == true,
156167
(bool value) {
157168
StoreProvider.of<AppState>(context)
@@ -169,6 +180,7 @@ class _SaveScrollPosItem extends StatelessWidget {
169180
Widget build(BuildContext context) {
170181
return _BooleanItem(
171182
'Save Scroll Position',
183+
'',
172184
StoreProvider.of<AppState>(context).state.options.saveScrollPosition ==
173185
true,
174186
(bool value) {
@@ -187,6 +199,7 @@ class _ShowStatusItem extends StatelessWidget {
187199
Widget build(BuildContext context) {
188200
return _BooleanItem(
189201
'Show Status Bar',
202+
'',
190203
StoreProvider.of<AppState>(context).state.options.showStatus == true,
191204
(bool value) {
192205
StoreProvider.of<AppState>(context).dispatch(ToggleStatusAction(value));
@@ -330,6 +343,7 @@ class _DoNotDisturbItem extends StatelessWidget {
330343
Widget build(BuildContext context) {
331344
return _BooleanItem(
332345
'Do Not Disturb',
346+
'Requires Notification Permission',
333347
StoreProvider.of<AppState>(context).state.options.doNotDisturb == true,
334348
(bool value) {
335349
StoreProvider.of<AppState>(context).dispatch(ToggleDNDAction(value,

0 commit comments

Comments
 (0)