You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.4 KiB
Dart
46 lines
1.4 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:isekai_wiki/models/settings.dart';
|
|
import 'package:isekai_wiki/models/user.dart';
|
|
import 'models/model.dart';
|
|
import 'pages/tab_page.dart';
|
|
import 'styles.dart';
|
|
|
|
class IsekaiWikiApp extends StatelessWidget {
|
|
const IsekaiWikiApp({super.key});
|
|
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Get.put(UserController());
|
|
Get.put(AppSettingsController());
|
|
|
|
return Material(
|
|
child: GetCupertinoApp(
|
|
title: '异世界百科',
|
|
theme: const CupertinoThemeData(
|
|
textTheme: Styles.defaultTextTheme,
|
|
scaffoldBackgroundColor: Styles.themePageBackgroundColor),
|
|
localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
|
|
DefaultMaterialLocalizations.delegate,
|
|
DefaultWidgetsLocalizations.delegate,
|
|
DefaultCupertinoLocalizations.delegate,
|
|
],
|
|
initialBinding: InitialBinding(),
|
|
home: const IsekaiWikiTabsPage(),
|
|
builder: (context, child) {
|
|
if (child == null) {
|
|
return Container();
|
|
} else {
|
|
Styles.textScaleFactor = MediaQuery.of(context).textScaleFactor;
|
|
Styles.isXs = MediaQuery.of(context).size.width <= 340;
|
|
return child;
|
|
}
|
|
},
|
|
debugShowCheckedModeBanner: false,
|
|
),
|
|
);
|
|
}
|
|
}
|