blue_screen 1.0.0 blue_screen: ^1.0.0 copied to clipboard
Blue Screen of Death alternative to the default ErrorWidget used for Flutter apps.
blue_screen #
A Blue Screen widget replaces the default ErrorWidget used for Flutter apps.
The Blue Screen of Death (BSoD), Blue screen error, Blue Screen, fatal error, or bugcheck, and officially known as a Stop error, is a critical error screen displayed by the Microsoft Windows and ReactOS operating systems in the event of a fatal system error. The Blue Screen of Death indicates a system crash, in which the operating system has reached a critical condition where it can no longer operate safely. Possible issues include hardware failure, an issue with or without a device driver, or unexpected termination of a crucial process or thread.
Features #
- Supports run app in a safe mode with
runSafeMode
function. - Use
BlueScreenWidget
instead of the defaultErrorWidget
to show error messages. - Wrap widgets in a
SafeModeBuilder
to avoid throw an exception when run app in release mode.
Safe mode is a diagnostic mode of a computer operating system (OS). It can also refer to a mode of operation by application software. Safe mode is intended to help fix most, if not all, problems within an operating system. It is also widely used for removing rogue security software.
Getting started #
Add the package to the app #
- To add the
blue_screen
package as a dependency, run this command in your project terminal:
flutter pub add blue_screen
See more details at
Installing page.
Declare the font assets (optional) #
- Now that you've imported the package, tell Flutter where to find the fonts from the
blue_screen
. - To declare package fonts, prefix the path to the font with
packages/blue_screen
. This tells Flutter to look in the lib folder of the package for the font.
See all package fonts at here.
flutter:
fonts:
- family: <font_name>
fonts:
- asset: packages/blue_screen/fonts/<file_name>
- To use package fonts, declare which font you'd like to use like this in widgets.
...
fontFamily: '<font_name>',
...
Usage #
See complete example at
Example page.
import 'package:blue_screen/blue_screen.dart';
/// Flutter code sample for [BlueScreenWidget].
void main() {
// Put the app in a safe mode.
runSafeMode(() {
// Start the app.
runApp(const BlueScreenExampleApp());
});
}
Additional information #
Please request features and bugs for us at the issue page.