@@ -5,6 +5,7 @@ import 'package:anymex/screens/profile/profile_page.dart';
5
5
import 'package:anymex/screens/settings/settings.dart' ;
6
6
import 'package:anymex/screens/local_source/local_source_view.dart' ;
7
7
import 'package:anymex/utils/function.dart' ;
8
+ import 'package:anymex/widgets/custom_widgets/anymex_bottomsheet.dart' ;
8
9
import 'package:anymex/widgets/helper/tv_wrapper.dart' ;
9
10
import 'package:anymex/widgets/custom_widgets/custom_text.dart' ;
10
11
import 'package:anymex/widgets/non_widgets/snackbar.dart' ;
@@ -21,12 +22,9 @@ class SettingsSheet extends StatelessWidget {
21
22
final serviceHandler = Get .find <ServiceHandler >();
22
23
23
24
static void show (BuildContext context) {
24
- showModalBottomSheet (
25
- context: context,
26
- isScrollControlled: true ,
27
- backgroundColor: Theme .of (context).colorScheme.surface,
28
- builder: (context) => SettingsSheet (),
29
- );
25
+ AnymexSheet (
26
+ customWidget: SettingsSheet (),
27
+ ).show (context);
30
28
}
31
29
32
30
void showServiceSelector (BuildContext context) {
@@ -55,49 +53,46 @@ class SettingsSheet extends StatelessWidget {
55
53
},
56
54
];
57
55
58
- showModalBottomSheet (
59
- context: context,
60
- isScrollControlled: true ,
61
- backgroundColor: Theme .of (context).colorScheme.surface,
62
- builder: (context) => Padding (
63
- padding: const EdgeInsets .all (20.0 ),
64
- child: Column (
65
- mainAxisSize: MainAxisSize .min,
66
- children: [
67
- const AnymexText (
68
- text: "Select Service" ,
69
- size: 16 ,
70
- variant: TextVariant .semiBold,
71
- ),
72
- ...services.map ((service) => ListTile (
73
- leading: service['icon' ] != null
74
- ? Image .asset (
75
- color: Theme .of (context).colorScheme.primary,
76
- 'assets/images/${service ['icon' ]}' ,
77
- width: 30 ,
78
- )
79
- : Icon (
80
- Icons .extension ,
81
- size: 30 ,
82
- color: Theme .of (context).colorScheme.primary,
83
- ),
84
- title: AnymexText (
85
- text: service['name' ] as String ,
86
- variant: TextVariant .semiBold,
87
- color: serviceHandler.serviceType.value == service['type' ]
88
- ? Theme .of (context).colorScheme.primary
89
- : null ,
90
- ),
91
- onTap: () {
92
- serviceHandler
93
- .changeService (service['type' ] as ServicesType );
94
- Navigator .pop (context);
95
- },
96
- )),
97
- ],
56
+ AnymexSheet .custom (
57
+ Padding (
58
+ padding: const EdgeInsets .all (20.0 ),
59
+ child: Column (
60
+ mainAxisSize: MainAxisSize .min,
61
+ children: [
62
+ const AnymexText (
63
+ text: "Select Service" ,
64
+ size: 16 ,
65
+ variant: TextVariant .semiBold,
66
+ ),
67
+ ...services.map ((service) => ListTile (
68
+ leading: service['icon' ] != null
69
+ ? Image .asset (
70
+ color: Theme .of (context).colorScheme.primary,
71
+ 'assets/images/${service ['icon' ]}' ,
72
+ width: 30 ,
73
+ )
74
+ : Icon (
75
+ Icons .extension ,
76
+ size: 30 ,
77
+ color: Theme .of (context).colorScheme.primary,
78
+ ),
79
+ title: AnymexText (
80
+ text: service['name' ] as String ,
81
+ variant: TextVariant .semiBold,
82
+ color: serviceHandler.serviceType.value == service['type' ]
83
+ ? Theme .of (context).colorScheme.primary
84
+ : null ,
85
+ ),
86
+ onTap: () {
87
+ serviceHandler
88
+ .changeService (service['type' ] as ServicesType );
89
+ Get .back ();
90
+ },
91
+ )),
92
+ ],
93
+ ),
98
94
),
99
- ),
100
- );
95
+ context);
101
96
}
102
97
103
98
@override
@@ -119,6 +114,8 @@ class SettingsSheet extends StatelessWidget {
119
114
borderRadius: BorderRadius .circular (50 ),
120
115
child: CachedNetworkImage (
121
116
fit: BoxFit .cover,
117
+ width: 45 ,
118
+ height: 45 ,
122
119
errorWidget: (context, url, error) =>
123
120
const Icon (IconlyBold .profile),
124
121
imageUrl:
0 commit comments