|
|
|
@ -2,6 +2,9 @@ import 'dart:io' show Platform;
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:info_tren/train_info_page/train_info.dart'; |
|
|
|
|
import 'package:info_tren/train_info_page/train_info_cupertino.dart'; |
|
|
|
|
import 'package:info_tren/train_info_page/train_info_material.dart'; |
|
|
|
|
import 'package:info_tren/train_info_page/train_info_prompt.dart'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -20,7 +23,20 @@ class StartPoint extends StatelessWidget {
|
|
|
|
|
primaryColor: Colors.blue.shade600, |
|
|
|
|
accentColor: Colors.blue.shade700, |
|
|
|
|
), |
|
|
|
|
home: MainPageMaterial(), |
|
|
|
|
// home: MainPageMaterial(), |
|
|
|
|
routes: { |
|
|
|
|
Navigator.defaultRouteName: (context) { |
|
|
|
|
return MainPageMaterial(); |
|
|
|
|
}, |
|
|
|
|
TrainInfoPromptCommon.routeName: (context) { |
|
|
|
|
return TrainInfoPromptMaterial(); |
|
|
|
|
}, |
|
|
|
|
TrainInfo.routeName: (context) { |
|
|
|
|
return TrainInfoMaterial( |
|
|
|
|
trainNumber: ModalRoute.of(context).settings.arguments as int, |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
else if (Platform.isIOS) { |
|
|
|
@ -30,7 +46,20 @@ class StartPoint extends StatelessWidget {
|
|
|
|
|
primaryColor: Colors.blue.shade600, |
|
|
|
|
brightness: Brightness.dark, |
|
|
|
|
), |
|
|
|
|
home: MainPageCupertino(), |
|
|
|
|
// home: MainPageCupertino(), |
|
|
|
|
routes: { |
|
|
|
|
Navigator.defaultRouteName: (context) { |
|
|
|
|
return MainPageCupertino(); |
|
|
|
|
}, |
|
|
|
|
TrainInfoPromptCommon.routeName: (context) { |
|
|
|
|
return TrainInfoPromptCupertino(); |
|
|
|
|
}, |
|
|
|
|
TrainInfo.routeName: (context) { |
|
|
|
|
return TrainInfoCupertino( |
|
|
|
|
trainNumber: ModalRoute.of(context).settings.arguments as int, |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
@ -39,25 +68,7 @@ class StartPoint extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
mixin MainPageAction { |
|
|
|
|
onTrainInfoPageInvoke(BuildContext context) { |
|
|
|
|
if (Platform.isAndroid) { |
|
|
|
|
Navigator.of(context).push( |
|
|
|
|
MaterialPageRoute( |
|
|
|
|
builder: (context) { |
|
|
|
|
return TrainInfoPromptMaterial(); |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
else if (Platform.isIOS) { |
|
|
|
|
Navigator.of(context).push( |
|
|
|
|
CupertinoPageRoute( |
|
|
|
|
builder: (context) { |
|
|
|
|
return TrainInfoPromptCupertino(); |
|
|
|
|
}, |
|
|
|
|
title: "Informații despre tren" |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
Navigator.of(context).pushNamed(TrainInfoPromptCommon.routeName); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onStationBoardPageInvoke(BuildContext context) { |
|
|
|
|