update
This commit is contained in:
parent
2931621069
commit
27f00e43a7
15 changed files with 252 additions and 104 deletions
|
|
@ -29,16 +29,20 @@ class _AddCategoryPageState extends State<AddCategoryPage> {
|
|||
|
||||
try {
|
||||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
await _refCategories.postCategory(_categoryController.text.toUpperCase());
|
||||
final post = await _refCategories.postCategory(_categoryController.text.toUpperCase());
|
||||
|
||||
if (mounted) {
|
||||
showNotification(context, 'Category Saved', true);
|
||||
if (post && mounted) {
|
||||
showNotification(context, 'Category saved', true);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
context.push('/main');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Category not saved', false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue