-
-
Notifications
You must be signed in to change notification settings - Fork 381
feat: New preferences page design #6526
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
base: develop
Are you sure you want to change the base?
feat: New preferences page design #6526
Conversation
…smooth-app into preferences_v2
…ed styling and navigation functionality
…mprove navigation handling + upgraded sentry_flutter
…into openfoodfacts-develop
…er experience in preferences_v2
…referencesRoot class
… bar for logged in/out states
Hi @PrimaelQuemerais! |
packages/smooth_app/lib/pages/preferences_v2/app_bars/search_bottom_bar.dart
Outdated
Show resolved
Hide resolved
@PrimaelQuemerais linting issues 9s |
@g123k What's missing on this one to be mergeable ? |
packages/smooth_app/lib/generic_lib/widgets/app_bars/app_bar_background.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/app_bar_background.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/app_bar_background.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/logged_in/app_bar_statistics_card.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/logged_in/app_bar_statistics_card.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/logged_in/logged_in_app_bar_body.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/logged_in/logged_in_app_bar_body.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/logged_in/logged_in_app_bar_body.dart
Outdated
Show resolved
Hide resolved
packages/smooth_app/lib/generic_lib/widgets/app_bars/logged_out/logged_out_app_bar.dart
Outdated
Show resolved
Hide resolved
final Paint _paint; | ||
|
||
@override | ||
void paint(Canvas canvas, Size size) { |
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 do you need this painter?
This is just a rounded decoration
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 use it for the top of the widget which has a inward rounded shape
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 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.
Yes but the top of it, cropped on your screenshot
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.
But it's already implemented in the TopBar widget
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 missed that, I can check on my computer tomorrow.
Is this shape applied to any bottom of a TopBar?
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.
Hi @g123k
I checked the code for SmoothTopBar2
but I don't see how it could help me. I'm not sure we are talking about the same thing. I use the CustomPainter
to create this shape :
I'm rounding the bottom corners, but I also need the top to have inward corners.
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.
If SmoothTopBar2
doesn't provide what you need. Then implement the footer for this Widget.
This will be used for all new screens.
builder: (BuildContext context) { | ||
final AppLocalizations appLocalizations = AppLocalizations.of(context); | ||
|
||
return ChangeNotifierProvider<TextEditingController>.value( |
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.
Use an AnimatedBuilder
, instead of this ChangeNotifier
+ Consumer
(unless this is used on another file)
packages/smooth_app/lib/pages/preferences_v2/tiles/value_edition_preference_tile.dart
Show resolved
Hide resolved
class TogglePreferenceTile extends PreferenceTile { | ||
const TogglePreferenceTile({ | ||
super.icon, | ||
required super.title, |
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.
required
on top
|
||
class UrlPreferenceTile extends PreferenceTile { | ||
const UrlPreferenceTile({ | ||
required super.icon, |
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.
required
on top
class ValueEditionPreferenceTile extends PreferenceTile { | ||
const ValueEditionPreferenceTile({ | ||
super.icon, | ||
required super.title, |
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.
required
on top
title: appLocalizations.crash_reporting_toggle_title, | ||
subtitleText: appLocalizations.crash_reporting_toggle_subtitle, | ||
state: userPreferences.crashReports, | ||
onToggle: (bool value) { |
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.
=>
title: appLocalizations.send_anonymous_data_toggle_title, | ||
subtitleText: appLocalizations.send_anonymous_data_toggle_subtitle, | ||
state: userPreferences.userTracking, | ||
onToggle: (bool value) { |
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.
=>
), | ||
) ?? | ||
false, | ||
onToggle: (bool value) { |
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.
=>
title: title, | ||
titleTextStyle: Theme.of(context).textTheme.bodyLarge, | ||
child: Column( | ||
children: tiles |
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.
What are you doing here?
You transform the same object?!?
"dev_mode_enable_preferences_v2_title": "Enable Preferences V2", | ||
"@dev_mode_enable_preferences_v2_title": { | ||
"description": "Title for the preferences V2 preferences tile" | ||
}, | ||
"dev_mode_enable_preferences_v2_subtitle": "Try out the new design of the preferences screen", | ||
"@dev_mode_enable_preferences_v2_subtitle": { | ||
"description": "Subtitle for the preferences V2 preferences tile" | ||
}, |
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.
Not needed.
V2 is by default
What
This PR introduces a new implementation for the preferences page. Some work is still required to complete the transition, but all previously existing pages are accessible through the new design so this PR is already usable.
Screenshot
Screen.Recording.2025-04-26.at.4.44.34.PM.mov