|
|
|
@ -12,7 +12,9 @@ import 'package:info_tren/pages/train_info_page/view_train/train_info_cupertino_
|
|
|
|
|
import 'package:info_tren/utils/state_to_string.dart'; |
|
|
|
|
|
|
|
|
|
class TrainInfoLoadingCupertino extends TrainInfoLoading { |
|
|
|
|
TrainInfoLoadingCupertino({required String title, String? loadingText}) |
|
|
|
|
final String? previousPageTitle; |
|
|
|
|
|
|
|
|
|
TrainInfoLoadingCupertino({required String title, String? loadingText, this.previousPageTitle,}) |
|
|
|
|
: super( |
|
|
|
|
title: title, |
|
|
|
|
loadingText: loadingText, |
|
|
|
@ -23,6 +25,7 @@ class TrainInfoLoadingCupertino extends TrainInfoLoading {
|
|
|
|
|
return CupertinoPageScaffold( |
|
|
|
|
navigationBar: CupertinoNavigationBar( |
|
|
|
|
middle: Text(title), |
|
|
|
|
previousPageTitle: previousPageTitle ?? 'Înapoi', |
|
|
|
|
), |
|
|
|
|
child: Center( |
|
|
|
|
child: loadingWidget, |
|
|
|
@ -32,10 +35,13 @@ class TrainInfoLoadingCupertino extends TrainInfoLoading {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class TrainInfoErrorCupertino extends TrainInfoError { |
|
|
|
|
final String? previousPageTitle; |
|
|
|
|
|
|
|
|
|
TrainInfoErrorCupertino({ |
|
|
|
|
required Object error, |
|
|
|
|
required String title, |
|
|
|
|
Future Function()? refresh, |
|
|
|
|
this.previousPageTitle, |
|
|
|
|
}) : super( |
|
|
|
|
error: error, |
|
|
|
|
title: title, |
|
|
|
@ -47,6 +53,7 @@ class TrainInfoErrorCupertino extends TrainInfoError {
|
|
|
|
|
return CupertinoPageScaffold( |
|
|
|
|
navigationBar: CupertinoNavigationBar( |
|
|
|
|
middle: Text(title), |
|
|
|
|
previousPageTitle: previousPageTitle ?? 'Înapoi', |
|
|
|
|
), |
|
|
|
|
child: Center( |
|
|
|
|
child: Column( |
|
|
|
@ -73,12 +80,14 @@ class TrainInfoCupertino extends StatelessWidget {
|
|
|
|
|
final Future Function()? refresh; |
|
|
|
|
final bool? isRefreshing; |
|
|
|
|
final void Function()? onViewYesterdayTrain; |
|
|
|
|
final String previousPageTitle; |
|
|
|
|
|
|
|
|
|
TrainInfoCupertino({ |
|
|
|
|
required this.trainData, |
|
|
|
|
this.refresh, |
|
|
|
|
this.isRefreshing, |
|
|
|
|
this.onViewYesterdayTrain, |
|
|
|
|
required this.previousPageTitle, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -86,6 +95,7 @@ class TrainInfoCupertino extends StatelessWidget {
|
|
|
|
|
return CupertinoPageScaffold( |
|
|
|
|
navigationBar: CupertinoNavigationBar( |
|
|
|
|
middle: Text("Informații despre ${trainData.rank} ${trainData.number}"), |
|
|
|
|
previousPageTitle: previousPageTitle, |
|
|
|
|
trailing: refresh == null ? null : isRefreshing == true ? CupertinoActivityIndicator() : CupertinoButton( |
|
|
|
|
padding: const EdgeInsets.all(0), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|