reason

U

......@@ -147,7 +147,7 @@ class _AccountPageState extends State<AccountPage> {
],
);
return Scaffold(
appBar: const MyAppBar(
appBar: MyAppBar(
),
body: Container(
decoration: const BoxDecoration(
......
......@@ -43,7 +43,7 @@ class _CategoriesPageState extends State<CategoriesPage>
return ChangeNotifierProvider<CategoriesPageProvider>(
create: (_) => provider,
child: Scaffold(
appBar: const MyAppBar(
appBar: MyAppBar(
),
body: Column(
key: _bodyKey,
......
......@@ -53,8 +53,8 @@ class _WebViewPageState extends State<WebViewPage> {
return Future.value(true);
},
child: Scaffold(
appBar: MyAppBar(
centerTitle: widget.title,
appBar: const MyAppBar(
),
body: Stack(
children: [
......
......@@ -84,7 +84,6 @@ class _LoginPageState extends State<LoginPage> with ChangeNotifierMixin<LoginPag
return Scaffold(
appBar: MyAppBar(
isBack: false,
actionName: OnePoemLocalizations.of(context).verificationCodeLogin,
onPressed: () {
NavigatorUtils.push(context, LoginRouter.smsLoginPage);
},
......
......@@ -73,8 +73,7 @@ class _RegisterPageState extends State<RegisterPage> with ChangeNotifierMixin<Re
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: OnePoemLocalizations.of(context).register,
appBar: const MyAppBar(
),
body: MyScrollView(
keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]),
......
......@@ -70,8 +70,7 @@ class _ResetPasswordPageState extends State<ResetPasswordPage> with ChangeNotifi
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: OnePoemLocalizations.of(context).forgotPasswordLink,
appBar: const MyAppBar(
),
body: MyScrollView(
keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2, _nodeText3]),
......
......@@ -65,7 +65,7 @@ class _SMSLoginPageState extends State<SMSLoginPage> with ChangeNotifierMixin<SM
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(),
appBar: MyAppBar(),
body: MyScrollView(
keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2]),
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 20.0),
......
......@@ -64,7 +64,6 @@ class _UpdatePasswordPageState extends State<UpdatePasswordPage> with ChangeNoti
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(
title: '修改密码',
),
body: MyScrollView(
keyboardConfig: Utils.getKeyboardActionsConfig(context, <FocusNode>[_nodeText1, _nodeText2]),
......
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:one_poem/res/gaps.dart';
import 'package:one_poem/util/theme_utils.dart';
import 'package:one_poem/util/toast_utils.dart';
import 'package:one_poem/widgets/bars/home_action_bar.dart';
import 'package:one_poem/widgets/bars/home_title_bar.dart';
import 'package:one_poem/widgets/load_image.dart';
import 'package:one_poem/widgets/my_app_bar.dart';
......@@ -24,36 +28,130 @@ class _PoemDetailPageState extends State<PoemDetailPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
// extendBodyBehindAppBar: true,// appbar背景透明
appBar: MyAppBar(
isShowButtons: true,
funcLeft: () {
print("xxxxx");
},
isTransparent: false,
homeTitleHeader: HomeTitleHeader(
funcLeft: () {
print("lefltlelfle");
},
),
homeActionWidgets: HomeActionWidgets(
funcStar: () {
print("starrrrrrr");
},
),
),
body: Container(
alignment: Alignment.topCenter,
decoration: const BoxDecoration(
color: Colors.black,
image: DecorationImage(
image: AssetImage("assets/images/poem/poem_background.png"),
fit: BoxFit.fill,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [
Text("题破山寺后禅院"),
Gaps.vGap24,
Text("常建"),
Text("清晨入古寺,初日照高林。"),
Text("竹径通幽处,禅房花木深。"),
Text("山光悦鸟性,潭影空人心。"),
Text("万籁此都寂,但余钟磬音。"),
Gaps.vGap24,
Text("100位用户朗读拍摄提交了“临境”"),
],
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: const EdgeInsets.symmetric(
vertical: 40.0, horizontal: 25.0),
height: 240.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.shade200.withOpacity(0.1),
border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度
borderRadius: BorderRadius.circular(2.0),
),
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: Column(
children: const [
Text(
"题破山寺后禅院",
style: TextStyle(
fontSize: 24.0,
color: Colors.white,
),
),
Gaps.vGap16,
Text(
"常建",
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
),
),
Gaps.vGap12,
Text(
"清晨入古寺,初日照高林。\n竹径通幽处,禅房花木深。\n山光悦鸟性,潭影空人心。\n万籁此都寂,但余钟磬音。",
style: TextStyle(
color: Colors.white,
fontFamily: "ZCOOLXiaoWei",
fontSize: 24.0),
),
],
),
),
),
),
),
),
const Padding(
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0),
child: Text(
"100位用户朗读录制提交了“临境”",
style: TextStyle(color: Colors.black, fontSize: 16.0),
),
),
Container(
padding: const EdgeInsets.symmetric(
vertical: 10.0, horizontal: 25.0),
width: 400.0,
height: 160.0,
child: ListView.builder(
itemBuilder: (BuildContext context, int index) {
return Wrap(
spacing: 5.0,
crossAxisAlignment: WrapCrossAlignment.center,
children: const [
Icon(
Icons.play_circle_outline,
size: 16.0,
),
Text(
"普通话",
style: TextStyle(color: Colors.white, fontSize: 16.0),
)
],
);
}),
),
Row(
children: [
IconButton(
icon: const Icon(Icons.mic_none),
onPressed: () {},
),
IconButton(
icon: const Icon(Icons.camera_alt_outlined),
onPressed: () {},
)
],
),
],
),
),
alignment: Alignment.topLeft,
),
);
}
......
......@@ -10,6 +10,7 @@ import 'package:one_poem/tiktok/widgets/tiktok_video.dart';
import 'package:one_poem/tiktok/widgets/tiktok_video_button_column.dart';
import 'package:one_poem/tiktok/widgets/tiktok_video_poem.dart';
import 'package:one_poem/util/toast_utils.dart';
import 'package:one_poem/widgets/bars/home_action_bar.dart';
import 'package:one_poem/widgets/my_app_bar.dart';
import 'package:video_player/video_player.dart';
......@@ -107,6 +108,12 @@ class _PoemPageState extends State<PoemPage> with WidgetsBindingObserver {
controller: tkController,
header: MyAppBar(
isBack: false,
isTransparent: true,
homeActionWidgets: HomeActionWidgets(
funcStar: () {
print("starrrrrrr");
},
),
),
leftPage: searchPage,
rightPage: detailPage,
......
......@@ -10,7 +10,6 @@ class NotFoundPage extends StatelessWidget {
Widget build(BuildContext context) {
return const Scaffold(
appBar: MyAppBar(
centerTitle: '页面不存在',
),
body: StateLayout(
type: StateType.account,
......
......@@ -69,7 +69,6 @@ class _AboutPageState extends State<AboutPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(
title: '关于我们',
),
body: Column(
children: <Widget>[
......
......@@ -5,10 +5,8 @@ import 'package:one_poem/widgets/click_item.dart';
import 'package:one_poem/widgets/load_image.dart';
import 'package:one_poem/widgets/my_app_bar.dart';
/// design/8设置/index.html#artboard1
class AccountManagerPage extends StatefulWidget {
const AccountManagerPage({Key? key}) : super(key: key);
@override
......@@ -19,16 +17,12 @@ class _AccountManagerPageState extends State<AccountManagerPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(
),
appBar: MyAppBar(),
body: Column(
children: <Widget>[
Stack(
children: <Widget>[
ClickItem(
title: '店铺logo',
onTap: () {}
),
ClickItem(title: '店铺logo', onTap: () {}),
const Positioned(
top: 8.0,
bottom: 8.0,
......@@ -38,10 +32,10 @@ class _AccountManagerPageState extends State<AccountManagerPage> {
],
),
ClickItem(
title: '修改密码',
content: '用于密码登录',
onTap: () => NavigatorUtils.push(context, LoginRouter.updatePasswordPage)
),
title: '修改密码',
content: '用于密码登录',
onTap: () =>
NavigatorUtils.push(context, LoginRouter.updatePasswordPage)),
const ClickItem(
title: '绑定账号',
content: '15000000000',
......
......@@ -7,7 +7,6 @@ import 'package:one_poem/widgets/my_app_bar.dart';
import 'package:provider/provider.dart';
class LocalePage extends StatefulWidget {
const LocalePage({Key? key}) : super(key: key);
@override
......@@ -15,14 +14,13 @@ class LocalePage extends StatefulWidget {
}
class _LocalePageState extends State<LocalePage> {
final List<String> _list = <String>['跟随系统', '中文', 'English'];
@override
Widget build(BuildContext context) {
final String? locale = SpUtil.getString(Constant.locale);
String localeMode;
switch(locale) {
switch (locale) {
case 'zh':
localeMode = _list[1];
break;
......@@ -35,7 +33,6 @@ class _LocalePageState extends State<LocalePage> {
}
return Scaffold(
appBar: const MyAppBar(
title: '多语言',
),
body: ListView.separated(
itemCount: _list.length,
......@@ -43,7 +40,8 @@ class _LocalePageState extends State<LocalePage> {
itemBuilder: (_, int index) {
return InkWell(
onTap: () {
final String locale = index == 0 ? '' : (index == 1 ? 'zh' : 'en');
final String locale =
index == 0 ? '' : (index == 1 ? 'zh' : 'en');
context.read<LocaleProvider>().setLocale(locale);
Toast.show('当前功能仅登录模块有效');
setState(() {});
......
......@@ -25,8 +25,7 @@ class _SettingPageState extends State<SettingPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(
centerTitle: '设置',
appBar: const MyAppBar(
),
body: Column(
children: <Widget>[
......
......@@ -6,7 +6,6 @@ import 'package:one_poem/widgets/my_app_bar.dart';
import 'package:provider/provider.dart';
class ThemePage extends StatefulWidget {
const ThemePage({Key? key}) : super(key: key);
@override
......@@ -14,14 +13,13 @@ class ThemePage extends StatefulWidget {
}
class _ThemePageState extends State<ThemePage> {
final List<String> _list = <String>['跟随系统', '开启', '关闭'];
@override
Widget build(BuildContext context) {
final String? theme = SpUtil.getString(Constant.theme);
String themeMode;
switch(theme) {
switch (theme) {
case 'Dark':
themeMode = _list[1];
break;
......@@ -33,16 +31,16 @@ class _ThemePageState extends State<ThemePage> {
break;
}
return Scaffold(
appBar: const MyAppBar(
title: '夜间模式',
),
appBar: const MyAppBar(),
body: ListView.separated(
itemCount: _list.length,
separatorBuilder: (_, __) => const Divider(),
itemBuilder: (_, int index) {
return InkWell(
onTap: () {
final ThemeMode themeMode = index == 0 ? ThemeMode.system : (index == 1 ? ThemeMode.dark : ThemeMode.light);
final ThemeMode themeMode = index == 0
? ThemeMode.system
: (index == 1 ? ThemeMode.dark : ThemeMode.light);
// Provider.of<ThemeProvider>(context, listen: false).setTheme(themeMode);
/// 与上方等价,provider 4.1.0添加的拓展方法
context.read<ThemeProvider>().setTheme(themeMode);
......
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:one_poem/res/resources.dart';
import 'package:one_poem/tiktok/style/style.dart';
class TikTokTopInfoColumn extends StatelessWidget {
......@@ -12,28 +15,43 @@ class TikTokTopInfoColumn extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
// Tapped(
// child: const TikTokAvatar(),
// onTap: onAvatar,
// ),
Text(info ?? "早安"),
Container(
width: SysSize.avatar,
height: SysSize.avatar,
margin: const EdgeInsets.only(top: 10),
return SafeArea(
child: Container(
margin: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 25.0),
height: 100.0,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey.shade200.withOpacity(0.1),
border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度
borderRadius: BorderRadius.circular(2.0),
),
child: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(
sigmaX: 10.0,
sigmaY: 10.0,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(SysSize.avatar / 2.0),
// color: Colors.black.withOpacity(0.8),
color: Colors.grey.shade200.withOpacity(0.1),
),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
children: const [
Text(
'早安',
style: TextStyle(
fontSize: 28.0,
color: Colors.white,
),
),
],
),
),
)
],
),
),
),
);
));
}
}
......
......@@ -96,7 +96,7 @@ class TikTokVideoPage extends StatelessWidget {
Container(
height: double.infinity,
width: double.infinity,
alignment: Alignment.bottomLeft,
alignment: Alignment.bottomCenter,
child: leftPoem,
),
Container(
......
......@@ -23,12 +23,13 @@ class TikTokVidePoem extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.black.withOpacity(.5),
color: Colors.grey.shade200.withOpacity(0.1),
border: Border.all(color: Colors.grey, width: 0.1), // 边色与边宽度
borderRadius: BorderRadius.circular(2.0),
),
height: 220.0,
margin: const EdgeInsets.all(10.0),
width: double.infinity,
margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0),
child: InkWell(
child: ClipRect(
child: BackdropFilter(
......@@ -46,8 +47,15 @@ class TikTokVidePoem extends StatelessWidget {
children: [
Text(
title ?? '每日一言',
<<<<<<< HEAD
style:
const TextStyle(color: Colors.white, fontSize: 28.0),
=======
style: const TextStyle(
fontSize: 28.0,
color: Colors.white,
),
>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed
),
Gaps.vGap10,
Text(
......@@ -59,8 +67,15 @@ class TikTokVidePoem extends StatelessWidget {
),
Text(
author ?? '诗人',
<<<<<<< HEAD
style:
const TextStyle(color: Colors.white, fontSize: 16.0),
=======
style: const TextStyle(
fontSize: 16.0,
color: Colors.white,
),
>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed
),
],
),
......@@ -69,7 +84,7 @@ class TikTokVidePoem extends StatelessWidget {
),
),
onTap: () {
onShowDetail;
onShowDetail!();
},
),
);
......
import 'package:flutter/material.dart';
import 'package:one_poem/res/resources.dart';
class HomeActionWidgets extends StatelessWidget {
const HomeActionWidgets({
Key? key,
this.funcStar,
this.funcShare,
this.funcMore,
}) : super(key: key);
final Function? funcStar;
final Function? funcShare;
final Function? funcMore;
@override
Widget build(BuildContext context) {
const iconHeight = 30.0;
const iconWidth = 30.0;
const iconSize = 20.0;
return Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: iconHeight,
width: iconWidth,
child: IconButton(
padding: const EdgeInsets.all(0.0),
icon: const Icon(
Icons.star_border,
size: iconSize,
),
onPressed: () {
funcStar!();
},
),
),
SizedBox(
height: iconHeight,
width: iconWidth,
child: IconButton(
padding: const EdgeInsets.all(0.0),
icon: const Icon(
Icons.ios_share,
size: iconSize,
),
onPressed: () {},
),
),
SizedBox(
height: iconHeight,
width: iconWidth,
child: IconButton(
padding: const EdgeInsets.all(0.0),
onPressed: () {},
icon: const Icon(
Icons.more_horiz,
size: iconSize,
),
),
),
],
);
}
}
import 'package:flutter/material.dart';
class HomeTitleHeader extends StatelessWidget {
const HomeTitleHeader({
Key? key,
this.funcLeft,
this.funcCenter,
this.funcRight,
}) : super(key: key);
final Function? funcLeft;
final Function? funcCenter;
final Function? funcRight;
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
margin: const EdgeInsets.symmetric(horizontal: 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
//交叉轴的布局方式,对于column来说就是水平方向的布局方式
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(
width: 60.0,
child: TextButton(
onPressed: () => funcLeft!(),
child: const Text(
"一言",
style: TextStyle(color: Colors.white),
),
),
),
const VerticalDivider(
color: Colors.white,
width: 1.0,
thickness: 1.0,
indent: 15.0,
endIndent: 15.0,
),
TextButton(
onPressed: () => funcCenter!(),
child: const Text(
"译解",
style: TextStyle(color: Colors.white),
),
),
const VerticalDivider(
color: Colors.white,
width: 1.0,
thickness: 1.0,
indent: 15.0,
endIndent: 15.0,
),
TextButton(
onPressed: () => funcRight!(),
child: const Text(
"临境",
style: TextStyle(color: Colors.white),
),
),
],
));
}
}
......@@ -8,38 +8,20 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
const MyAppBar({
Key? key,
this.backgroundColor,
this.title = '',
this.centerTitle = '',
this.actionName = '',
this.backImg = 'assets/images/ic_back_black.png',
this.backImgColor,
this.onPressed,
this.isBack = true,
this.buttonLeft,
this.funcLeft,
this.buttonCenter,
this.funcCenter,
this.buttonRight,
this.funcRight,
this.isShowButtons = false,
this.homeTitleHeader,
this.homeActionWidgets,
this.isTransparent = false,
}) : super(key: key);
final Color? backgroundColor;
final String title;
final String centerTitle;
final String backImg;
final Color? backImgColor;
final String actionName;
final VoidCallback? onPressed;
final bool isBack;
final bool isShowButtons;
final bool isTransparent;
final String? buttonLeft;
final Function? funcLeft;
final String? buttonCenter;
final Function? funcCenter;
final String? buttonRight;
final Function? funcRight;
final Widget? homeTitleHeader;
final Widget? homeActionWidgets;
@override
Widget build(BuildContext context) {
......@@ -51,6 +33,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
? SystemUiOverlayStyle.light
: SystemUiOverlayStyle.dark;
<<<<<<< HEAD
final Widget action = actionName.isNotEmpty
? Positioned(
right: 0.0,
......@@ -84,6 +67,8 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
)
: Gaps.empty;
=======
>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed
final Widget back = isBack
? IconButton(
onPressed: () async {
......@@ -95,13 +80,11 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
},
tooltip: '返回',
padding: const EdgeInsets.all(12.0),
icon: Image.asset(
backImg,
color: backImgColor ?? ThemeUtils.getIconColor(context),
),
icon: const Icon(Icons.arrow_back_ios_outlined),
)
: Gaps.empty;
<<<<<<< HEAD
// TODO 复用组件
final Widget titleWidget = Semantics(
namesRoute: true,
......@@ -145,11 +128,14 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
: Gaps.hGap10,
);
=======
>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed
return AnnotatedRegion<SystemUiOverlayStyle>(
value: _overlayStyle,
child: Material(
color: Colors.transparent,
color: isTransparent ? Colors.transparent : Colors.black,
child: SafeArea(
<<<<<<< HEAD
child: Flex(
direction: Axis.horizontal,
children: [
......@@ -164,6 +150,24 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
Expanded(
child: action,
flex: 2,
=======
child: Stack(
alignment: Alignment.center,
children: <Widget>[
Positioned(
left: 5,
child: back,
),
SizedBox(
width: MediaQuery.of(context).size.width,
child: homeTitleHeader,
),
SizedBox(
child: Container(
alignment: Alignment.centerRight,
child: homeActionWidgets,
),
>>>>>>> 9fecb8a6ef8a0360e7ff66980f084c393cc257ed
),
],
),
......