diff --git a/images/title.png b/assets/images/title.png similarity index 100% rename from images/title.png rename to assets/images/title.png diff --git a/assets/tpl/wikiPage.html b/assets/tpl/wikiPage.html new file mode 100644 index 0000000..edb880c --- /dev/null +++ b/assets/tpl/wikiPage.html @@ -0,0 +1,15 @@ + + + + + + {{title}} + + {{scripts}} + + +
+ {{content}} +
+ + \ No newline at end of file diff --git a/lib/api/mw/mw_api.dart b/lib/api/mw/mw_api.dart index e97411f..07829a1 100755 --- a/lib/api/mw/mw_api.dart +++ b/lib/api/mw/mw_api.dart @@ -72,8 +72,6 @@ class MWResponse { } class MWApi { - static Uri apiBaseUri = Uri.parse(Global.wikiApiUrl); - static Future>> get(String action, {Map? params}) async { Map paramsStr = @@ -90,6 +88,7 @@ class MWApi { var resText = ""; try { + var apiBaseUri = Uri.parse(Global.siteConfig.apiUrl); resText = await BaseApi.get(apiBaseUri, search: paramsStr); } on DioError catch (err) { if (err.type == DioErrorType.response) { @@ -133,6 +132,8 @@ class MWApi { params["token"] = await getToken(type: withToken); } + var apiBaseUri = Uri.parse(Global.siteConfig.apiUrl); + resText = await BaseApi.post(apiBaseUri, data: params); } on DioError catch (err) { if (err.type == DioErrorType.response) { diff --git a/lib/api/restbase/restbase_api.dart b/lib/api/restbase/restbase_api.dart index 1164074..8dae611 100644 --- a/lib/api/restbase/restbase_api.dart +++ b/lib/api/restbase/restbase_api.dart @@ -3,7 +3,7 @@ import 'package:isekai_wiki/global.dart'; class RestbaseApi { static Uri getUri(String endpoint, {Map? search}) { - String url = Global.restfulApiUrl; + String url = Global.siteConfig.restfulApiUrl; if (url.endsWith("/")) { url = url.substring(0, url.length - 1); } diff --git a/lib/app.dart b/lib/app.dart index 00718ef..a5b03e6 100755 --- a/lib/app.dart +++ b/lib/app.dart @@ -1,8 +1,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:get/get.dart'; import 'package:isekai_wiki/global.dart'; import 'package:isekai_wiki/models/settings.dart'; +import 'package:isekai_wiki/models/site_config.dart'; import 'package:isekai_wiki/models/user.dart'; import 'package:isekai_wiki/pages/welcome_page.dart'; import 'models/model.dart'; @@ -33,9 +35,13 @@ class IsekaiWikiApp extends StatelessWidget { textTheme: Styles.defaultTextTheme, scaffoldBackgroundColor: Styles.themePageBackgroundColor), localizationsDelegates: const >[ - DefaultMaterialLocalizations.delegate, - DefaultWidgetsLocalizations.delegate, - DefaultCupertinoLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: const [ + Locale('zh', 'CN'), + Locale('en'), ], initialBinding: InitialBinding(), home: _buildApp(context), diff --git a/lib/components/animate_loading.dart b/lib/components/animate_loading.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/components/isekai_text.dart b/lib/components/isekai_text.dart new file mode 100644 index 0000000..710d523 --- /dev/null +++ b/lib/components/isekai_text.dart @@ -0,0 +1,146 @@ +import 'package:flutter/cupertino.dart'; +import 'dart:ui' as ui show TextHeightBehavior; + +class IsekaiText extends StatelessWidget { + const IsekaiText( + this.data, { + super.key, + this.style, + this.strutStyle, + this.textAlign, + this.textDirection, + this.locale, + this.softWrap, + this.overflow, + this.textScaleFactor, + this.maxLines, + this.semanticsLabel, + this.textWidthBasis, + this.textHeightBehavior, + this.selectionColor, + }); + + /// The text to display. + /// + /// This will be null if a [textSpan] is provided instead. + final String data; + + /// If non-null, the style to use for this text. + /// + /// If the style's "inherit" property is true, the style will be merged with + /// the closest enclosing [DefaultTextStyle]. Otherwise, the style will + /// replace the closest enclosing [DefaultTextStyle]. + final TextStyle? style; + + /// {@macro flutter.painting.textPainter.strutStyle} + final StrutStyle? strutStyle; + + /// How the text should be aligned horizontally. + final TextAlign? textAlign; + + /// The directionality of the text. + /// + /// This decides how [textAlign] values like [TextAlign.start] and + /// [TextAlign.end] are interpreted. + /// + /// This is also used to disambiguate how to render bidirectional text. For + /// example, if the [data] is an English phrase followed by a Hebrew phrase, + /// in a [TextDirection.ltr] context the English phrase will be on the left + /// and the Hebrew phrase to its right, while in a [TextDirection.rtl] + /// context, the English phrase will be on the right and the Hebrew phrase on + /// its left. + /// + /// Defaults to the ambient [Directionality], if any. + final TextDirection? textDirection; + + /// Used to select a font when the same Unicode character can + /// be rendered differently, depending on the locale. + /// + /// It's rarely necessary to set this property. By default its value + /// is inherited from the enclosing app with `Localizations.localeOf(context)`. + /// + /// See [RenderParagraph.locale] for more information. + final Locale? locale; + + /// Whether the text should break at soft line breaks. + /// + /// If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. + final bool? softWrap; + + /// How visual overflow should be handled. + /// + /// If this is null [TextStyle.overflow] will be used, otherwise the value + /// from the nearest [DefaultTextStyle] ancestor will be used. + final TextOverflow? overflow; + + /// The number of font pixels for each logical pixel. + /// + /// For example, if the text scale factor is 1.5, text will be 50% larger than + /// the specified font size. + /// + /// The value given to the constructor as textScaleFactor. If null, will + /// use the [MediaQueryData.textScaleFactor] obtained from the ambient + /// [MediaQuery], or 1.0 if there is no [MediaQuery] in scope. + final double? textScaleFactor; + + /// An optional maximum number of lines for the text to span, wrapping if necessary. + /// If the text exceeds the given number of lines, it will be truncated according + /// to [overflow]. + /// + /// If this is 1, text will not wrap. Otherwise, text will be wrapped at the + /// edge of the box. + /// + /// If this is null, but there is an ambient [DefaultTextStyle] that specifies + /// an explicit number for its [DefaultTextStyle.maxLines], then the + /// [DefaultTextStyle] value will take precedence. You can use a [RichText] + /// widget directly to entirely override the [DefaultTextStyle]. + final int? maxLines; + + /// {@template flutter.widgets.Text.semanticsLabel} + /// An alternative semantics label for this text. + /// + /// If present, the semantics of this widget will contain this value instead + /// of the actual text. This will overwrite any of the semantics labels applied + /// directly to the [TextSpan]s. + /// + /// This is useful for replacing abbreviations or shorthands with the full + /// text value: + /// + /// ```dart + /// Text(r'$$', semanticsLabel: 'Double dollars') + /// ``` + /// {@endtemplate} + final String? semanticsLabel; + + /// {@macro flutter.painting.textPainter.textWidthBasis} + final TextWidthBasis? textWidthBasis; + + /// {@macro dart.ui.textHeightBehavior} + final ui.TextHeightBehavior? textHeightBehavior; + + /// The color to use when painting the selection. + final Color? selectionColor; + + @override + Widget build(BuildContext context) { + var strutStyleFixed = strutStyle; + if (style?.fontSize != null) {} + + return Text( + data, + style: style, + strutStyle: strutStyleFixed, + textAlign: textAlign, + textDirection: textDirection, + locale: locale, + softWrap: softWrap, + overflow: overflow, + textScaleFactor: textScaleFactor, + maxLines: maxLines, + semanticsLabel: semanticsLabel, + textWidthBasis: textWidthBasis, + textHeightBehavior: textHeightBehavior, + selectionColor: selectionColor, + ); + } +} diff --git a/lib/components/page_card.dart b/lib/components/page_card.dart index ba6a32b..706fdd4 100755 --- a/lib/components/page_card.dart +++ b/lib/components/page_card.dart @@ -115,7 +115,6 @@ class _PageCardState extends ReactiveState { @override void initState() { super.initState(); - Get.put(c); } @override diff --git a/lib/components/wikipage_parser.dart b/lib/components/wikipage_parser.dart index 0e81a8d..1c4850d 100644 --- a/lib/components/wikipage_parser.dart +++ b/lib/components/wikipage_parser.dart @@ -26,7 +26,7 @@ class WikiPageParserController extends GetxController { if (contentHtml.value.isNotEmpty) { webviewCotroller?.loadData( data: contentHtml.value, - baseUrl: Uri.parse(Global.wikiHomeUrl), + baseUrl: Uri.parse(Global.siteConfig.baseUrl), ); } }); @@ -45,12 +45,11 @@ class WikiPageParserController extends GetxController { webviewCotroller?.loadData( data: contentHtml.value, - baseUrl: Uri.parse(Global.wikiHomeUrl), + baseUrl: Uri.parse(Global.siteConfig.baseUrl), ); } void onPageCommitVisible(InAppWebViewController controller, Uri? uri) { - debugPrint("loaded"); controller.injectCSSCode(source: """ body { padding-top: ${safeAreaPadding.value.top}px; @@ -99,8 +98,7 @@ class _WikiParserState extends ReactiveState { void receiveProps() { c.contentHtml.value = widget.contentHtml ?? ""; c.safeAreaPadding.value = widget.padding ?? const EdgeInsets.all(0); - c.textZoom.value = - (MediaQuery.of(Get.context!).textScaleFactor * 100).round(); + c.textZoom.value = (MediaQuery.of(Get.context!).textScaleFactor * 100).round(); } Widget _buildRender() { @@ -156,7 +154,6 @@ class _WikiParserState extends ReactiveState { @override Widget build(BuildContext context) { var sc = Get.find(); - return Obx( - () => sc.betaPageRender.value ? _buildRender() : _buildWebview()); + return Obx(() => sc.betaPageRender.value ? _buildRender() : _buildWebview()); } } diff --git a/lib/global.dart b/lib/global.dart index f7efce9..ac7e77a 100755 --- a/lib/global.dart +++ b/lib/global.dart @@ -1,3 +1,4 @@ +import 'package:isekai_wiki/models/site_config.dart'; import 'package:package_info_plus/package_info_plus.dart'; typedef VoidFutureCallback = Future Function(); @@ -11,15 +12,9 @@ class Global { static const String privacyPolicyUrl = "https://www.isekai.cn/%E5%BC%82%E4%B8%96%E7%95%8C%E7%99%BE%E7%A7%91:%E9%9A%90%E7%A7%81%E6%94%BF%E7%AD%96"; - static const String siteConfigUrl = "https://www.isekai.cn/app/config.json"; + static const String siteConfigUrl = "https://www.isekai.cn/mugenapp/config.json"; - static const String wikiApiUrl = "https://www.isekai.cn/api.php"; - - static String wikiHomeUrl = "https://www.isekai.cn/"; - - static String restfulApiUrl = "https://www.isekai.cn/api/rest_v1"; - - static String pageUrl = "https://www.isekai.cn/{{title}}"; + static SiteConfig siteConfig = SiteConfig(); static const String renderThemeFallback = "vector"; diff --git a/lib/main.dart b/lib/main.dart index a56af6e..93979f3 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,6 +7,7 @@ import 'package:get/get.dart'; import 'package:get_storage/get_storage.dart'; import 'package:isekai_wiki/global.dart'; import 'package:isekai_wiki/models/lifecycle.dart'; +import 'package:isekai_wiki/models/site_config.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'app.dart'; @@ -61,10 +62,11 @@ Future postInit() async { } Future main() async { - Get.put(LifeCycleController()); - await init(); + Get.put(LifeCycleController()); + Get.put(SiteConfigController()); + runApp(const IsekaiWikiApp()); postInit(); diff --git a/lib/models/lifecycle.dart b/lib/models/lifecycle.dart index 114daf6..6eac6c6 100644 --- a/lib/models/lifecycle.dart +++ b/lib/models/lifecycle.dart @@ -1,6 +1,6 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/widgets.dart'; import 'package:get/get.dart'; +import 'package:isekai_wiki/global.dart'; import 'package:isekai_wiki/models/user.dart'; class LifeCycleController extends SuperController { @@ -11,15 +11,21 @@ class LifeCycleController extends SuperController { void onInactive() {} @override - void onPaused() { - debugPrint("onPause"); - } + void onPaused() {} @override void onResumed() { - debugPrint("onResume"); - var uc = Get.find(); + if (Global.isAppActive) { + try { + var uc = Get.find(); - uc.attemptFinishAuth(); + uc.attemptFinishAuth(); + } catch (err, stack) { + if (kDebugMode) { + print("error on attemptFinishAuth: $err"); + stack.printError(); + } + } + } } } diff --git a/lib/models/site_config.dart b/lib/models/site_config.dart index 3cd48aa..47736a2 100644 --- a/lib/models/site_config.dart +++ b/lib/models/site_config.dart @@ -16,26 +16,58 @@ class SiteConfig { List moduleScripts; String renderTheme; + String baseUrl; + String indexUrl; + String apiUrl; + String resourceLoaderUrl; + String restfulApiUrl; + String pageUrlTemplate; + SiteConfig({ this.moduleStyles = const [], this.moduleScripts = const [], this.renderTheme = Global.renderThemeFallback, + this.baseUrl = "", + this.indexUrl = "", + this.apiUrl = "", + this.resourceLoaderUrl = "", + this.restfulApiUrl = "", + this.pageUrlTemplate = "", }); - factory SiteConfig.fromJson(Map json) => - _$SiteConfigFromJson(json); + factory SiteConfig.fromJson(Map json) => _$SiteConfigFromJson(json); Map toJson() => _$SiteConfigToJson(this); + + void fillUrl() { + if (indexUrl.isEmpty) { + indexUrl = "$baseUrl/index.php"; + } + + if (apiUrl.isEmpty) { + apiUrl = "$baseUrl/api.php"; + } + + if (resourceLoaderUrl.isEmpty) { + resourceLoaderUrl = "$baseUrl/load.php"; + } + + if (pageUrlTemplate.isEmpty) { + pageUrlTemplate = "$baseUrl/index.php?title={{title}}"; + } + } + + bool get restfulApiAvailable { + return restfulApiUrl.isNotEmpty; + } } -class AppSettingsController extends GetxController { +class SiteConfigController extends GetxController { bool _ignoreSave = false; bool isAppActive = false; - List moduleStyles = []; - List moduleScripts = []; - String renderTheme = Global.renderThemeFallback; + var config = Rx(SiteConfig()); @override void onInit() { @@ -85,21 +117,16 @@ class AppSettingsController extends GetxController { final storage = GetStorage(); - var siteConfigData = SiteConfig( - moduleScripts: moduleScripts, - moduleStyles: moduleStyles, - renderTheme: renderTheme, - ); - - var siteConfigJson = jsonEncode(siteConfigData.toJson()); + var siteConfigJson = jsonEncode(config.value); storage.write("siteConfigCache", siteConfigJson); + + storage.write("appActive", isAppActive); } void loadFromEntity(SiteConfig siteConfigData) { - moduleScripts = siteConfigData.moduleScripts; - moduleStyles = siteConfigData.moduleStyles; - renderTheme = siteConfigData.renderTheme; + config.value = siteConfigData; + Global.siteConfig = config.value; } Future loadFromRemote() async { @@ -108,5 +135,8 @@ class AppSettingsController extends GetxController { var siteConfigData = SiteConfig.fromJson(resMap); loadFromEntity(siteConfigData); + + isAppActive = true; + saveToStorage(); } } diff --git a/lib/pages/about.dart b/lib/pages/about.dart index 41e1087..8d5132a 100755 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -11,7 +11,7 @@ import '../styles.dart'; class AboutPageController extends GetxController { Future handleMainPageLinkClick() async { - openUrl(Global.wikiHomeUrl); + openUrl(Global.siteConfig.indexUrl); } } diff --git a/lib/pages/welcome_page.dart b/lib/pages/welcome_page.dart index 9fb48f8..c1f25f1 100644 --- a/lib/pages/welcome_page.dart +++ b/lib/pages/welcome_page.dart @@ -1,14 +1,19 @@ import 'dart:ui'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; import 'package:isekai_wiki/components/isekai_page_scaffold.dart'; import 'package:isekai_wiki/global.dart'; +import 'package:isekai_wiki/models/site_config.dart'; +import 'package:isekai_wiki/pages/tab_page.dart'; import 'package:isekai_wiki/utils/dialog.dart'; import 'package:roundcheckbox/roundcheckbox.dart'; +import '../utils/error.dart'; + class WelcomePageController extends GetxController { var isLoading = false.obs; @@ -17,11 +22,96 @@ class WelcomePageController extends GetxController { void handleClickPolicyLink() { openUrl(Global.privacyPolicyUrl, inApp: false); } + + Future handleClickContinue() async { + isLoading.value = true; + var siteConfig = Get.find(); + + try { + await showLoading(Get.overlayContext!, callback: () async { + await siteConfig.loadFromRemote(); + }); + + // 加载完成后跳转到首页 + Navigator.of(Get.context!).pushReplacement( + CupertinoPageRoute( + builder: (_) => const IsekaiWikiTabsPage(), + ), + ); + } catch (err, stack) { + alert(Get.overlayContext!, ErrorUtils.getErrorMessage(err), title: "错误"); + if (kDebugMode) { + print("Exception in logout: $err"); + stack.printError(); + } + } + isLoading.value = false; + } } class WelcomePage extends StatelessWidget { const WelcomePage({super.key}); + @override + Widget build(BuildContext context) { + var c = Get.put(WelcomePageController()); + + return AnnotatedRegion( + value: SystemUiOverlayStyle.light, + child: IsekaiPageScaffold( + backgroundColor: CupertinoColors.white, + child: Stack( + fit: StackFit.expand, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: ExactAssetImage('assets/images/title.png'), + fit: BoxFit.cover, + ), + ), + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + decoration: BoxDecoration(color: Colors.black.withOpacity(0.4)), + ), + ), + ), + SafeArea( + child: OrientationBuilder( + builder: (context, orientation) => Padding( + padding: orientation == Orientation.portrait + ? const EdgeInsets.only(top: 48, right: 20, bottom: 32, left: 20) + : const EdgeInsets.symmetric(horizontal: 20, vertical: 32), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + flex: 0, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 8), + child: _buildSiteTitle(context, c), + ), + ), + ], + ), + const SizedBox(height: 36), + _buildActions(context, c), + ], + ), + ), + ), + ), + ], + ), + ), + ); + } + Widget _buildSiteTitle(BuildContext context, WelcomePageController c) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -30,8 +120,7 @@ class WelcomePage extends StatelessWidget { data: MediaQueryData(textScaleFactor: 1), child: Text( Global.siteTitle, - style: TextStyle( - fontSize: 48, color: Colors.white, fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 48, color: Colors.white, fontWeight: FontWeight.bold), ), ), Text( @@ -44,6 +133,7 @@ class WelcomePage extends StatelessWidget { Widget _buildActions(BuildContext context, WelcomePageController c) { var theme = CupertinoTheme.of(context); + var scaleFactor = MediaQuery.of(context).textScaleFactor; return Column( crossAxisAlignment: CrossAxisAlignment.stretch, @@ -57,13 +147,18 @@ class WelcomePage extends StatelessWidget { children: [ Obx( () => RoundCheckBox( - size: 24, + size: 24 * scaleFactor, isChecked: c.policyAccepted.value, + animationDuration: Duration.zero, + checkedColor: theme.primaryColor, + checkedWidget: Icon( + Icons.check, + color: Colors.white, + size: 18 * scaleFactor, + ), onTap: (checked) { c.policyAccepted.value = checked ?? false; }, - animationDuration: Duration.zero, - checkedColor: theme.primaryColor, ), ), const SizedBox( @@ -90,82 +185,11 @@ class WelcomePage extends StatelessWidget { Obx( () => CupertinoButton.filled( disabledColor: theme.primaryColor.withOpacity(0.6), - onPressed: c.policyAccepted.value && !c.isLoading.value - ? () { - c.isLoading.value = true; - Future.delayed(const Duration(seconds: 5)).then((value) { - c.isLoading.value = false; - }); - } - : null, + onPressed: c.policyAccepted.value && !c.isLoading.value ? c.handleClickContinue : null, child: const Text("继续"), ), ), ], ); } - - @override - Widget build(BuildContext context) { - var c = Get.put(WelcomePageController()); - - return AnnotatedRegion( - value: SystemUiOverlayStyle.light, - child: IsekaiPageScaffold( - backgroundColor: CupertinoColors.white, - child: Stack( - fit: StackFit.expand, - children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: ExactAssetImage('images/title.png'), - fit: BoxFit.cover, - ), - ), - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - decoration: - BoxDecoration(color: Colors.black.withOpacity(0.4)), - ), - ), - ), - SafeArea( - child: OrientationBuilder( - builder: (context, orientation) => Padding( - padding: orientation == Orientation.portrait - ? const EdgeInsets.only( - top: 32, right: 20, bottom: 32, left: 20) - : const EdgeInsets.symmetric( - horizontal: 20, vertical: 32), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - flex: 0, - child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 24, horizontal: 8), - child: _buildSiteTitle(context, c), - ), - ), - ], - ), - const SizedBox(height: 36), - _buildActions(context, c), - ], - ), - ), - ), - ), - ], - ), - ), - ); - } } diff --git a/lib/styles.dart b/lib/styles.dart index 73e9cd8..408a256 100755 --- a/lib/styles.dart +++ b/lib/styles.dart @@ -6,24 +6,25 @@ abstract class Styles { static bool isXs = false; + static const double defaultFontSize = 16; + static const CupertinoTextThemeData defaultTextTheme = CupertinoTextThemeData( textStyle: TextStyle( - fontSize: 16, + fontSize: defaultFontSize, fontFamilyFallback: [ "PingFang SC", + "Heiti SC", "Noto Sans SC", - "Hei", "Microsoft YaHei", + "Hei", "SimHei", ], + color: CupertinoColors.label, ), ); static const TextStyle navLargeTitleTextStyle = TextStyle( - fontWeight: FontWeight.normal, - fontSize: 32, - color: CupertinoColors.label, - inherit: false); + fontWeight: FontWeight.normal, fontSize: 32, color: CupertinoColors.label, inherit: false); static const TextStyle productRowItemName = TextStyle( color: Color.fromRGBO(0, 0, 0, 0.8), @@ -61,13 +62,14 @@ abstract class Styles { static const TextStyle listTileLargeTitle = TextStyle(fontSize: 18); static const TextStyle listTileSubTitle = TextStyle(fontSize: 16); + static const TextStyle loadingDialogTitle = TextStyle(fontSize: 18, fontWeight: FontWeight.w500); + static const Color websiteNavbarColor = Color.fromRGBO(33, 37, 41, 1); static const Color themeMainColor = Color.fromRGBO(65, 147, 135, 1); static const Color themeNavTitleColor = Color.fromRGBO(255, 255, 255, 1); static const Color themeBottomColor = Color.fromRGBO(255, 255, 255, 1); - static const Color themePageBackgroundColor = - Color.fromRGBO(240, 240, 240, 1); + static const Color themePageBackgroundColor = Color.fromRGBO(240, 240, 240, 1); static const Color themeNavSegmentTextColor = Color.fromRGBO(12, 12, 12, 1); static const Color panelBackgroundColor = Color.fromRGBO(255, 255, 255, 1); static const Color linkColor = CupertinoColors.link; diff --git a/lib/utils/dialog.dart b/lib/utils/dialog.dart index e51f643..a2e08be 100644 --- a/lib/utils/dialog.dart +++ b/lib/utils/dialog.dart @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_web_browser/flutter_web_browser.dart'; import 'package:get/get.dart'; +import 'package:isekai_wiki/global.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart'; @@ -33,10 +34,7 @@ Future alert(BuildContext context, String content, {String? title}) { } Future confirm(BuildContext context, String content, - {String? title, - String? positiveText, - String? negativeText, - bool isDanger = false}) { + {String? title, String? positiveText, String? negativeText, bool isDanger = false}) { var c = Completer(); positiveText ??= "好"; @@ -94,3 +92,30 @@ Future openUrl(String url, {bool inApp = false}) async { // 其他平台直接调用浏览器打开 launchUrlString(url, mode: LaunchMode.externalApplication); } + +Future showLoading(BuildContext context, + {String? title, required VoidFutureCallback callback}) async { + title ??= "加载中"; + + showCupertinoDialog( + context: context, + builder: (context) => CupertinoAlertDialog( + title: Row( + children: [ + const CupertinoActivityIndicator(radius: 14), + const SizedBox(width: 20), + Text(title!), + ], + ), + actions: const [], + ), + ); + try { + var ret = await callback.call(); + Navigator.of(Get.context!).pop(); + return ret; + } catch (_) { + Navigator.of(Get.context!).pop(); + rethrow; + } +} diff --git a/pubspec.lock b/pubspec.lock index 90ce386..7a4bd1d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,280 +5,280 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "50.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.2.0" animations: dependency: "direct main" description: name: animations - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.7" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" async: dependency: "direct main" description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.9.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.3" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "7.2.7" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "8.4.2" + version: "8.4.3" cached_network_image: dependency: "direct main" description: name: cached_network_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.3" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" chewie: dependency: transitive description: name: chewie - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.6" chewie_audio: dependency: transitive description: name: chewie_audio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.4.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.16.0" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" cookie_jar: dependency: transitive description: name: cookie_jar - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" cupertino_lists: dependency: "direct main" description: name: cupertino_lists - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.4" dio: dependency: "direct main" description: name: dio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.6" dio_cache_interceptor: dependency: "direct main" description: name: dio_cache_interceptor - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.1" dio_cookie_manager: dependency: "direct main" description: name: dio_cookie_manager - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" dio_http2_adapter: dependency: "direct main" description: name: dio_http2_adapter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" equatable: dependency: transitive description: name: equatable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.4" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" flutter: @@ -290,56 +290,56 @@ packages: dependency: transitive description: name: flutter_blurhash - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.0" flutter_displaymode: dependency: "direct main" description: name: flutter_displaymode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.2" flutter_hooks: dependency: transitive description: name: flutter_hooks - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.18.5+1" flutter_html: dependency: "direct main" description: name: flutter_html - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" flutter_inappwebview: dependency: "direct main" description: name: flutter_inappwebview - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.7.2+3" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.6" flutter_lints: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" flutter_localizations: @@ -351,21 +351,21 @@ packages: dependency: transitive description: name: flutter_math_fork - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.0" flutter_scale_tap: dependency: "direct main" description: name: flutter_scale_tap - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" flutter_svg: dependency: transitive description: name: flutter_svg - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.23.0+1" flutter_test: @@ -377,7 +377,7 @@ packages: dependency: "direct main" description: name: flutter_web_browser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.1" flutter_web_plugins: @@ -389,413 +389,413 @@ packages: dependency: "direct dev" description: name: freezed - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" freezed_annotation: dependency: "direct main" description: name: freezed_annotation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.0" get: dependency: "direct main" description: name: get - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.6.5" get_storage: dependency: "direct main" description: name: get_storage - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.1" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.5" http2: dependency: "direct main" description: name: http2 - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.2" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.4" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.7.0" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.5.4" like_button: dependency: "direct main" description: name: like_button - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.1.5" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.3" + version: "1.0.4" modal_bottom_sheet: dependency: "direct main" description: name: modal_bottom_sheet - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" numerus: dependency: transitive description: name: numerus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" octo_image: dependency: transitive description: name: octo_image - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.2" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.1+1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.11" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.22" path_provider_ios: dependency: transitive description: name: path_provider_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.11" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.7" path_provider_macos: dependency: transitive description: name: path_provider_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.6" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.3" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.1" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.3" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.1" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.5" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.3" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" pull_down_button: dependency: "direct main" description: name: pull_down_button - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.1" quiver: dependency: transitive description: name: quiver - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" responsive_builder: dependency: "direct main" description: name: responsive_builder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.3" roundcheckbox: dependency: "direct main" description: name: roundcheckbox - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" ruby_text: dependency: "direct main" description: name: ruby_text - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" rxdart: dependency: transitive description: name: rxdart - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.27.7" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" skeletons: dependency: "direct main" description: name: skeletons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.0.3" sky_engine: @@ -807,322 +807,322 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.6" source_helper: dependency: transitive description: name: source_helper - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.3" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.9.0" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.2" + version: "2.2.3" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.4.0+2" + version: "2.4.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.0+3" + version: "3.0.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.12" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" tuple: dependency: transitive description: name: tuple - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.7" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.22" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.17" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.13" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" uuid: dependency: transitive description: name: uuid - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.7" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" video_player: dependency: transitive description: name: video_player - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.10" video_player_android: dependency: transitive description: name: video_player_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.10" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.8" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.1" video_player_web: dependency: transitive description: name: video_player_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.13" wakelock: dependency: transitive description: name: wakelock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.2" wakelock_macos: dependency: transitive description: name: wakelock_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" wakelock_platform_interface: dependency: transitive description: name: wakelock_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" wakelock_web: dependency: transitive description: name: wakelock_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" wakelock_windows: dependency: transitive description: name: wakelock_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" web_smooth_scroll: dependency: "direct main" description: name: web_smooth_scroll - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.0" + version: "1.1.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.0" + version: "2.3.0" webview_flutter: dependency: transitive description: name: webview_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.8.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.10.4" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.9.5" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.9.5" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.3" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.0+3" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.4.1" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 212eb39..1a45b4a 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -99,7 +99,8 @@ flutter: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg assets: - - images/title.png + - assets/images/title.png + - assets/tpl/wikiPage.html # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware diff --git a/web/assets/images b/web/assets/images index 4edb05c..c21ac42 120000 --- a/web/assets/images +++ b/web/assets/images @@ -1 +1 @@ -/Users/hyperzlib/Projects/isekai_wiki_app/images \ No newline at end of file +D:/Users/hyperzlib/Projects/isekai_wiki_app/images \ No newline at end of file