@@ -11,6 +11,7 @@ import 'package:miru_app/router/router.dart';
1111import 'package:miru_app/utils/database.dart' ;
1212import 'package:miru_app/utils/extension.dart' ;
1313import 'package:miru_app/utils/i18n.dart' ;
14+ import 'package:miru_app/utils/layout.dart' ;
1415import 'package:miru_app/widgets/cache_network_image.dart' ;
1516import 'package:miru_app/widgets/card_tile.dart' ;
1617import 'package:miru_app/widgets/messenger.dart' ;
@@ -138,103 +139,101 @@ class _ExtensionSettingsPageState extends State<ExtensionSettingsPage> {
138139 );
139140 }
140141 final extension = c.runtime.value! .extension ;
141- return Scaffold (
142- appBar: AppBar (
143- title: Text ('extension-info.title' .i18n),
144- ),
145- body: SingleChildScrollView (
146- child: Column (
147- children: [
148- const SizedBox (height: 30 ),
149- Center (
150- child: Container (
151- height: 100 ,
152- width: 100 ,
153- decoration: BoxDecoration (
154- borderRadius: BorderRadius .circular (10 ),
155- ),
156- clipBehavior: Clip .antiAlias,
157- child: CacheNetWorkImage (
158- extension .icon ?? '' ,
159- fit: BoxFit .contain,
160- ),
142+
143+ final content = SingleChildScrollView (
144+ child: Column (
145+ children: [
146+ const SizedBox (height: 30 ),
147+ Center (
148+ child: Container (
149+ height: 100 ,
150+ width: 100 ,
151+ decoration: BoxDecoration (
152+ borderRadius: BorderRadius .circular (10 ),
153+ ),
154+ clipBehavior: Clip .antiAlias,
155+ child: CacheNetWorkImage (
156+ extension .icon ?? '' ,
157+ fit: BoxFit .contain,
161158 ),
162159 ),
163- const SizedBox (height: 16 ),
164- Text (
165- extension .name,
166- style: Theme .of (context).textTheme.titleLarge,
167- ),
168- Text (
169- extension .package,
170- style: Theme .of (context).textTheme.bodySmall,
171- ),
172- const SizedBox (height: 30 ),
173- Padding (
174- padding: const EdgeInsets .symmetric (horizontal: 16 ),
175- child: GridView (
176- shrinkWrap: true ,
177- physics: const NeverScrollableScrollPhysics (),
178- gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount (
179- crossAxisCount: 2 ,
180- childAspectRatio: 3 ,
181- crossAxisSpacing: 2 ,
182- mainAxisSpacing: 8 ,
183- ),
184- children: [
185- InfoCard (
186- icon: Icons .person,
187- title: 'extension-info.author' .i18n,
188- content: extension .author,
189- ),
190- InfoCard (
191- icon: Icons .info,
192- title: 'extension-info.version' .i18n,
193- content: extension .version,
194- ),
195- InfoCard (
196- icon: Icons .language,
197- title: 'extension-info.language' .i18n,
198- content: extension .lang,
199- ),
200- InfoCard (
201- icon: Icons .description,
202- title: 'extension-info.license' .i18n,
203- content: extension .license,
204- ),
205- InfoCard (
206- icon: Icons .link,
207- title: 'extension-info.original-site' .i18n,
208- content: extension .webSite,
209- ),
210- ],
160+ ),
161+ const SizedBox (height: 16 ),
162+ Text (
163+ extension .name,
164+ style: Theme .of (context).textTheme.titleLarge,
165+ ),
166+ Text (
167+ extension .package,
168+ style: Theme .of (context).textTheme.bodySmall,
169+ ),
170+ const SizedBox (height: 30 ),
171+ Padding (
172+ padding: const EdgeInsets .symmetric (horizontal: 16 ),
173+ child: GridView (
174+ shrinkWrap: true ,
175+ physics: const NeverScrollableScrollPhysics (),
176+ gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount (
177+ crossAxisCount: 2 ,
178+ childAspectRatio: 3 ,
179+ crossAxisSpacing: 2 ,
180+ mainAxisSpacing: 8 ,
211181 ),
182+ children: [
183+ InfoCard (
184+ icon: Icons .person,
185+ title: 'extension-info.author' .i18n,
186+ content: extension .author,
187+ ),
188+ InfoCard (
189+ icon: Icons .info,
190+ title: 'extension-info.version' .i18n,
191+ content: extension .version,
192+ ),
193+ InfoCard (
194+ icon: Icons .language,
195+ title: 'extension-info.language' .i18n,
196+ content: extension .lang,
197+ ),
198+ InfoCard (
199+ icon: Icons .description,
200+ title: 'extension-info.license' .i18n,
201+ content: extension .license,
202+ ),
203+ InfoCard (
204+ icon: Icons .link,
205+ title: 'extension-info.original-site' .i18n,
206+ content: extension .webSite,
207+ ),
208+ ],
212209 ),
213- Padding (
214- padding : const EdgeInsets . all ( 16 ),
215- child : Row (
216- children : [
217- Expanded (
218- child : OutlinedButton (
219- onPressed : () async {
220- await ExtensionUtils . uninstall ( extension .package);
221- Get . back ( );
222- },
223- child : Text ( 'common.uninstall' .i18n) ,
224- ),
210+ ),
211+ Padding (
212+ padding : const EdgeInsets . all ( 16 ),
213+ child : Row (
214+ children : [
215+ Expanded (
216+ child : OutlinedButton (
217+ onPressed : () async {
218+ await ExtensionUtils . uninstall ( extension .package );
219+ Get . back ();
220+ } ,
221+ child : Text ( 'common.uninstall' .i18n ),
225222 ),
226- const SizedBox (width : 16 ),
227- Expanded (
228- child : FilledButton (
229- onPressed : () {
230- Get . to ( CodeEditPage ( extension : extension ));
231- },
232- child : Text ( 'extension.edit-code' .i18n) ,
233- ),
234- )
235- ],
236- ) ,
223+ ),
224+ const SizedBox (width : 16 ),
225+ Expanded (
226+ child : FilledButton (
227+ onPressed : () {
228+ Get . to ( CodeEditPage ( extension : extension ));
229+ } ,
230+ child : Text ( 'extension.edit-code' .i18n ),
231+ ),
232+ )
233+ ] ,
237234 ),
235+ ),
236+ if (! LayoutUtils .isTablet) ...[
238237 const Divider (),
239238 SettingsTile (
240239 title: 'cookie-clean.title' .i18n,
@@ -251,10 +250,47 @@ class _ExtensionSettingsPageState extends State<ExtensionSettingsPage> {
251250 ),
252251 ),
253252 ...settingsContent (),
254- ],
255- ) ,
253+ ]
254+ ] ,
256255 ),
257256 );
257+
258+ return Scaffold (
259+ appBar: AppBar (
260+ title: Text ('extension-info.title' .i18n),
261+ ),
262+ body: LayoutUtils .isTablet
263+ ? Row (
264+ crossAxisAlignment: CrossAxisAlignment .start,
265+ children: [
266+ Expanded (child: content),
267+ Expanded (
268+ child: SingleChildScrollView (
269+ child: Column (
270+ children: [
271+ SettingsTile (
272+ title: 'cookie-clean.title' .i18n,
273+ buildSubtitle: () => 'cookie-clean.subtitle' .i18n,
274+ trailing: TextButton (
275+ child: Text ('cookie-clean.clean' .i18n),
276+ onPressed: () {
277+ c.runtime.value! .cleanCookie ();
278+ showPlatformSnackbar (
279+ context: context,
280+ content: 'cookie-clean.success' .i18n,
281+ );
282+ },
283+ ),
284+ ),
285+ ...settingsContent (),
286+ ],
287+ ),
288+ ),
289+ ),
290+ ],
291+ )
292+ : content,
293+ );
258294 });
259295 }
260296
0 commit comments