Search
 
SCRIPT & CODE EXAMPLE
 

DART

flutter custom error widget

 ErrorWidget.builder = (FlutterErrorDetails details) {
    return YourCustomWidget(
      details: details,
    );
  };
  runApp(const MyApp());
  
  
  
  //YourCustomWidget
  
  class YourCustomWidget extends StatelessWidget {
  const YourCustomWidget({
    Key? key,
    required this.details,
  }) : super(key: key);
  final FlutterErrorDetails details;
  @override
  Widget build(BuildContext context) {
    return Material(
      child: SafeArea(
        child: Container(
          color: Colors.green,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                details.exception.toString(),
                style: const TextStyle(
                  fontWeight: FontWeight.bold,
                  color: white,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter pageview show next page 
Dart :: OneSignalXCFramework (< 4.0, = 3.8.1, = 3.4.3) 
Dart :: flutter portrate only 
Dart :: Top level package requires Flutter but FLUTTER_ROOT environment variable not set. 
Dart :: dart if else 
Dart :: flutter bool variable 
Dart :: get current line number dart flutter 
Dart :: flutter: provider ChangeNotifierProvider() 
Dart :: Find string index inside a list flutter 
Dart :: dart define value null 
Dart :: how to color text in flutter 
Dart :: dart set final variable in constructor 
Dart :: var keys = snap.value.keys; 
Dart :: flutter showmodal initstate 
Dart :: JsonDecoder dart 
Dart :: Which one is performance wise better Text or extracted TextWidget function 
Dart :: flutter dollar sign interpolation 
Dart :: flutter dart imports 
Dart :: dart int to str 
Dart :: flutter padding symmetric 
Dart :: how to show date only in flutter 
Swift :: swift check if string contains string 
Swift :: ui alert swift yes no 
Swift :: remove checkmark when selecting the cell again swift 5 
Swift :: swift uipickerview 
Swift :: swift programming language wikipedia 
Swift :: blur background swiftUI 
Swift :: how to dismiss keyboard in swift 
Swift :: swift change background color 
Swift :: manifest merger failed in android studio 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =