Open TRohit20 opened 1 year ago
As far as I know, there isn't a direct HIGs equivalent for snackbar, so making a Cupertino widget wouldn't necessarily solve this problem. Instead, we would want to pass some theme attributes into the Material SnackBar widget by default (even without a Cupertino ancestor).
@TRohit20 - what are the properties that make it feel more natural with iOS? Text? Colors? Anything else?
Thanks!
@leighajarett Thank you for telling me about HIGs, I will look into them as I work on contributing to Flutter or other work and learn more.
Coming to your question, When it comes to properties that can make it feel more natural with iOS, The first property would shape actually. Right now, On implementation it renders a material look from the bottom of the screen. (Reference Screenshot attached👇🏻)
So providing property shape
would be a good addition so the developer can choose to have different configuration such as having a Rectangular Shape with circular edges.
Margin
property can be used to separate the snackBar from tabs a little.
text
property would be a bonus to include but not a definite requirement?
These are couple of properties I could think of for now. I would love to collaborate or work with you guys on solving this. Is there a possibility I can work with you guys on this issue and solve it?
Thank you!
It seems iOS now implements this natively, here's an example from "Music":
https://github.com/user-attachments/assets/92a487f5-1a43-486e-897b-08af23b00c18
Use case
I have been working on developing mobile applications for both iOS and Android. While I develop an app for both the platforms, a common widget I use is
SnackBar
which I reckon is the case for many developers.The issue is, SnackBar at the moment is a Material design widget. There is no Cupertino Style equivalent available for it. So, it makes it difficult or cumbersome to build a snackBar for iOS devices.
The issue can be resolved by using it using pub.dev/cupertino package and using it inside a CupertinoPageScaffold. This is a workaround as of now and it works fine.
But there are cases where the developer might not be using it under a CupertinoPageScaffold directly. But using it under a function in a widget which is rendered in CupertinoPageScaffold, but In such case, The SnackBar does not adapt to iOS but delivers Material design even under CupterinoPageScaffold.
Which might look fine but ruins the UI and design Style for iOS
Proposal
The package called 'cupertino' already exists that consists of iOS design style widgets to a certain extent, My proposal would be to add this widget to this package and release it because this is a widget that more often than not is used in every app built for mobile platforms. So Having an equivalent Cupertino implmentation would make it more cleaner, leaner code and easier.
I would like to work on this issue with the contributors team, see what are some other possibilities and contribute in anyway I can.
Thank you!