-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact_list_bottomsheet.dart
101 lines (96 loc) · 2.75 KB
/
contact_list_bottomsheet.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import 'package:chat_app/presentation/invite_screen/widgets/contactlist_item_widget.dart';
import '../contact_list_bottomsheet/widgets/userprofilesection_item_widget.dart';
import 'package:chat_app/core/app_export.dart';
import 'package:flutter/material.dart';
import 'package:grouped_list/grouped_list.dart';
class ContactListBottomsheet extends StatelessWidget {
ContactListBottomsheet({Key? key})
: super(
key: key,
);
List contactList = [
{'id': 1, 'groupBy': "A"},
{'id': 2, 'groupBy': "A"},
{'id': 3, 'groupBy': "B"},
{'id': 4, 'groupBy': "B"},
{'id': 5, 'groupBy': "B"},
{'id': 6, 'groupBy': "S"}
];
@override
Widget build(BuildContext context) {
return Container(
width: double.maxFinite,
padding: EdgeInsets.symmetric(
horizontal: 24.h,
vertical: 11.v,
),
decoration: AppDecoration.fillWhiteA.copyWith(
borderRadius: BorderRadiusStyle.customBorderTL40,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.center,
child: Container(
height: 3.v,
width: 30.h,
decoration: BoxDecoration(
color: appTheme.black90001,
borderRadius: BorderRadius.circular(
1.h,
),
),
),
),
SizedBox(height: 26.v),
Text(
"My Contact",
style: theme.textTheme.bodyLarge,
),
SizedBox(height: 14.v),
_buildUserProfileSection(context),
SizedBox(height: 49.v),
],
),
);
}
/// Section Widget
Widget _buildUserProfileSection(BuildContext context) {
return Padding(
padding: EdgeInsets.only(right: 104.h),
child: GroupedListView<dynamic, String>(
shrinkWrap: true,
stickyHeaderBackgroundColor: Colors.transparent,
elements: contactList,
groupBy: (element) => element['groupBy'],
sort: false,
groupSeparatorBuilder: (String value) {
return Padding(
padding: EdgeInsets.only(
top: 28.v,
bottom: 17.v,
),
child: Column(
children: [
Text(
value,
style: theme.textTheme.bodyLarge!.copyWith(
color: theme.colorScheme.onErrorContainer,
),
),
],
),
);
},
itemBuilder: (context, model) {
return MyHomePage();
},
separator: SizedBox(
height: 20.v,
),
),
);
}
}