82 lines
2.3 KiB
Dart
82 lines
2.3 KiB
Dart
import 'package:animations/animations.dart';
|
|
import 'package:fforte/screens/sharedWidgets/datum.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|
|
|
class ExcursionMain extends StatefulWidget {
|
|
const ExcursionMain({super.key});
|
|
|
|
@override
|
|
State<ExcursionMain> createState() => _ExcursionMainState();
|
|
}
|
|
|
|
class _ExcursionMainState extends State<ExcursionMain> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
List<Step> getSteps() => [
|
|
Step(
|
|
title: Text(AppLocalizations.of(context)!.dateandtime),
|
|
content: Column(
|
|
children: [
|
|
Datum(initDatum: DateTime.now(),
|
|
onDateChanged: (date) {
|
|
|
|
}),
|
|
const SizedBox(height: 10,)
|
|
],
|
|
)),
|
|
const Step(title: Text("step2"), content: Text("data"))
|
|
];
|
|
|
|
|
|
|
|
|
|
int currentStep = 0;
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text(AppLocalizations.of(context)!.excursion),
|
|
),
|
|
body: PageTransitionSwitcher(
|
|
duration: const Duration(microseconds: 800),
|
|
transitionBuilder: (Widget child, Animation<double> animation,
|
|
Animation<double> secondaryAnimation) {
|
|
return SharedAxisTransition(
|
|
animation: animation,
|
|
secondaryAnimation: secondaryAnimation,
|
|
transitionType: SharedAxisTransitionType.vertical,
|
|
child: child,
|
|
);
|
|
},
|
|
child: Stepper(
|
|
key: ValueKey(currentStep),
|
|
steps: getSteps(),
|
|
currentStep: currentStep,
|
|
onStepTapped: (value) {
|
|
setState(() {
|
|
currentStep = value;
|
|
});
|
|
},
|
|
onStepContinue: () async {
|
|
final bool isLastStep = currentStep == getSteps().length - 1;
|
|
|
|
if (!isLastStep) {
|
|
setState(() {
|
|
currentStep += 1;
|
|
});
|
|
}
|
|
},
|
|
onStepCancel: () {
|
|
if (currentStep == 0) {
|
|
Navigator.pop(context);
|
|
} else {
|
|
setState(() {
|
|
currentStep -= 1;
|
|
});
|
|
}
|
|
},
|
|
),
|
|
));
|
|
}
|
|
}
|