-
Notifications
You must be signed in to change notification settings - Fork 1
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
feature/custom-storage-locations-293 #294
base: main
Are you sure you want to change the base?
Conversation
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.
I left a few comments, where things could be improved, but those are minor. Otherwise, I did not have the time to fully test this, but the code looks good.
return SizedBox( | ||
width: 150, | ||
child: StepProgressIndicator( | ||
totalSteps: totalProdSteps, |
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.
In the future, a more adaptive Widget would be useful to prevent an overflow when selecting a large phasecount in the settings
.textStyle2 | ||
.withOnBackgroundHard | ||
.withBold | ||
.withOverflow(TextOverflow.ellipsis), |
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.
ellipsis is default, this line can be removed
activity.pathToImage ?? | ||
// For now, the crazy cat is the default when no path is present | ||
'assets/leisure/leisure-fun-smiling-cats.svg', | ||
color: Colors.cyan), |
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.
This should be the tertiary color
// Leisure description | ||
Text( | ||
activity.descriptionLong ?? activity.descriptionShort, | ||
overflow: TextOverflow.visible, |
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.
There is a TextStyle called settingsInfoTextStyle to display longer descriptive texts. You can use it here (and rename it)
import 'package:shared_preferences/shared_preferences.dart'; | ||
|
||
class SharedPreferencesData { | ||
static late SharedPreferences _prefs; | ||
static late String _defaultStorageLocation; |
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.
default values are stored in a different file (settings_constants.dart). This class always returns nullables and the default value has to be used in the calling location, if null is returned.
Closes #293
This also does some other minor improvements and bugfixes: