-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: #833 - dev mode #834
feat: #833 - dev mode #834
Conversation
New file: * `user_preferences_dev_mode.dart`: Collapsed/expanded display of "dev mode" for the preferences page. Impacted files: * `forgot_password_page.dart`: added a system to trigger the dev mode (click 10 times on the action button) * `user_preferences.dart`: added a getter/setter for dev mode * `user_preferences_page.dart`: display the dev mode options - if activated
info • The import of 'package:flutter/cupertino.dart' is unnecessary because all of the used elements are also provided by the import of 'package:flutter/material.dart' • packages/smooth_app/lib/pages/user_management/forgot_password_page.dart:1:8 • unnecessary_import |
@@ -1,7 +1,9 @@ | |||
import 'package:flutter/cupertino.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import 'package:flutter/cupertino.dart'; |
Impacted files: * `attributes_card_helper.dart` * `forgot_password_page.dart` * `product_cards_helper.dart` * `score_card_helper.dart` * `smooth_reveal_animation.dart` * `svg_icon_chip.dart`
No more useless cupertino imports now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @monsieurtanuki. that is definitely something we can build on later.
set devMode(final int value) => | ||
_sharedPreferences.setInt(_TAG_DEV_MODE, value); | ||
|
||
int get devMode => _sharedPreferences.getInt(_TAG_DEV_MODE) ?? 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency please either all get/set or all methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Too bad the dart setter syntax does not work with async
.
set devMode(final int value) => | ||
_sharedPreferences.setInt(_TAG_DEV_MODE, value); | ||
|
||
int get devMode => _sharedPreferences.getInt(_TAG_DEV_MODE) ?? 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a bool instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course a bool
would do the job in a first approach, but in my experience I noticed that sometimes we're stuck with a bool
when we want to upgrade the app to something more elaborate. An int
is safer.
Impacted files: * `forgot_password_page.dart` * `user_preferences.dart` * `user_preferences_dev_mode.dart`
New file:
user_preferences_dev_mode.dart
: Collapsed/expanded display of "dev mode" for the preferences page.Impacted files:
forgot_password_page.dart
: added a system to trigger the dev mode (click 10 times on the action button)user_preferences.dart
: added a getter/setter for dev modeuser_preferences_page.dart
: display the dev mode options - if activated