completed group batch feature
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:qpay/screens/groups/models/recipient_group_model.dart';
|
||||
import 'package:qpay/models/responsive_policy.dart';
|
||||
import 'package:qpay/screens/groups/controllers/group_controller.dart';
|
||||
import 'package:qpay/widgets/app_snack_bar.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../recipient/recipients_controller.dart';
|
||||
@@ -68,12 +69,9 @@ class _GroupCreateScreenState extends State<GroupCreateScreen> {
|
||||
|
||||
final recipients = _parseRecipients(_recipientsController.text);
|
||||
if (recipients.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text(
|
||||
'Please add at least one recipient in name,account format.',
|
||||
),
|
||||
),
|
||||
AppSnackBar.show(
|
||||
context,
|
||||
'Please add at least one recipient in name,account format.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -94,13 +92,12 @@ class _GroupCreateScreenState extends State<GroupCreateScreen> {
|
||||
if (!mounted) return;
|
||||
|
||||
if (result.isSuccess) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Group created successfully.')),
|
||||
);
|
||||
AppSnackBar.showSuccess(context, 'Group created successfully.');
|
||||
context.pop(true); // Return true to indicate a new group was created
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(result.error ?? 'Failed to create group.')),
|
||||
AppSnackBar.showError(
|
||||
context,
|
||||
result.error ?? 'Failed to create group.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user