errorWidget function

Widget errorWidget(
  1. BuildContext context, {
  2. dynamic callback()?,
  3. Object? error,
})

Implementation

Widget errorWidget(BuildContext context, {Function()? callback, Object? error}) {
  var lang = appLocalizationsWrapper.lang;
  return Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: [
      Center(child: AlertVerticalWidget.createDanger(lang.couldNotLoadData)),
      if (callback != null)
        TextButton(
          child: Text(lang.retry.toUpperCase()),
          onPressed: () => callback.call(),
        )
    ],
  );
}