更改欢迎页样式

main
落雨楓 2 years ago
parent 4b05175f9d
commit f5c9dd9720

@ -1,4 +1,8 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:isekai_wiki/components/isekai_page_scaffold.dart'; import 'package:isekai_wiki/components/isekai_page_scaffold.dart';
import 'package:isekai_wiki/global.dart'; import 'package:isekai_wiki/global.dart';
@ -18,15 +22,6 @@ class WelcomePageController extends GetxController {
class WelcomePage extends StatelessWidget { class WelcomePage extends StatelessWidget {
const WelcomePage({super.key}); 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) { Widget _buildSiteTitle(BuildContext context, WelcomePageController c) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -35,10 +30,14 @@ class WelcomePage extends StatelessWidget {
data: MediaQueryData(textScaleFactor: 1), data: MediaQueryData(textScaleFactor: 1),
child: Text( child: Text(
Global.siteTitle, Global.siteTitle,
style: TextStyle(fontSize: 48), style: TextStyle(
fontSize: 48, color: Colors.white, fontWeight: FontWeight.bold),
),
), ),
Text(
Global.siteDescription,
style: TextStyle(fontSize: 18, color: Colors.white),
), ),
Text(Global.siteDescription),
], ],
); );
} }
@ -58,7 +57,7 @@ class WelcomePage extends StatelessWidget {
children: [ children: [
Obx( Obx(
() => RoundCheckBox( () => RoundCheckBox(
size: 30, size: 24,
isChecked: c.policyAccepted.value, isChecked: c.policyAccepted.value,
onTap: (checked) { onTap: (checked) {
c.policyAccepted.value = checked ?? false; c.policyAccepted.value = checked ?? false;
@ -70,11 +69,17 @@ class WelcomePage extends StatelessWidget {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
const Text("已阅读并同意"), const Text(
"已阅读并同意",
style: TextStyle(color: Colors.white),
),
CupertinoButton( CupertinoButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: c.handleClickPolicyLink, onPressed: c.handleClickPolicyLink,
child: const Text("隐私政策"), child: const Text(
"隐私政策",
style: TextStyle(color: Colors.lightBlue),
),
) )
], ],
), ),
@ -104,35 +109,43 @@ class WelcomePage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
var c = Get.put(WelcomePageController()); var c = Get.put(WelcomePageController());
return IsekaiPageScaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
child: IsekaiPageScaffold(
backgroundColor: CupertinoColors.white, backgroundColor: CupertinoColors.white,
child: SafeArea( 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( child: OrientationBuilder(
builder: (context, orientation) => Padding( builder: (context, orientation) => Padding(
padding: orientation == Orientation.portrait padding: orientation == Orientation.portrait
? const EdgeInsets.only( ? const EdgeInsets.only(
top: 32, right: 20, bottom: 32, left: 20) top: 32, right: 20, bottom: 32, left: 20)
: const EdgeInsets.symmetric(horizontal: 20, vertical: 32), : const EdgeInsets.symmetric(
horizontal: 20, vertical: 32),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Flexible( Column(
child: orientation == Orientation.portrait
? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Flexible(
flex: 0, flex: 0,
child: Padding( child: Padding(
@ -142,28 +155,6 @@ class WelcomePage extends StatelessWidget {
), ),
), ),
], ],
)
: 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,
child: _buildSiteTitle(context, c),
),
],
),
), ),
const SizedBox(height: 36), const SizedBox(height: 36),
_buildActions(context, c), _buildActions(context, c),
@ -172,6 +163,9 @@ class WelcomePage extends StatelessWidget {
), ),
), ),
), ),
],
),
),
); );
} }
} }

@ -6,8 +6,18 @@ abstract class Styles {
static bool isXs = false; static bool isXs = false;
static const CupertinoTextThemeData defaultTextTheme = static const CupertinoTextThemeData defaultTextTheme = CupertinoTextThemeData(
CupertinoTextThemeData(); textStyle: TextStyle(
fontSize: 16,
fontFamilyFallback: [
"PingFang SC",
"Noto Sans SC",
"Hei",
"Microsoft YaHei",
"SimHei",
],
),
);
static const TextStyle navLargeTitleTextStyle = TextStyle( static const TextStyle navLargeTitleTextStyle = TextStyle(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,

Loading…
Cancel
Save