Untitled

 avatar
unknown
plain_text
2 years ago
3.5 kB
4
Indexable
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'add_edit_measurement_controller.dart';

class AddEditMeasurementScreen extends StatelessWidget {
  AddEditMeasurementScreen({Key? key}) : super(key: key);

  final AddEditMeasurementController controller =
      Get.put(AddEditMeasurementController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        automaticallyImplyLeading: true,
        title: const Text('Add Measurement'),
        centerTitle: true,
      ),
      body: Container(
        child: Column(
          children: [
            Obx(
              () => Expanded(
                child: Stepper(
                  type: controller.stepperType,
                  physics: const ScrollPhysics(),
                  currentStep: controller.currentStep.value,
                  onStepTapped: (step) => controller.tapped(step),
                  onStepContinue: controller.continued,
                  onStepCancel: controller.cancel,
                  steps: [
                    Step(
                      title: Text('Account'),
                      content: Column(
                        children: <Widget>[
                          TextFormField(
                            decoration:
                                InputDecoration(labelText: 'Email Address'),
                          ),
                          TextFormField(
                            decoration: InputDecoration(labelText: 'Password'),
                          ),
                        ],
                      ),
                      isActive: controller.currentStep >= 0,
                      state: controller.currentStep >= 0
                          ? StepState.complete
                          : StepState.disabled,
                    ),
                    Step(
                      title: Text('Address'),
                      content: Column(
                        children: <Widget>[
                          TextFormField(
                            decoration:
                                InputDecoration(labelText: 'Home Address'),
                          ),
                          TextFormField(
                            decoration: InputDecoration(labelText: 'Postcode'),
                          ),
                        ],
                      ),
                      isActive: controller.currentStep >= 0,
                      state: controller.currentStep >= 1
                          ? StepState.complete
                          : StepState.disabled,
                    ),
                    Step(
                      title: Text('Address'),
                      content: Column(
                        children: <Widget>[
                          TextFormField(
                            decoration:
                                InputDecoration(labelText: 'Home Address'),
                          ),
                          TextFormField(
                            decoration: InputDecoration(labelText: 'Postcode'),
                          ),
                        ],
                      ),
                      isActive: controller.currentStep >= 0,
                      state: controller.currentStep >= 1
                          ? StepState.complete
                          : StepState.disabled,
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
Editor is loading...