We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm calling the sample showTopFlash() inside my app and get following error:
showTopFlash()
overlay can't be the root overlay when persistent is false 'package:flash/flash.dart': Failed assertion: line 99 pos 14: 'overlay != rootOverlay'
This is my simple code to reproduce:
class _TestScreenState extends State<TestScreen> { int which = 0; @override Widget build(BuildContext context) { GlobalKey<ScaffoldState> _key = GlobalKey<ScaffoldState>(); FlashHelper.init(context); return Scaffold( key: _key, body: Center(child: FlatButton(onPressed: (){ _showTopFlash(); }, child: Text('show Flash')),), ); } void _showTopFlash({FlashStyle style = FlashStyle.floating}) { showFlash( context: context, duration: const Duration(seconds: 5), persistent: false, builder: (_, controller) { return Flash( controller: controller, backgroundColor: Colors.white, brightness: Brightness.light, boxShadows: [BoxShadow(blurRadius: 4)], barrierBlur: 3.0, barrierColor: Colors.black38, barrierDismissible: true, style: style, position: FlashPosition.bottom, child: FlashBar( title: Text('Title'), message: Text('Hello world!'), showProgressIndicator: true, primaryAction: FlatButton( onPressed: () => controller.dismiss(), child: Text('DISMISS', style: TextStyle(color: Colors.amber)), ), ), ); }, ); } }
When I set the persistent:true it works without Blur effect. Thanks for your nice lib.
persistent:true
The text was updated successfully, but these errors were encountered:
Hi, @alizera You need warp you TestScreen with Overlay. Please refer to the example
TestScreen
Overlay
Sorry, something went wrong.
Do I really need to wrap every single screen that uses Flash with an Overlay or there's a better alternative?
Flash
@fernando-s97 When the persistent is false, you need warp the screen of the context with an Overlay
persistent
context
No branches or pull requests
I'm calling the sample
showTopFlash()
inside my app and get following error:This is my simple code to reproduce:
When I set the
persistent:true
it works without Blur effect.Thanks for your nice lib.
The text was updated successfully, but these errors were encountered: