first commit
This commit is contained in:
64
lib/widgets/stepper_edit.dart
Normal file
64
lib/widgets/stepper_edit.dart
Normal file
@@ -0,0 +1,64 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:mitra_corporate/provider/order_provider.dart';
|
||||
import 'package:mitra_corporate/provider/registrasi_provider.dart';
|
||||
|
||||
import '../app/constant.dart';
|
||||
|
||||
class StepperEdit extends HookConsumerWidget {
|
||||
final int _currentStep = 0;
|
||||
StepperType stepperType = StepperType.horizontal;
|
||||
|
||||
StepperEdit({super.key});
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final step = ref.watch(EditStepProvider);
|
||||
final tempRegistrationData = ref.watch(registrationDataProvider);
|
||||
final selectedTest = ref.watch(selectedTestProvider);
|
||||
final orderLoading = ref.watch(addOrderLoadingProvider);
|
||||
|
||||
return Scaffold(
|
||||
body: Stepper(
|
||||
elevation: 0,
|
||||
type: stepperType,
|
||||
physics: const ScrollPhysics(),
|
||||
currentStep: step,
|
||||
onStepTapped: !orderLoading
|
||||
? (value) {
|
||||
if ((value) != 3) {
|
||||
ref.read(registrasiProvider.notifier).state = value;
|
||||
}
|
||||
}
|
||||
: null,
|
||||
steps: <Step>[
|
||||
Step(
|
||||
title: Text('Data Pasien',
|
||||
style: Constant.caption1_400(context: context)
|
||||
.copyWith(color: Constant.textBlack)),
|
||||
content: Container(),
|
||||
isActive: step == 0,
|
||||
state: tempRegistrationData.patientData?.name != null
|
||||
? StepState.complete
|
||||
: StepState.disabled,
|
||||
),
|
||||
Step(
|
||||
title: Text('Pemeriksaan',
|
||||
style: Constant.caption1_400(context: context)
|
||||
.copyWith(color: Constant.textBlack)),
|
||||
content: Container(),
|
||||
isActive: step == 1,
|
||||
state: tempRegistrationData.tests != null
|
||||
? StepState.complete
|
||||
: StepState.disabled,
|
||||
),
|
||||
Step(
|
||||
title: Text('Detail Order',
|
||||
style: Constant.caption1_400(context: context)
|
||||
.copyWith(color: Constant.textBlack)),
|
||||
content: Container(),
|
||||
isActive: step == 2,
|
||||
state: step - 1 >= 2 ? StepState.complete : StepState.disabled,
|
||||
),
|
||||
]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user