|
17 | 17 | * Copyright (c) 2022-2025, BrightDV |
18 | 18 | */ |
19 | 19 |
|
| 20 | +import 'package:boxbox/helpers/bottom_sheet.dart'; |
20 | 21 | import 'package:boxbox/helpers/constants.dart'; |
21 | 22 | import 'package:boxbox/l10n/app_localizations.dart'; |
22 | 23 | import 'package:cached_network_image/cached_network_image.dart'; |
@@ -101,77 +102,77 @@ class _ChampionshipScreenState extends State<ChampionshipScreen> { |
101 | 102 | onPressed: () async { |
102 | 103 | final TextEditingController controller = |
103 | 104 | TextEditingController(); |
104 | | - await showModalBottomSheet( |
105 | | - context: context, |
106 | | - builder: (context) => BottomSheet( |
107 | | - shape: RoundedRectangleBorder( |
108 | | - borderRadius: BorderRadius.circular(10.0), |
109 | | - ), |
110 | | - onClosing: () {}, |
111 | | - builder: (context) { |
112 | | - return SizedBox( |
113 | | - child: Padding( |
114 | | - padding: EdgeInsets.fromLTRB( |
115 | | - 30, |
116 | | - 15, |
117 | | - 30, |
118 | | - MediaQuery.of(context).viewInsets.bottom, |
| 105 | + await showCustomBottomSheet( |
| 106 | + context, |
| 107 | + SizedBox( |
| 108 | + child: Padding( |
| 109 | + padding: EdgeInsets.fromLTRB( |
| 110 | + 30, |
| 111 | + 15, |
| 112 | + 30, |
| 113 | + MediaQuery.of(context).viewInsets.bottom, |
| 114 | + ), |
| 115 | + child: Column( |
| 116 | + mainAxisSize: MainAxisSize.min, |
| 117 | + children: [ |
| 118 | + Padding( |
| 119 | + padding: EdgeInsets.only(bottom: 20), |
| 120 | + child: Text( |
| 121 | + AppLocalizations.of(context)! |
| 122 | + .customErgastUrl, |
| 123 | + style: TextStyle(fontSize: 20), |
| 124 | + ), |
119 | 125 | ), |
120 | | - child: Column( |
121 | | - mainAxisSize: MainAxisSize.min, |
122 | | - children: [ |
123 | | - TextField( |
124 | | - controller: controller, |
125 | | - decoration: InputDecoration( |
126 | | - hintText: ergastUrl, |
127 | | - hintStyle: TextStyle( |
128 | | - fontWeight: FontWeight.w100, |
129 | | - ), |
130 | | - ), |
| 126 | + TextField( |
| 127 | + controller: controller, |
| 128 | + decoration: InputDecoration( |
| 129 | + border: OutlineInputBorder(), |
| 130 | + hintText: ergastUrl, |
| 131 | + hintStyle: TextStyle( |
| 132 | + fontWeight: FontWeight.w100, |
131 | 133 | ), |
132 | | - Padding( |
133 | | - padding: EdgeInsets.only( |
134 | | - top: 5, |
135 | | - bottom: 5, |
| 134 | + ), |
| 135 | + ), |
| 136 | + Padding( |
| 137 | + padding: |
| 138 | + EdgeInsets.only(top: 20, bottom: 7), |
| 139 | + child: Container( |
| 140 | + width: double.infinity, |
| 141 | + height: 50, |
| 142 | + child: FilledButton.tonal( |
| 143 | + onPressed: () { |
| 144 | + Hive.box('settings').put( |
| 145 | + 'ergastUrl', |
| 146 | + controller.text, |
| 147 | + ); |
| 148 | + Navigator.of(context).pop(); |
| 149 | + setState(() {}); |
| 150 | + }, |
| 151 | + child: Text( |
| 152 | + AppLocalizations.of(context)!.save, |
136 | 153 | ), |
137 | | - child: Row( |
138 | | - children: [ |
139 | | - ElevatedButton( |
140 | | - onPressed: () { |
141 | | - Hive.box('settings').put( |
142 | | - 'ergastUrl', |
143 | | - controller.text, |
144 | | - ); |
145 | | - Navigator.of(context).pop(); |
146 | | - setState(() {}); |
147 | | - }, |
148 | | - child: Text( |
149 | | - AppLocalizations.of(context)! |
150 | | - .save, |
151 | | - ), |
152 | | - ), |
153 | | - Padding( |
154 | | - padding: |
155 | | - EdgeInsets.only(left: 10), |
156 | | - child: ElevatedButton( |
157 | | - onPressed: () { |
158 | | - Navigator.of(context).pop(); |
159 | | - }, |
160 | | - child: Text( |
161 | | - AppLocalizations.of( |
162 | | - context)! |
163 | | - .close, |
164 | | - ), |
165 | | - ), |
166 | | - ), |
167 | | - ], |
| 154 | + ), |
| 155 | + ), |
| 156 | + ), |
| 157 | + Padding( |
| 158 | + padding: |
| 159 | + EdgeInsets.only(top: 7, bottom: 20), |
| 160 | + child: Container( |
| 161 | + width: double.infinity, |
| 162 | + height: 50, |
| 163 | + child: OutlinedButton( |
| 164 | + onPressed: () { |
| 165 | + Navigator.of(context).pop(); |
| 166 | + }, |
| 167 | + child: Text( |
| 168 | + AppLocalizations.of(context)!.close, |
168 | 169 | ), |
169 | 170 | ), |
170 | | - ], |
| 171 | + ), |
171 | 172 | ), |
172 | | - ), |
173 | | - ); |
174 | | - }, |
| 173 | + ], |
| 174 | + ), |
| 175 | + ), |
175 | 176 | ), |
176 | 177 | ); |
177 | 178 | }, |
|
0 commit comments