@ -29,7 +29,7 @@ class TrainInfoLoadingMaterial extends TrainInfoLoading {
}
class TrainInfoErrorMaterial extends TrainInfoError {
TrainInfoErrorMaterial ( {
const TrainInfoErrorMaterial ( {
required Object error ,
required String title ,
Future Function ( ) ? refresh ,
@ -54,7 +54,7 @@ class TrainInfoErrorMaterial extends TrainInfoError {
Padding (
padding: const EdgeInsets . all ( 8 ) ,
child: ElevatedButton (
child: Text ( ' Retry ' ) ,
child: const Text ( ' Retry ' ) ,
onPressed: ( ) = > refresh ! ( ) ,
) ,
) ,
@ -73,7 +73,7 @@ class TrainInfoMaterial extends StatelessWidget {
final Future Function ( ) ? refresh ;
final void Function ( ) ? onViewYesterdayTrain ;
TrainInfoMaterial ( {
const TrainInfoMaterial ( {
required this . trainData ,
this . refresh ,
this . onViewYesterdayTrain ,
@ -219,7 +219,7 @@ class TrainInfoMaterial extends StatelessWidget {
class DisplayTrainID extends StatelessWidget {
final TrainData trainData ;
DisplayTrainID ( { required this . trainData } ) ;
const DisplayTrainID ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -230,21 +230,21 @@ class DisplayTrainID extends StatelessWidget {
text: trainData . rank ,
style: TextStyle (
color: trainData . rank . startsWith ( ' IR ' )
? Color . fromARGB ( 255 , 255 , 0 , 0 )
? const Color . fromARGB ( 255 , 255 , 0 , 0 )
: null ,
) ,
) ,
TextSpan ( text: ' ' ) ,
const TextSpan ( text: ' ' ) ,
TextSpan (
text: trainData . number ,
) ,
] ,
) ,
style: ( isSmallScreen ( context )
? Theme . of ( context ) . textTheme . headline4
: Theme . of ( context ) . textTheme . headline3 )
? Theme . of ( context ) . textTheme . headlineMedium
: Theme . of ( context ) . textTheme . displaySmall )
? . copyWith (
color: Theme . of ( context ) . textTheme . bodyText2 ? . color ,
color: Theme . of ( context ) . textTheme . bodyMedium ? . color ,
fontWeight: FontWeight . bold ,
) ,
textAlign: TextAlign . center ,
@ -255,13 +255,13 @@ class DisplayTrainID extends StatelessWidget {
class DisplayTrainOperator extends StatelessWidget {
final TrainData trainData ;
DisplayTrainOperator ( { required this . trainData } ) ;
const DisplayTrainOperator ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
return Text (
trainData . operator ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontStyle: FontStyle . italic ,
fontSize: isSmallScreen ( context ) ? 12 : 14 ,
) ,
@ -273,7 +273,7 @@ class DisplayTrainOperator extends StatelessWidget {
class DisplayTrainRoute extends StatelessWidget {
final TrainData trainData ;
DisplayTrainRoute ( { required this . trainData } ) ;
const DisplayTrainRoute ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -285,21 +285,21 @@ class DisplayTrainRoute extends StatelessWidget {
padding: const EdgeInsets . all ( 4 ) ,
child: Text (
trainData . route . from ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: 16 ,
) ,
) ,
) ,
) ,
) ,
Center ( child: Text ( " - " ) ) ,
const Center ( child: Text ( " - " ) ) ,
Expanded (
child: Center (
child: Padding (
padding: const EdgeInsets . all ( 4 ) ,
child: Text (
trainData . route . to ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: 16 ,
) ,
textAlign: TextAlign . right ,
@ -315,7 +315,7 @@ class DisplayTrainRoute extends StatelessWidget {
class DisplayTrainDeparture extends StatelessWidget {
final TrainData trainData ;
DisplayTrainDeparture ( { required this . trainData } ) ;
const DisplayTrainDeparture ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -324,7 +324,7 @@ class DisplayTrainDeparture extends StatelessWidget {
child: Text (
/ / " Plecare în ${ dataPlecare . day . toString ( ) . padLeft ( 2 , ' 0 ' ) } . ${ dataPlecare . month . toString ( ) . padLeft ( 2 , ' 0 ' ) } . ${ dataPlecare . year . toString ( ) . padLeft ( 4 , ' 0 ' ) } " ,
" Plecare în ${ trainData . date } " ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontStyle: FontStyle . italic ,
fontWeight: FontWeight . w200 ,
fontSize: isSmallScreen ( context ) ? 14 : 16 ,
@ -338,7 +338,7 @@ class DisplayTrainDeparture extends StatelessWidget {
class DisplayTrainLastInfo extends StatelessWidget {
final TrainData trainData ;
DisplayTrainLastInfo ( { required this . trainData } ) ;
const DisplayTrainLastInfo ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -357,7 +357,7 @@ class DisplayTrainLastInfo extends StatelessWidget {
padding: const EdgeInsets . all ( 2 ) ,
child: Text (
" Ultima informație " ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 20 : 22 ,
fontWeight: FontWeight . bold ,
) ,
@ -370,7 +370,7 @@ class DisplayTrainLastInfo extends StatelessWidget {
padding: const EdgeInsets . all ( 4 ) ,
child: Text (
trainData . status ! . station ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 16 : 18 ,
) ,
textAlign: TextAlign . left ,
@ -418,7 +418,7 @@ class DisplayTrainLastInfo extends StatelessWidget {
return Text (
" $ data ${ data = = 1 ? ' minut ' : ' minute ' } întârziere " ,
style:
Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 14 : 16 ,
color: Colors . red . shade300 ,
) ,
@ -427,7 +427,7 @@ class DisplayTrainLastInfo extends StatelessWidget {
return Text (
" ${ - data } ${ data = = - 1 ? ' minut ' : ' minute ' } mai devreme " ,
style:
Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 14 : 16 ,
color: Colors . green . shade300 ,
) ,
@ -530,7 +530,7 @@ class DisplayTrainLastInfo extends StatelessWidget {
class DisplayTrainDestination extends StatelessWidget {
final TrainData trainData ;
DisplayTrainDestination ( { required this . trainData } ) ;
const DisplayTrainDestination ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -547,7 +547,7 @@ class DisplayTrainDestination extends StatelessWidget {
padding: const EdgeInsets . all ( 4 ) ,
child: Text (
" Destinația " ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 20 : 22 ,
fontWeight: FontWeight . bold ,
) ,
@ -558,7 +558,7 @@ class DisplayTrainDestination extends StatelessWidget {
padding: const EdgeInsets . fromLTRB ( 4 , 0 , 4 , 0 ) ,
child: Text (
destination . name ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 18 : 20 ,
fontWeight: FontWeight . w500 ,
) ,
@ -591,20 +591,20 @@ class DisplayTrainDestination extends StatelessWidget {
TextSpan (
text: ' la ' ,
children: [
TextSpan ( text: ' ' ) ,
const TextSpan ( text: ' ' ) ,
TextSpan (
text:
' ${ arrival . hour . toString ( ) . padLeft ( 2 , ' 0 ' ) } : ${ arrival . minute . toString ( ) . padLeft ( 2 , ' 0 ' ) } ' ,
style: delay = = 0
? null
: TextStyle (
: const TextStyle (
decoration: TextDecoration . lineThrough ,
) ,
) ,
if ( delay ! = 0 ) . . . [
TextSpan ( text: ' ' ) ,
const TextSpan ( text: ' ' ) ,
TextSpan (
text: ' $ arrivalWithDelayString ' ,
text: arrivalWithDelayString ,
style: TextStyle (
color: delay > 0
? Colors . red . shade300
@ -614,7 +614,7 @@ class DisplayTrainDestination extends StatelessWidget {
]
] ,
) ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 14 : 16 ,
) ,
textAlign: TextAlign . center ,
@ -634,7 +634,7 @@ class DisplayTrainDestination extends StatelessWidget {
class DisplayTrainRouteDistance extends StatelessWidget {
final TrainData trainData ;
DisplayTrainRouteDistance ( { required this . trainData } ) ;
const DisplayTrainRouteDistance ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -647,7 +647,7 @@ class DisplayTrainRouteDistance extends StatelessWidget {
children: < Widget > [
Text (
" Distanța rutei " ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 20 : 22 ,
fontWeight: FontWeight . bold ,
) ,
@ -655,7 +655,7 @@ class DisplayTrainRouteDistance extends StatelessWidget {
) ,
Text (
" ${ trainData . stations . last . km } km " ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 18 : 20 ,
) ,
textAlign: TextAlign . center ,
@ -671,7 +671,7 @@ class DisplayTrainRouteDistance extends StatelessWidget {
class DisplayTrainRouteDuration extends StatelessWidget {
final TrainData trainData ;
DisplayTrainRouteDuration ( { required this . trainData } ) ;
const DisplayTrainRouteDuration ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -684,7 +684,7 @@ class DisplayTrainRouteDuration extends StatelessWidget {
children: < Widget > [
Text (
" Durata rutei " ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 20 : 22 ,
fontWeight: FontWeight . bold ,
) ,
@ -701,10 +701,11 @@ class DisplayTrainRouteDuration extends StatelessWidget {
if ( duration . inDays > 0 ) {
firstWritten = true ;
if ( duration . inDays = = 1 )
if ( duration . inDays = = 1 ) {
durationString . write ( " 1 zi " ) ;
else
} else {
durationString . write ( " ${ duration . inDays } zile " ) ;
}
duration - = Duration ( days: duration . inDays ) ;
}
@ -713,10 +714,11 @@ class DisplayTrainRouteDuration extends StatelessWidget {
durationString . write ( " , " ) ;
}
firstWritten = true ;
if ( duration . inHours = = 1 )
if ( duration . inHours = = 1 ) {
durationString . write ( " 1 oră " ) ;
else
} else {
durationString . write ( " ${ duration . inHours } ore " ) ;
}
duration - = Duration ( hours: duration . inHours ) ;
}
@ -725,16 +727,17 @@ class DisplayTrainRouteDuration extends StatelessWidget {
durationString . write ( " , " ) ;
}
firstWritten = true ;
if ( duration . inMinutes = = 1 )
if ( duration . inMinutes = = 1 ) {
durationString . write ( " 1 minut " ) ;
else
} else {
durationString . write ( " ${ duration . inMinutes } minute " ) ;
}
duration - = Duration ( minutes: duration . inMinutes ) ;
}
return Text (
durationString . toString ( ) ,
style: Theme . of ( context ) . textTheme . bodyText2 ? . copyWith (
style: Theme . of ( context ) . textTheme . bodyMedium ? . copyWith (
fontSize: isSmallScreen ( context ) ? 18 : 20 ,
) ,
textAlign: TextAlign . center ,
@ -751,7 +754,7 @@ class DisplayTrainRouteDuration extends StatelessWidget {
class DisplayTrainYesterdayWarningMaterial
extends DisplayTrainYesterdayWarningCommon {
DisplayTrainYesterdayWarningMaterial ( void Function ( ) onViewYesterdayTrain )
const DisplayTrainYesterdayWarningMaterial ( void Function ( ) onViewYesterdayTrain )
: super ( onViewYesterdayTrain ) ;
@ override
@ -764,13 +767,13 @@ class DisplayTrainYesterdayWarningMaterial
child: Text . rich (
TextSpan (
children: [
TextSpan (
const TextSpan (
text: DisplayTrainYesterdayWarningCommon . trainDidNotDepart ,
) ,
TextSpan ( text: ' \n ' ) ,
const TextSpan ( text: ' \n ' ) ,
TextSpan (
text: DisplayTrainYesterdayWarningCommon . seeYesterdayTrain ,
style: TextStyle (
style: const TextStyle (
color: Colors . blue ,
) ,
recognizer: TapGestureRecognizer ( )
@ -788,7 +791,7 @@ class DisplayTrainYesterdayWarningMaterial
class DisplayTrainStations extends StatelessWidget {
final TrainData trainData ;
DisplayTrainStations ( { required this . trainData } ) ;
const DisplayTrainStations ( { required this . trainData } ) ;
@ override
Widget build ( BuildContext context ) {
@ -796,6 +799,7 @@ class DisplayTrainStations extends StatelessWidget {
delegate: SliverChildBuilderDelegate (
( context , index ) {
return IndexedSemantics (
index: index ,
child: DisplayTrainStation (
station: trainData . stations [ index ] ,
onTap: ( ) {
@ -805,7 +809,6 @@ class DisplayTrainStations extends StatelessWidget {
) ;
} ,
) ,
index: index ,
) ;
} ,
childCount: trainData . stations . length ,