Skip to content
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

Open
wants to merge 16 commits into
base: trunk
Choose a base branch
from
Open

feat: Added a new toast #476

wants to merge 16 commits into from

Conversation

yahu1031
Copy link
Member

What I did

Added a custom toast file

@yahu1031 yahu1031 requested a review from nitesh2599 August 23, 2022 06:38
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(
Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Member Author

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');
Copy link
Contributor

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.

Copy link
Member Author

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,
Copy link
Contributor

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,
Copy link
Contributor

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,
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants