From a0153d0d8684f7ac3f5b00867e1c56bf3a5a6f50 Mon Sep 17 00:00:00 2001 From: reasje Date: Mon, 9 Dec 2024 22:23:54 +0330 Subject: [PATCH] refactor: Apply base bottom sheet to info bottom sheet --- .../src/bottom_sheets/info_bottom_sheet.dart | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/ui/lib/src/bottom_sheets/info_bottom_sheet.dart b/ui/lib/src/bottom_sheets/info_bottom_sheet.dart index 2d02f81..f4e6f17 100644 --- a/ui/lib/src/bottom_sheets/info_bottom_sheet.dart +++ b/ui/lib/src/bottom_sheets/info_bottom_sheet.dart @@ -1,18 +1,27 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:mxc_ui/mxc_ui.dart'; +import 'package:mxc_ui/src/bottom_sheets/base_bottom_sheet.dart'; Future showInformationalBottomSheet( - BuildContext context, List texts) { - String translate(String text) => FlutterI18n.translate(context, text); - - return showModalBottomSheet( + BuildContext context, List texts) async { + return showBaseBottomSheet( context: context, - useRootNavigator: true, - isScrollControlled: true, - backgroundColor: Colors.transparent, - useSafeArea: true, - builder: (BuildContext context) => Container( + content: InformationWidget( + texts: texts, + ), + ); +} + +class InformationWidget extends StatelessWidget { + final List texts; + const InformationWidget({super.key, required this.texts}); + + @override + Widget build(BuildContext context) { + String translate(String text) => FlutterI18n.translate(context, text); + + return Container( padding: const EdgeInsets.only( top: Sizes.spaceNormal, bottom: Sizes.space3XLarge), decoration: BoxDecoration( @@ -56,6 +65,6 @@ Future showInformationalBottomSheet( ], ), ), - ), - ); + ); + } }