reason

页面样式优化

287 KB | W: | H:

888 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
......@@ -6,10 +6,13 @@ import 'package:one_poem/poem/widgets/poem_content.dart';
import 'package:one_poem/poem/widgets/poem_user_audio.dart';
import 'package:one_poem/poem/widgets/poem_user_comments.dart';
import 'package:one_poem/res/gaps.dart';
import 'package:one_poem/routers/fluro_navigator.dart';
import 'package:one_poem/widgets/bars/home_action_bar.dart';
import 'package:one_poem/widgets/bars/home_menu_bar.dart';
import 'package:one_poem/widgets/my_app_bar.dart';
import '../poem_router.dart';
enum PoemContentSwitch {
audio,
comment,
......@@ -49,6 +52,9 @@ class _PoemDetailPageState extends State<PoemDetailPage> {
contentSwitch = PoemContentSwitch.comment;
setState(() {});
},
funcRight: (){
NavigatorUtils.push(context, '${PoemRouter.poemRecordAudioPage}?id=100');
},
),
homeActionWidgets: HomeActionWidgets(
funcStar: () {
......
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:one_poem/poem/widgets/poem_content.dart';
import 'package:one_poem/res/resources.dart';
import 'package:one_poem/widgets/bars/home_action_bar.dart';
import 'package:one_poem/widgets/bars/home_menu_bar.dart';
import 'package:one_poem/widgets/my_app_bar.dart';
class PoemRecordAudioPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => _PoemRecordAudioPageState();
const PoemRecordAudioPage({
Key? key,
required this.poemId,
this.poemPanelHeight = 0,
}) : super(key: key);
final int poemPanelHeight;
final int poemId;
}
class _PoemRecordAudioPageState extends State<PoemRecordAudioPage> {
@override
Widget build(BuildContext context) {
const poemStr =
"qīng chén rù gǔ sì\n清晨入古寺,\nchū rì zhào gāo lín\n初日照高林。\nzhú jìng tōng yōu chù\n竹径通幽处,\nchán fáng huā mù shēn\n禅房花木深。\nshān guāng yuè niǎo xìng\n山光悦鸟性,\ntán yǐng kōng rén xīn\n潭影空人心。\nwàn lài cǐ dōu jì\n万籁此都寂,\ndàn yú zhōng qìng yīn\n但余钟磬音。";
return Scaffold(
appBar: MyAppBar(
isBack: true,
isTransparent: false,
homeMenuHeader: HomeMenuHeader(
funcLeft: () {
setState(() {});
},
funcCenter: () {
setState(() {});
},
funcRight: () {},
),
homeActionWidgets: HomeActionWidgets(
funcStar: () {
print("starrrrrrr");
},
),
),
body: Container(
alignment: Alignment.topCenter,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/poem/poem_background.png"),
fit: BoxFit.fill,
),
),
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: const EdgeInsets.symmetric(
vertical: 30.0, horizontal: 20.0),
height: MediaQuery.of(context).size.height -
140 -
widget.poemPanelHeight,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.shade200.withOpacity(0.1),
border: Border.all(
color: Colors.grey.shade50, width: 0.5), // 边色与边宽度
),
child: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: 10.0,
sigmaY: 10.0,
),
child: Container(
decoration: BoxDecoration(
color: Colors.grey.shade200.withOpacity(0.1),
),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Flex(
direction: Axis.vertical,
children: [
const PoemContent(
title: "题破山寺后禅院",
author: "常建",
poemStr: poemStr,
fontSize: 22.0,
),
Stack(
alignment: Alignment.center,
children: [
Positioned(
left: 10.0,
child: IconButton(
icon: const Icon(
Icons.camera_alt_outlined,
size: 28.0,
),
onPressed: () {},
),
),
SizedBox(
width: double.infinity,
height: 90.0,
child: IconButton(
icon: const Icon(
Icons.mic_none,
size: 70.0,
color: Colors.green,
),
onPressed: () {},
),
),
],
),
],
),
),
),
),
),
),
],
),
),
),
);
}
}
import 'package:fluro/fluro.dart';
import 'package:one_poem/poem/page/poem_record_audio.dart';
import 'package:one_poem/routers/i_router.dart';
import 'page/poem_detail.dart';
import 'page/poem_page.dart';
class PoemRouter implements IRouterProvider {
static String poemPage = '/poem';
static String poemDetailPage = '/detail';
static String poemRecordAudioPage = '/poem_record_audio';
@override
void initRouter(FluroRouter router) {
......@@ -19,5 +20,12 @@ class PoemRouter implements IRouterProvider {
poemId: int.parse(id!),
);
}));
router.define(poemRecordAudioPage,
handler: Handler(handlerFunc: (_, Map<String, List<String>> params) {
String? id = params['id']?.first;
return PoemRecordAudioPage(
poemId: int.parse(id!),
);
}));
}
}
......
......@@ -8,11 +8,13 @@ class PoemContent extends StatelessWidget {
required this.poemStr,
required this.title,
required this.author,
this.fontSize = 24,
}) : super(key: key);
final String poemStr;
final String title;
final String author;
final double fontSize;
@override
Widget build(BuildContext context) {
return Column(
......@@ -25,7 +27,7 @@ class PoemContent extends StatelessWidget {
color: Colors.black54,
),
),
Gaps.vGap16,
Gaps.vGap10,
Text(
author,
style: const TextStyle(
......@@ -33,7 +35,7 @@ class PoemContent extends StatelessWidget {
color: Colors.black54,
),
),
Gaps.vGap12,
Gaps.vGap5,
Stack(
alignment: Alignment.center,
children: [
......@@ -51,15 +53,15 @@ class PoemContent extends StatelessWidget {
// ),
Text(
poemStr,
style: const TextStyle(
style: TextStyle(
color: Colors.black54,
fontFamily: "ZCOOLXiaoWei",
fontSize: 24.0,
fontSize: fontSize,
),
),
],
),
Gaps.vGap24,
Gaps.vGap10,
],
);
}
......
......@@ -20,7 +20,7 @@ class PoemUserAudio extends StatelessWidget {
ListTile(
title: Text(
desc ?? "一大波用户朗读录制提交了“临境”",
style: const TextStyle(color: Colors.white, fontSize: 15.0),
style: const TextStyle(color: Colors.black54, fontSize: 15.0),
),
),
SizedBox(
......@@ -35,11 +35,11 @@ class PoemUserAudio extends StatelessWidget {
Icon(
Icons.play_circle_outline,
size: 16.0,
color: Colors.white,
color: Colors.black45,
),
Text(
"普通话",
style: TextStyle(color: Colors.white, fontSize: 16.0),
style: TextStyle(color: Colors.black45, fontSize: 16.0),
)
],
);
......