You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.9 KiB
Dart
64 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
import 'package:mc_common_app/utils/app_permission_handler.dart';
|
|
import 'package:mc_common_app/widgets/common_widgets/info_bottom_sheet.dart';
|
|
|
|
Future<ConfirmAction?> showConfirmDialogs(context, msg, positiveText, negativeText) async {
|
|
return showDialog<ConfirmAction>(
|
|
context: context,
|
|
barrierDismissible: false,
|
|
builder: (context) {
|
|
return AlertDialog(
|
|
backgroundColor: Colors.white,
|
|
title: Text(msg, style: TextStyle(fontSize: 16)),
|
|
actions: <Widget>[
|
|
TextButton(
|
|
child: Text(
|
|
negativeText,
|
|
),
|
|
onPressed: () {
|
|
Navigator.of(context).pop(ConfirmAction.CANCEL);
|
|
},
|
|
),
|
|
TextButton(
|
|
child: Text(
|
|
positiveText,
|
|
),
|
|
onPressed: () {
|
|
Navigator.of(context).pop(ConfirmAction.ACCEPT);
|
|
},
|
|
)
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
void actionConfirmationBottomSheet({required BuildContext context, required Widget title, required subtitle, required Widget actionButtonYes, required Widget actionButtonNo}) {
|
|
showModalBottomSheet(
|
|
context: context,
|
|
isScrollControlled: true,
|
|
enableDrag: true,
|
|
builder: (BuildContext context) {
|
|
return InfoBottomSheet(
|
|
title: title,
|
|
description: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"$subtitle".toText(fontSize: 16),
|
|
25.height,
|
|
Row(
|
|
children: [
|
|
actionButtonYes,
|
|
20.width,
|
|
actionButtonNo,
|
|
],
|
|
),
|
|
19.height,
|
|
],
|
|
));
|
|
},
|
|
);
|
|
}
|