void showSnackBar( String text, ) { ScaffoldMessenger.of(globalNavigatorKey.currentContext!) ..hideCurrentSnackBar() ..showSnackBar( SnackBar( backgroundColor: Theme.of(globalNavigatorKey.currentContext!).colorScheme.primary, padding: const EdgeInsets.all(0), content: Container( height: 60, decoration: const BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular( 20, ), topRight: Radius.circular( 20, ), ), ), child: Center( child: Text( text, overflow: TextOverflow.visible, style: Theme.of(globalNavigatorKey.currentContext!) .textTheme .titleMedium! .copyWith( color: Theme.of(globalNavigatorKey.currentContext!) .colorScheme .onPrimary, ), ), ), ), ), ); }