-
-
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
fix: Finish button replaced with FAB #3219
fix: Finish button replaced with FAB #3219
Conversation
chore: Update assets
Positioned( | ||
child: Align( | ||
alignment: Alignment.bottomCenter, | ||
child: SmoothActionButtonsBar.single( | ||
action: SmoothActionButton( | ||
text: appLocalizations.finish, | ||
onPressed: () async { | ||
final LocalDatabase localDatabase = | ||
context.read<LocalDatabase>(); | ||
final DaoProduct daoProduct = | ||
DaoProduct(localDatabase); | ||
final Product? localProduct = | ||
await daoProduct.get(widget.barcode); | ||
if (localProduct == null) { | ||
product = Product( | ||
barcode: widget.barcode, | ||
); | ||
daoProduct.put(product); | ||
localDatabase.notifyListeners(); | ||
} | ||
provider.set(product); | ||
if (mounted) { | ||
await Navigator.maybePop(context, | ||
_isProductLoaded ? widget.barcode : null); | ||
} | ||
}, | ||
), | ||
alignment: Alignment.bottomRight, | ||
child: FloatingActionButton.extended( |
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.
Forget about Positioned
and Align
: just use the floatingActionButton
parameter of SmoothScaffold
.
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.
This looks like similar to your initial screenshot, isn't-it?
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, it is similar but SmoothScaffold is hiding other contents on the screen. So that thing is making a difference
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.
@monsieurtanuki @g123k should I commit this code?
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.
@prathamsoni11 It looks like you removed the body
from the SmoothScaffold
: that would explain the empty screen.
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.
@monsieurtanuki @g123k Done it is now ready to be merged.
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 @prathamsoni11!
Please
- remove the
Stack
as well: we don't need it anymore - attach a screenshot
@monsieurtanuki @g123k Removed Stack |
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.
LGTM @prathamsoni11!
Way better, but does it still overlaps the button on small screens? |
@g123k I don't see why it should not: a FAB is on top of anything. |
+1 it would even be better if we could add this padding only if needed (by computing the size) |
Would it?
|
If we do so, the overscroll will be ugly on large screens |
I cannot picture that. Could you share a screenshot? |
The overscroll is this "glow" effect: https://i.stack.imgur.com/6mMn4.png By adding a padding it will add a blank space on the bottom, which won't be nice. |
That's what I would call a cosmetic issue, with low priority. And IMHO fixing this cosmetic issue will bring additional confusion to the code. |
Thank you @prathamsoni11! |
Your Welcome sir @monsieurtanuki 😀 |
What
Screenshot
Fixes bug(s)
Part of