diff --git a/lib/pages/station_arrdep_page/view_station/view_station.dart b/lib/pages/station_arrdep_page/view_station/view_station.dart index 0784636..af70ab1 100644 --- a/lib/pages/station_arrdep_page/view_station/view_station.dart +++ b/lib/pages/station_arrdep_page/view_station/view_station.dart @@ -51,6 +51,8 @@ abstract class ViewStationPageShared extends StatelessWidget { static const departsTo = 'Pleacă către'; static const departedTo = 'A plecat către'; static const cancelledDeparture = 'Anulat - către'; + static const errorText = 'A apărut o eroare'; + static const retryText = 'Reîncearcă'; final ViewStationPageTab tab; final void Function(ViewStationPageTab) setTab; diff --git a/lib/pages/station_arrdep_page/view_station/view_station_material.dart b/lib/pages/station_arrdep_page/view_station/view_station_material.dart index a8ed230..3a6fad4 100644 --- a/lib/pages/station_arrdep_page/view_station/view_station_material.dart +++ b/lib/pages/station_arrdep_page/view_station/view_station_material.dart @@ -27,7 +27,41 @@ class ViewStationPageMaterial extends ViewStationPageShared { body: snapshot.state == RefreshFutureBuilderState.waiting ? const Loading(text: ViewStationPageShared.loadingText,) : snapshot.state == RefreshFutureBuilderState.error - ? Container() + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon( + Icons.error_outline, + size: 32, + color: Colors.red, + ), + const Text( + ViewStationPageShared.errorText, + style: TextStyle( + inherit: true, + fontSize: 32, + ), + ), + Text( + snapshot.error.toString(), + style: Theme.of(context).textTheme.bodySmall, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: ElevatedButton( + onPressed: () { + refresh(); + }, + child: const Text(ViewStationPageShared.retryText), + ), + ), + ], + ), + ), + ) : CustomScrollView( slivers: [ SliverToBoxAdapter(child: SafeArea(left: false, bottom: false, right: false,child: Container(),),),