-
Notifications
You must be signed in to change notification settings - Fork 32
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: Added a new toast #476
base: trunk
Are you sure you want to change the base?
Conversation
Merge pull request #474 from atsign-foundation/toast_in_commons
bool isSuccess = false}) { | ||
assert(!(isError && isSuccess), 'Both isError and isSuccess cannot be true'); | ||
assert(gravity >= 0, 'gravity cannot be less than 0'); | ||
ScaffoldMessenger.of(context).showSnackBar( |
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.
@yahu1031 we also have to assert that the given context has a ScaffoldMessenger ancestor.
text, | ||
context, | ||
duration: FlutterToastr.lengthLong, | ||
/// pass [isError] true to have a red bg, [isSuccess] true to have a green bg. |
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.
@yahu1031 I think we need not add this class in all the packages, it can be reused from at_commons_flutter.
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 we haven't released the package yet
double gravity = 10.0, | ||
bool isError = false, | ||
bool isSuccess = false}) { | ||
assert(!(isError && isSuccess), 'Both isError and isSuccess cannot be true'); |
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.
@yahu1031 I think we can have a dismissDirection
property as well.
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.
will add it.
textColor: textColor ?? Colors.white, | ||
fontSize: 16.0); | ||
} | ||
void show(String message, BuildContext context, |
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.
can be reused from at_commons_flutter.
textColor: textColor ?? Colors.white, | ||
fontSize: 16.0); | ||
} | ||
void show(String message, BuildContext context, |
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.
can be reused from at_commons_flutter.
fontSize: 16.0); | ||
} | ||
/// pass [isError] true to have a red bg, [isSuccess] true to have a green bg. | ||
void show(String message, BuildContext context, |
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.
can be reused from at_commons_flutter.
What I did
Added a custom toast file