58 lines
1.5 KiB
Dart
58 lines
1.5 KiB
Dart
part of 'dialog.dart';
|
|
|
|
class OutletDialog extends StatefulWidget {
|
|
const OutletDialog({super.key});
|
|
|
|
@override
|
|
State<OutletDialog> createState() => _OutletDialogState();
|
|
}
|
|
|
|
class _OutletDialogState extends State<OutletDialog> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
context.read<OutletLoaderBloc>().add(
|
|
OutletLoaderEvent.fetched(isRefresh: true),
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return CustomModalDialog(
|
|
title: 'Outlet',
|
|
subtitle: 'Silahkan pilih outlet',
|
|
minWidth: context.deviceWidth * 0.4,
|
|
contentPadding: const EdgeInsets.symmetric(
|
|
horizontal: 16.0,
|
|
vertical: 24.0,
|
|
),
|
|
child: BlocBuilder<OutletLoaderBloc, OutletLoaderState>(
|
|
builder: (context, state) {
|
|
if (state.isFetching) {
|
|
return LoaderWithText();
|
|
}
|
|
|
|
return Column(
|
|
children: [
|
|
...List.generate(
|
|
state.outlets.length,
|
|
(index) => GestureDetector(
|
|
onTap: () {
|
|
// selectOutlet(outlets[index]);
|
|
},
|
|
child: OutletCard(
|
|
outlet: state.outlets[index],
|
|
isSelected: false,
|
|
),
|
|
),
|
|
),
|
|
SpaceHeight(24),
|
|
AppElevatedButton.filled(onPressed: null, label: 'Terapkan'),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|