mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 01:07:55 +00:00
38 lines
1.2 KiB
Dart
38 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
|
|
class ConditionDialog extends StatelessWidget {
|
|
const ConditionDialog({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AlertDialog(
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20.0)),
|
|
contentPadding: EdgeInsets.zero,
|
|
content: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
_buildDialogOption(context, 'When all conditions are met'),
|
|
_buildDialogOption(context, 'When any condition is met'),
|
|
const Divider(color: ColorsManager.greyColor),
|
|
_buildDialogOption(context, 'Cancel', isCancel: true),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildDialogOption(BuildContext context, String text, {bool isCancel = false}) {
|
|
return ListTile(
|
|
title: Center(
|
|
child: BodyMedium(
|
|
text: text,
|
|
fontSize: 15,
|
|
fontWeight: isCancel ? FontWeight.normal : FontWeight.w400,
|
|
fontColor: isCancel ? Colors.grey : null,
|
|
),
|
|
),
|
|
onTap: () => Navigator.of(context).pop(),
|
|
);
|
|
}
|
|
} |