51 lines
1.2 KiB
Dart
51 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class NewTripPage extends StatefulWidget {
|
|
const NewTripPage({super.key});
|
|
|
|
@override
|
|
_NewTripPageState createState() => _NewTripPageState();
|
|
}
|
|
|
|
|
|
class _NewTripPageState extends State<NewTripPage> {
|
|
int _currentStep = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Create New Trip'),
|
|
),
|
|
body: Stepper(
|
|
currentStep: _currentStep,
|
|
onStepContinue: () {
|
|
if (_currentStep < 1) {
|
|
setState(() {
|
|
_currentStep += 1;
|
|
});
|
|
}
|
|
},
|
|
onStepCancel: () {
|
|
if (_currentStep > 0) {
|
|
setState(() {
|
|
_currentStep -= 1;
|
|
});
|
|
}
|
|
},
|
|
steps: [
|
|
Step(
|
|
title: const Text('Select Location'),
|
|
content: const MapWithSearchField(), // Replace with your map module
|
|
isActive: _currentStep >= 0,
|
|
),
|
|
Step(
|
|
title: const Text('Choose Options'),
|
|
content: const OptionsList(), // Replace with your options module
|
|
isActive: _currentStep >= 1,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|