Skip to content

Commit 5c5fb46

Browse files
committed
Use WnDialog
1 parent 6f47452 commit 5c5fb46

File tree

1 file changed

+62
-72
lines changed

1 file changed

+62
-72
lines changed

lib/ui/chat/chat_management/widgets/create_group_dialog.dart

Lines changed: 62 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import 'dart:ui';
21
import 'package:flutter/material.dart';
32
import 'package:flutter_screenutil/flutter_screenutil.dart';
43
import 'package:gap/gap.dart';
54
import 'package:whitenoise/domain/models/contact_model.dart';
65
import 'package:whitenoise/ui/core/themes/src/extensions.dart';
76
import 'package:whitenoise/ui/core/ui/wn_button.dart';
7+
import 'package:whitenoise/ui/core/ui/wn_dialog.dart';
88

99
class CreateGroupDialog extends StatelessWidget {
1010
final VoidCallback? onCreateGroup;
@@ -20,82 +20,72 @@ class CreateGroupDialog extends StatelessWidget {
2020

2121
@override
2222
Widget build(BuildContext context) {
23-
return BackdropFilter(
24-
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
25-
child: AlertDialog(
26-
backgroundColor: context.colors.surface,
27-
shape: const RoundedRectangleBorder(),
28-
insetPadding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.h),
29-
contentPadding: EdgeInsets.zero,
30-
content: SizedBox(
31-
width: MediaQuery.of(context).size.width,
32-
child: Container(
33-
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 20.h),
34-
child: Column(
35-
mainAxisSize: MainAxisSize.min,
36-
children: [
37-
Row(
38-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
39-
children: [
40-
Text(
41-
'Create a Group to Continue',
42-
style: context.textTheme.bodyLarge?.copyWith(
43-
color: context.colors.primary,
44-
fontSize: 18.sp,
45-
fontWeight: FontWeight.w600,
46-
),
47-
),
48-
GestureDetector(
49-
onTap: onCancel ?? () => Navigator.of(context).pop(),
50-
child: Icon(
51-
Icons.close,
52-
size: 16.w,
53-
color: context.colors.mutedForeground,
54-
),
55-
),
56-
],
57-
),
58-
Gap(8.h),
59-
60-
Text(
61-
'You are not a member of any groups. Make a new group to add someone.',
62-
style: context.textTheme.bodyMedium?.copyWith(
63-
color: context.colors.mutedForeground,
64-
fontSize: 14.sp,
65-
height: 1.4,
23+
return WnDialog.custom(
24+
customChild: Column(
25+
mainAxisSize: MainAxisSize.min,
26+
children: [
27+
Row(
28+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
29+
children: [
30+
Expanded(
31+
child: Text(
32+
'Create a Group to Continue',
33+
style: context.textTheme.bodyLarge?.copyWith(
34+
color: context.colors.primary,
35+
fontSize: 18.sp,
36+
fontWeight: FontWeight.w600,
6637
),
67-
textAlign: TextAlign.left,
6838
),
69-
Gap(16.h),
70-
71-
Column(
72-
children: [
73-
WnFilledButton(
74-
onPressed: onCancel ?? () => Navigator.of(context).pop(),
75-
label: 'Cancel',
76-
visualState: WnButtonVisualState.secondary,
77-
size: WnButtonSize.small,
78-
labelTextStyle: TextStyle(
79-
fontSize: 16.sp,
80-
fontWeight: FontWeight.w600,
81-
),
82-
),
83-
Gap(12.h),
84-
WnFilledButton(
85-
onPressed: onCreateGroup,
86-
label: 'New Group Chat',
87-
size: WnButtonSize.small,
88-
labelTextStyle: TextStyle(
89-
fontSize: 16.sp,
90-
fontWeight: FontWeight.w600,
91-
),
92-
),
93-
],
39+
),
40+
GestureDetector(
41+
onTap: onCancel ?? () => Navigator.of(context).pop(),
42+
child: Icon(
43+
Icons.close,
44+
size: 16.w,
45+
color: context.colors.mutedForeground,
9446
),
95-
],
47+
),
48+
],
49+
),
50+
Gap(8.h),
51+
Align(
52+
alignment: Alignment.centerLeft,
53+
child: Text(
54+
'You are not a member of any groups. Make a new group to add someone.',
55+
style: context.textTheme.bodyMedium?.copyWith(
56+
color: context.colors.mutedForeground,
57+
fontSize: 14.sp,
58+
height: 1.4,
59+
),
60+
textAlign: TextAlign.left,
9661
),
9762
),
98-
),
63+
Gap(16.h),
64+
Column(
65+
children: [
66+
WnFilledButton(
67+
onPressed: onCancel ?? () => Navigator.of(context).pop(),
68+
label: 'Cancel',
69+
visualState: WnButtonVisualState.secondary,
70+
size: WnButtonSize.small,
71+
labelTextStyle: TextStyle(
72+
fontSize: 16.sp,
73+
fontWeight: FontWeight.w600,
74+
),
75+
),
76+
Gap(12.h),
77+
WnFilledButton(
78+
onPressed: onCreateGroup,
79+
label: 'New Group Chat',
80+
size: WnButtonSize.small,
81+
labelTextStyle: TextStyle(
82+
fontSize: 16.sp,
83+
fontWeight: FontWeight.w600,
84+
),
85+
),
86+
],
87+
),
88+
],
9989
),
10090
);
10191
}

0 commit comments

Comments
 (0)