Feature Request : Make a Custom SnackBar Widget
Is your feature request related to a problem? Please describe.
- The app currently uses a default
Snackbar, but the implementation involves bulky code and frequent use ofBuildContext, which is not considered best practice.
Describe the solution you'd like
- We would like to create a custom
Snackbarwidget that aligns with the app's color scheme and overall UI design. This will help streamline usage and improve code quality across the app.
Approach to be followed
- Create a utils directory.
- Inside it, create a file named
custom_snackbar.dart. - Implement a reusable custom snackbar widget with no external package dependencies
Additional context
- The custom snackbar should support three types of states:
- Success
- Info
- Error
- Each state should have its own visual style consistent with the app's theme.
- Update the app's code wherever the old ScaffoldMessenger approach is being used with our new custom snackbar widget.
Thank you for opening this issue! 🚀 Our team will review it soon. Please make sure you've included all relevant details and followed our Contributing Guidelines. For questions about our project, check out our README and Code of Conduct.
@debasmitaas would you like to work on this?
Sure!
Assigned. Go ahead.
@debasmitaas Kindly Star this project, It helps the project's reach. Thank you.
@debasmitaas Kindly Star this project, It helps the project's reach. Thank you.
Okay done , btw, Can you please elaborate as to when do you want the snack-bar messages to pop up? like when a text is added , edited or other functions? Also if you could describe what message you would want to display there?it would give me a better idea.
@debasmitaas first complete the custom snack bar. For the use cases, check the codebase and see if there is anywhere we have used the default ScaffoldMessenger, then replace it with custom snackbar. Just do this for now, as the app gets bigger we will have more uses for the snackbar, just make sure the UI/UX is similar to our app.
@debasmitaas Are you still working on it ? Do reply by today, else I'll assign it to someone else.
@debasmitaas Are you still working on it ? Do reply by today, else I'll assign it to someone else.
Yes , I'm working on it.
@may-tas hello , I have some queries regarding this issue, i am working on it and have removed the default scaffoldmessenger wherever i could find. will that be okay?? because when i go to open a pr it asks for screenshots but since the default snackbar hasn't been used anywhere(like for saving, editing etc) , i cannot show any changes. In that case , can i just open the pr or do i need it show messages too??
Yes its fine, You can just add a snackbar for testing, in the video. Basically for showing the UI, you can add a snackbar call at the start of the app, just for the screen recording. later you can remove that snacbar.
@debasmitaas
Okay, i will get back to you soon
@may-tas I created a test page to test the snackbars...i am attaching the screenshots below...please let me know if these are good?
@debasmitaas These are too excessive. The icons are duplicated, like info, success icons are used 2 times, which is weird. Also, the UI/UX of our app is white, greyish and black, basically very simple. Kindly make a simple snackbar.
@debasmitaas These are too excessive. The icons are duplicated, like info, success icons are used 2 times, which is weird. Also, the UI/UX of our app is white, greyish and black, basically very simple. Kindly make a simple snackbar.
Alright...are these okay?
@debasmitaas perfect. Raise a PR, and you can remove the test page.
@debasmitaas This is exactly what i had in mind, simple and neat.
@debasmitaas perfect. Raise a PR, and you can remove the test page.
Okay, now this custom snackbar is implemented in undo,redo , text adding and text updating in the main canvas screen! I'm opening a pr soon
Don't add snacbar for text element added or updated. undo, redone, background color changed and clear canvas (trash icon) keep it for only this as of now. @debasmitaas
@may-tas Okay Done, I opened a PR please check it out