Files
apskel-pos-flutter-v2/lib/presentation/components/dialog/outlet_dialog.dart
T

61 lines
1.5 KiB
Dart
Raw Normal View History

2025-10-24 14:28:04 +07:00
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(
2026-03-01 20:02:12 +07:00
const OutletLoaderEvent.fetched(isRefresh: true),
2025-10-24 14:28:04 +07:00
);
}
@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) {
2026-03-01 20:02:12 +07:00
return const LoaderWithText();
2025-10-24 14:28:04 +07:00
}
return Column(
children: [
...List.generate(
state.outlets.length,
(index) => GestureDetector(
onTap: () {
// selectOutlet(outlets[index]);
},
child: OutletCard(
outlet: state.outlets[index],
isSelected: false,
),
),
),
2026-03-01 20:02:12 +07:00
const SpaceHeight(24),
const AppElevatedButton.filled(
onPressed: null,
label: 'Terapkan',
),
2025-10-24 14:28:04 +07:00
],
);
},
),
);
}
}