From f5c9dd9720fc6c0cb1ff507f10ba0d616a547686 Mon Sep 17 00:00:00 2001 From: Lex Lim Date: Sun, 15 Jan 2023 20:53:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=AC=A2=E8=BF=8E=E9=A1=B5?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/welcome_page.dart | 146 +++++++++++++++++------------------- lib/styles.dart | 14 +++- 2 files changed, 82 insertions(+), 78 deletions(-) diff --git a/lib/pages/welcome_page.dart b/lib/pages/welcome_page.dart index e792556..9fb48f8 100644 --- a/lib/pages/welcome_page.dart +++ b/lib/pages/welcome_page.dart @@ -1,4 +1,8 @@ +import 'dart:ui'; + import 'package:flutter/cupertino.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'; @@ -18,15 +22,6 @@ class WelcomePageController extends GetxController { class WelcomePage extends StatelessWidget { const WelcomePage({super.key}); - Widget _buildTitleImage(BuildContext context, WelcomePageController c) { - return Center( - child: ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(10)), - child: Image.asset("images/title.png"), - ), - ); - } - Widget _buildSiteTitle(BuildContext context, WelcomePageController c) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -35,10 +30,14 @@ class WelcomePage extends StatelessWidget { data: MediaQueryData(textScaleFactor: 1), child: Text( Global.siteTitle, - style: TextStyle(fontSize: 48), + style: TextStyle( + fontSize: 48, color: Colors.white, fontWeight: FontWeight.bold), ), ), - Text(Global.siteDescription), + Text( + Global.siteDescription, + style: TextStyle(fontSize: 18, color: Colors.white), + ), ], ); } @@ -58,7 +57,7 @@ class WelcomePage extends StatelessWidget { children: [ Obx( () => RoundCheckBox( - size: 30, + size: 24, isChecked: c.policyAccepted.value, onTap: (checked) { c.policyAccepted.value = checked ?? false; @@ -70,11 +69,17 @@ class WelcomePage extends StatelessWidget { const SizedBox( width: 10, ), - const Text("已阅读并同意"), + const Text( + "已阅读并同意", + style: TextStyle(color: Colors.white), + ), CupertinoButton( padding: EdgeInsets.zero, onPressed: c.handleClickPolicyLink, - child: const Text("隐私政策"), + child: const Text( + "隐私政策", + style: TextStyle(color: Colors.lightBlue), + ), ) ], ), @@ -104,72 +109,61 @@ class WelcomePage extends StatelessWidget { Widget build(BuildContext context) { var c = Get.put(WelcomePageController()); - return IsekaiPageScaffold( - backgroundColor: CupertinoColors.white, - child: 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: [ - Flexible( - child: orientation == Orientation.portrait - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Flexible( - flex: 1, - child: ConstrainedBox( - constraints: BoxConstraints( - maxHeight: - MediaQuery.of(context).size.width * - 0.75), - child: _buildTitleImage(context, c), - ), - ), - const SizedBox(height: 12), - Flexible( - flex: 0, - child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 24, horizontal: 8), - child: _buildSiteTitle(context, c), - ), - ), - ], - ) - : Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Flexible( - flex: 1, - child: ConstrainedBox( - constraints: BoxConstraints( - maxHeight: - MediaQuery.of(context).size.width * - 9 / - 16), - child: _buildTitleImage(context, c), - ), - ), - const SizedBox(width: 48), - Flexible( - flex: 1, + 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), + ], + ), ), - const SizedBox(height: 36), - _buildActions(context, c), - ], + ), ), - ), + ], ), ), ); diff --git a/lib/styles.dart b/lib/styles.dart index cf78fdd..73e9cd8 100755 --- a/lib/styles.dart +++ b/lib/styles.dart @@ -6,8 +6,18 @@ abstract class Styles { static bool isXs = false; - static const CupertinoTextThemeData defaultTextTheme = - CupertinoTextThemeData(); + static const CupertinoTextThemeData defaultTextTheme = CupertinoTextThemeData( + textStyle: TextStyle( + fontSize: 16, + fontFamilyFallback: [ + "PingFang SC", + "Noto Sans SC", + "Hei", + "Microsoft YaHei", + "SimHei", + ], + ), + ); static const TextStyle navLargeTitleTextStyle = TextStyle( fontWeight: FontWeight.normal,