BasicBrowserErrorWidget.fromError constructor
BasicBrowserErrorWidget.fromError({
- required BuildContext context,
- required WebResourceError error,
- required Widget? refreshButton,
Implementation
factory BasicBrowserErrorWidget.fromError({
required BuildContext context,
required WebResourceError error,
required Widget? refreshButton,
}) {
final localizations = Localizations.of<BrowserLocalizations>(
context,
BrowserLocalizations,
) ??
const BrowserLocalizations();
return BasicBrowserErrorWidget(
title: Text(
localizations.couldNotReach,
textAlign: TextAlign.center,
),
body: Column(
children: [
if (kDebugMode)
Padding(
padding: const EdgeInsets.only(bottom: 20),
child: Text(
'For debugging:\n${error.description}',
textAlign: TextAlign.center,
)),
if (refreshButton != null) refreshButton,
],
),
);
}