Implement proper handling for inactive/active subscriptions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UIDialogs {
|
||||
|
||||
static Future<String?> showTextInput(BuildContext context, String title, String hintText) {
|
||||
var _textFieldController = TextEditingController();
|
||||
|
||||
@@ -26,4 +27,25 @@ class UIDialogs {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
static Future<bool> showConfirmDialog(BuildContext context, String title, {String? text, String? okText, String? cancelText}) {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(title),
|
||||
content: (text != null) ? Text(text) : null,
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(cancelText ?? 'Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(okText ?? 'OK'),
|
||||
),
|
||||
],
|
||||
),
|
||||
).then((value) => value ?? false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -124,7 +124,7 @@ class UI {
|
||||
);
|
||||
}
|
||||
|
||||
static Widget metaCard({required BuildContext context, required IconData icon, required String title, required List<String> values, void Function()? mainAction, List<(IconData, void Function())>? iconActions}) {
|
||||
static Widget metaCard({required BuildContext context, required IconData icon, required String title, required List<String> values, void Function()? mainAction, List<(IconData, Color?, void Function())>? iconActions}) {
|
||||
final container = UI.box(
|
||||
context: context,
|
||||
padding: EdgeInsets.fromLTRB(16, 2, 4, 2),
|
||||
@@ -145,7 +145,7 @@ class UI {
|
||||
SizedBox(width: 12),
|
||||
for (final iconAction in iconActions) ...[
|
||||
SizedBox(width: 4),
|
||||
IconButton(icon: FaIcon(iconAction.$1), onPressed: iconAction.$2),
|
||||
IconButton(icon: FaIcon(iconAction.$1), color: iconAction.$2, onPressed: iconAction.$3),
|
||||
],
|
||||
],
|
||||
],
|
||||
|
Reference in New Issue
Block a user