-
-
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: Horizontal buttons for Dialogs #2626
Conversation
Implementing golden tests takes longer than expected, especially because I have to mock both SQLite and Hive. |
I've never heard that |
Okay, I thought the integration of SQLite was to migrate everything. |
The main problem was with
Good.
I've double-checked on Stackoverflow: there's a typo here, the correct name is Gloubi-boulga. Can only be found in France. Still waiting for its Nova score, help needed! (could be an easter egg) |
Actually everything was ready for this part of the PR. |
Codecov Report
@@ Coverage Diff @@
## develop #2626 +/- ##
==========================================
- Coverage 8.86% 7.27% -1.59%
==========================================
Files 161 220 +59
Lines 6623 10680 +4057
==========================================
+ Hits 587 777 +190
- Misses 6036 9903 +3867
Help us with your feedback. Take ten seconds to tell us how you rate us. |
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.
@@ -280,8 +284,10 @@ class UserPreferencesContribute extends AbstractUserPreferences { | |||
onPressed: () => LaunchUrlHelper.launchURL( | |||
'https://github.com/openfoodfacts/smooth-app', false), | |||
text: AppLocalizations.of(context).contribute, | |||
minWidth: 200, | |||
minWidth: 150, |
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.
A bit from nowhere. Something related to screenSize would be more responsive.
contributorsData as Map<String, dynamic>); | ||
return Padding( | ||
padding: const EdgeInsets.all(5.0), | ||
return Wrap( |
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.
No scrolling needed here?
bool isTabletDevice() { | ||
return size.width <= _MAX_TABLET_WIDTH; | ||
} | ||
|
||
bool isLargeDevice() { |
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.
Names are a bit confusing: I would assume a tablet to be larger than a large (allegedly smartphone) device.
What about the Android style, something like x
, xx
, xxx
?
} | ||
} | ||
|
||
extension MediaQueryResponsiveExtensions on MediaQueryData { |
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'll never get used to that syntax :)
Besides, in that case I guess SmoothResponsive
would be good enough; the added value of the extension doesn't look interesting.
|
||
/// Custom Widget to provide a responsive behavior. | ||
/// [defaultDeviceBuilder] is mandatory and will be used if no value is provided | ||
class SmoothResponsiveBuilder extends StatelessWidget { |
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.
Maybe I'm wrong but I haven't seen a single piece of code using it. If you don't use it now, please get rid of it: it adds complexity. Same remark for BuildContextResponsiveExtensions
.
@@ -0,0 +1,91 @@ | |||
import 'package:flutter/widgets.dart'; | |||
|
|||
class SmoothResponsive { |
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.
Some ///
comments wouldn't hurt.
@@ -219,6 +366,7 @@ class _SmoothActionElevatedButton extends StatelessWidget { | |||
final ThemeData themeData = Theme.of(context); | |||
return SmoothSimpleButton( | |||
onPressed: buttonData.onPressed, | |||
minWidth: buttonData.minWidth ?? 20.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.
There should probably be MINIMUM_TOUCH_SIZE
at least.
|
||
return AlertDialog( | ||
scrollable: true, | ||
scrollable: false, |
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.
Unless you're not lucky.
static const EdgeInsets _contentPadding = EdgeInsets.only( | ||
left: 24.0, | ||
left: 22.0, | ||
top: VERY_LARGE_SPACE, | ||
right: 24.0, | ||
bottom: 24.0, | ||
right: 22.0, | ||
bottom: 22.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.
What about EdgeInsets.all(VERY_LARGE_SPACE)
?
Let me first change @monsieurtanuki's suggestions. |
ok, really keen on merging this one, tbh, the miniature text is an eyesore |
ok @g123k @monsieurtanuki let's merge this one and create an issue for the small improvement ? |
I'm merging, we'll do the explaning in the next PR that will actually change the dialogs. We'll have to create an issue listing all those places |
The next step is to list all dialogs where we want this feature. |
Fix issues introduced with #2587, but also:
Will fix #2622