make error snack bar fn global
This commit is contained in:
parent
045d0694e7
commit
a45378a094
3 changed files with 22 additions and 17 deletions
|
@ -28,3 +28,17 @@ class MainApp extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
SnackBar buildErrorSnackBar(BuildContext context, String error) {
|
||||
return SnackBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
content: Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Icon(Icons.error, color: Colors.red,),
|
||||
Text(error, style: TextStyle(color: Theme.of(context).colorScheme.onSecondaryContainer),),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue