@@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
55import 'package:flutter_riverpod/flutter_riverpod.dart' ;
66import 'package:flutter_svg/flutter_svg.dart' ;
77import 'package:go_router/go_router.dart' ;
8+ import 'package:khelo/components/action_bottom_sheet.dart' ;
89import 'package:khelo/components/app_page.dart' ;
910import 'package:khelo/domain/extensions/context_extensions.dart' ;
1011import 'package:khelo/domain/extensions/enum_extensions.dart' ;
@@ -68,28 +69,28 @@ class _AddStreamInfoScreenState extends ConsumerState<AddStreamInfoScreen> {
6869 }
6970
7071 return ListView (
72+ padding: context.mediaQueryPadding + EdgeInsets .symmetric (horizontal: 16 ),
7173 children: [
7274 if (state.stream == null ) ...[
7375 _mediumOptionView (context),
7476 ] else ...[
7577 Container (
76- padding: EdgeInsets .all (16 ),
77- margin: const EdgeInsets .all (16 ),
78+ padding: EdgeInsets .symmetric (horizontal: 16 , vertical: 24 ),
7879 decoration: BoxDecoration (
7980 borderRadius: BorderRadius .circular (30 ),
8081 border: Border .all (color: context.colorScheme.outline),
8182 ),
8283 child: Column (
8384 spacing: 16 ,
8485 children: [
85- Text (
86- context.l10n.add_stream_info_all_set_title,
87- style: AppTextStyle .header4
88- .copyWith (color: context.colorScheme.textPrimary),
89- ),
86+ Text (context.l10n.add_stream_info_all_set_title,
87+ textAlign: TextAlign .center,
88+ style: AppTextStyle .header4
89+ .copyWith (color: context.colorScheme.textPrimary)),
9090 Text (context.l10n.add_stream_info_all_set_description,
91+ textAlign: TextAlign .center,
9192 style: AppTextStyle .subtitle2
92- .copyWith (color: context.colorScheme.textPrimary )),
93+ .copyWith (color: context.colorScheme.textSecondary )),
9394 PrimaryButton (
9495 context.l10n.add_stream_info_go_live_title,
9596 expanded: false ,
@@ -107,7 +108,7 @@ class _AddStreamInfoScreenState extends ConsumerState<AddStreamInfoScreen> {
107108
108109 Widget _mediumOptionView (BuildContext context) {
109110 return Padding (
110- padding: context.mediaQueryPadding + const EdgeInsets .all ( 16 ),
111+ padding: const EdgeInsets .symmetric (vertical : 16 ),
111112 child: Container (
112113 padding: const EdgeInsets .all (16 ),
113114 decoration: BoxDecoration (
@@ -116,11 +117,9 @@ class _AddStreamInfoScreenState extends ConsumerState<AddStreamInfoScreen> {
116117 child: Column (
117118 spacing: 16 ,
118119 children: [
119- // TODO: remove unlink button
120- ElevatedButton (
121- onPressed: () => notifier.unlink (), child: Text ("Unlink" )),
122120 Text (
123121 context.l10n.add_stream_info_go_live_with_text,
122+ textAlign: TextAlign .center,
124123 style: AppTextStyle .header4
125124 .copyWith (color: context.colorScheme.textPrimary),
126125 ),
@@ -145,21 +144,23 @@ class _AddStreamInfoScreenState extends ConsumerState<AddStreamInfoScreen> {
145144 children: [
146145 SvgPicture .asset (
147146 Assets .images.icYoutube,
147+ height: 22 ,
148148 colorFilter:
149149 ColorFilter .mode (context.colorScheme.alert, BlendMode .srcIn),
150- height: 20 ,
151150 ),
152151 SizedBox (width: 16 ),
153152 Expanded (
154153 child: Column (
155154 crossAxisAlignment: CrossAxisAlignment .start,
156155 children: [
157156 Text (option.getString (context),
157+ textAlign: TextAlign .center,
158158 style: AppTextStyle .subtitle2
159159 .copyWith (color: context.colorScheme.textPrimary)),
160160 if (option.isLoginRequired)
161161 Text (
162162 context.l10n.add_stream_info_login_required_text,
163+ textAlign: TextAlign .center,
163164 style: AppTextStyle .caption
164165 .copyWith (color: context.colorScheme.textSecondary),
165166 )
@@ -181,10 +182,7 @@ class _AddStreamInfoScreenState extends ConsumerState<AddStreamInfoScreen> {
181182 });
182183 }
183184
184- void _observeYTChannels (
185- BuildContext context,
186- WidgetRef ref,
187- ) {
185+ void _observeYTChannels (BuildContext context, WidgetRef ref) {
188186 ref.listen (addStreamInfoStateProvider.select ((value) => value.ytChannels),
189187 (previous, next) {
190188 if (next.isNotEmpty) {
@@ -193,15 +191,22 @@ class _AddStreamInfoScreenState extends ConsumerState<AddStreamInfoScreen> {
193191 });
194192 }
195193
196- void _observeShowSelectResolutionSheet (
197- BuildContext context,
198- WidgetRef ref,
199- ) {
194+ void _observeShowSelectResolutionSheet (BuildContext context, WidgetRef ref) {
200195 ref.listen (
201196 addStreamInfoStateProvider.select (
202197 (value) => value.showSelectResolutionSheet), (previous, next) {
203198 if (next) {
204- chooseYTResolutionSheet (context);
199+ showActionBottomSheet (
200+ context: context,
201+ items: YouTubeResolution .values
202+ .map ((e) => BottomSheetAction (
203+ title: e.stringResolution,
204+ onTap: () {
205+ context.pop ();
206+ notifier.onResolutionSelect (e);
207+ },
208+ ))
209+ .toList ());
205210 }
206211 });
207212 }
@@ -244,49 +249,6 @@ class _AddStreamInfoScreenState extends ConsumerState<AddStreamInfoScreen> {
244249 );
245250 }
246251
247- void chooseYTResolutionSheet (BuildContext context) {
248- HapticFeedback .mediumImpact ();
249- showModalBottomSheet (
250- context: context,
251- showDragHandle: false ,
252- enableDrag: false ,
253- isScrollControlled: true ,
254- useRootNavigator: true ,
255- backgroundColor: context.colorScheme.surface,
256- builder: (context) {
257- return SizedBox (
258- height: context.mediaQuerySize.height * 0.8 ,
259- child: Column (
260- crossAxisAlignment: CrossAxisAlignment .start,
261- children: [
262- Padding (
263- padding:
264- const EdgeInsets .symmetric (horizontal: 16.0 , vertical: 16 ),
265- child: Text (
266- context.l10n.add_stream_info_choose_resolution,
267- style: AppTextStyle .header4
268- .copyWith (color: context.colorScheme.textPrimary),
269- ),
270- ),
271- Expanded (
272- child: ListView .separated (
273- itemBuilder: (context, index) => OnTapScale (
274- onTap: () {
275- context.pop ();
276- notifier.onResolutionSelect (
277- YouTubeResolution .values[index]);
278- },
279- child: Text (YouTubeResolution .values[index].name)),
280- separatorBuilder: (context, index) =>
281- Divider (color: context.colorScheme.outline),
282- itemCount: YouTubeResolution .values.length)),
283- ],
284- ),
285- );
286- },
287- );
288- }
289-
290252 Widget ytChannelCell (BuildContext context, {required YTChannel channel}) {
291253 return OnTapScale (
292254 onTap: () => notifier.onChannelSelect (channel.id),
0 commit comments