uacinfo / QuestionsApp

The mobile app for questions app
https://uacinfo.com
0 stars 0 forks source link

Global error page with option to retry #6

Open f71uday opened 1 month ago

f71uday commented 1 month ago

`import 'package:flutter/material.dart';

class GlobalErrorPage extends StatelessWidget { final VoidCallback onRetry;

GlobalErrorPage({required this.onRetry});

@override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.blue[900], // Blue color reminiscent of the BSoD body: Center( child: Padding( padding: const EdgeInsets.all(24.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( ':(\n\nA fatal error has occurred.\n\nPlease try again later.', style: TextStyle( color: Colors.white, fontSize: 24, fontWeight: FontWeight.bold, height: 1.5, ), textAlign: TextAlign.center, ), SizedBox(height: 20), ElevatedButton( onPressed: onRetry, style: ElevatedButton.styleFrom( primary: Colors.white, // Button background color onPrimary: Colors.blue[900], // Button text color padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), ), ), child: Text( 'Retry', style: TextStyle(fontSize: 18), ), ), ], ), ), ), ); } }`