改一改样式

This commit is contained in:
oldchen
2019-07-26 16:50:32 +08:00
parent 5fbedc745b
commit 924ded128f
10 changed files with 66 additions and 27 deletions

View File

@ -294,6 +294,7 @@ class DemoLocalizations {
String get loadingEmpty => Intl.message('nothing at all', name: 'loadingEmpty', desc: '什么都没有哦',);
String get loadingIdle => Intl.message('...', name: 'loadingIdle', desc: '......',);
String get loadingError => Intl.message('loading error', name: 'loadingError', desc: '加载出错了',);
String get loading => Intl.message('loading...', name: 'loading', desc: '加载中...',);
String get pullUpToLoadMore => Intl.message('pull up load more', name: 'pullUpToLoadMore', desc: '上拉加载更多',);

View File

@ -87,6 +87,7 @@ class MessageLookup extends MessageLookupByLibrary {
"loading" : MessageLookupByLibrary.simpleMessage("loading..."),
"loadingEmpty" : MessageLookupByLibrary.simpleMessage("nothing at all"),
"loadingError" : MessageLookupByLibrary.simpleMessage("loading error"),
"loadingIdle" : MessageLookupByLibrary.simpleMessage("......"),
"meteorShower" : MessageLookupByLibrary.simpleMessage("Meteor Shower"),
"music" : MessageLookupByLibrary.simpleMessage("Music"),
"navigatorSetting" : MessageLookupByLibrary.simpleMessage("Navigator Setting"),

View File

@ -87,6 +87,7 @@ class MessageLookup extends MessageLookupByLibrary {
"loading" : MessageLookupByLibrary.simpleMessage("加载中..."),
"loadingEmpty" : MessageLookupByLibrary.simpleMessage("什么都没有哦"),
"loadingError" : MessageLookupByLibrary.simpleMessage("加载出错了"),
"loadingIdle" : MessageLookupByLibrary.simpleMessage("......"),
"meteorShower" : MessageLookupByLibrary.simpleMessage("天体流星"),
"music" : MessageLookupByLibrary.simpleMessage("听歌"),
"navigatorSetting" : MessageLookupByLibrary.simpleMessage("导航栏设置"),

View File

@ -33,6 +33,7 @@ class EditTaskPage extends StatelessWidget {
final iconData = IconBean.fromBean(taskIconBean.iconBean);
final bgColor = globalModel.logic.getBgInDark();
final textColor = globalModel.logic.isDarkNow() ? Color.fromRGBO(130, 130, 130, 1) : Colors.black;
final hintTextColor = globalModel.logic.isDarkNow() ? Color.fromRGBO(130, 130, 130, 1) : Colors.grey;
// model.logic.scrollToEndWhenEdit();
@ -69,7 +70,7 @@ class EditTaskPage extends StatelessWidget {
decoration: InputDecoration(
border: InputBorder.none,
hintText: model.logic.getHintTitle(),
hintStyle: TextStyle(color: textColor),
hintStyle: TextStyle(color: hintTextColor),
),
maxLines: 1,
),
@ -179,7 +180,7 @@ class EditTaskPage extends StatelessWidget {
hintText: DemoLocalizations.of(context).addTask,
border: InputBorder.none,
hintStyle: TextStyle(
color: textColor,
color: hintTextColor,
),
prefixIcon: Icon(
iconData,

View File

@ -58,6 +58,7 @@ class SearchPage extends StatelessWidget {
? LoadingWidget(
flag: model.loadingFlag,
progressColor: bgColor,
textColor: globalModel.logic.getWhiteInDark(),
)
: GridView.count(
crossAxisCount: 2,

View File

@ -6,9 +6,7 @@ import 'package:todo_list/items/task_detail_item.dart';
import 'package:todo_list/json/task_bean.dart';
import 'package:todo_list/json/task_icon_bean.dart';
import 'package:todo_list/model/global_model.dart';
import 'package:todo_list/model/main_page_model.dart';
import 'package:todo_list/model/task_detail_page_model.dart';
import 'package:todo_list/utils/theme_util.dart';
import 'package:todo_list/widgets/popmenu_botton.dart';
import 'package:todo_list/widgets/task_info_widget.dart';
@ -68,7 +66,12 @@ class TaskDetailPage extends StatelessWidget {
))),
],
),
body: Column(
//使用NotificationListener可以去掉android上默认Listview的水波纹效果
body: NotificationListener<OverscrollIndicatorNotification>(
onNotification: (overScroll) {
overScroll.disallowGlow();
},
child: ListView(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 50, top: 20, right: 50),
@ -79,8 +82,7 @@ class TaskDetailPage extends StatelessWidget {
isExisting: model.isExiting,
),
),
Expanded(
child: Container(
Container(
margin: EdgeInsets.only(top: 20),
child: !model.isExiting
? NotificationListener<OverscrollIndicatorNotification>(
@ -88,6 +90,8 @@ class TaskDetailPage extends StatelessWidget {
overScroll.disallowGlow();
},
child: ListView(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
children: List.generate(
model?.taskBean?.detailList?.length ?? 0,
(index) {
@ -129,11 +133,11 @@ class TaskDetailPage extends StatelessWidget {
),
))
: SizedBox(),
),
)
],
),
),
),
],
),
);

View File

@ -9,6 +9,7 @@ class LoadingWidget extends StatelessWidget {
final String loadingText;
final String emptyText;
final String errorText;
final String idleText;
final LoadingFlag flag;
final VoidCallback errorCallBack;
final Widget successWidget;
@ -22,7 +23,7 @@ class LoadingWidget extends StatelessWidget {
this.flag = LoadingFlag.loading,
this.errorCallBack,
this.emptyText,
this.errorText, this.size = 100, this.successWidget});
this.errorText, this.size = 100, this.successWidget, this.idleText});
@override
Widget build(BuildContext context) {
@ -108,13 +109,24 @@ class LoadingWidget extends StatelessWidget {
case LoadingFlag.idle:
return Center(
child: SvgPicture.asset(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SvgPicture.asset(
"svgs/idle.svg",
color: progressColor ?? primaryColor,
width: size,
height: size,
semanticsLabel: 'idle',
),
Text(
idleText ?? DemoLocalizations.of(context).loadingIdle,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: textSize ?? size / 5, color: textColor ?? primaryColor),
)
],
),
);
break;
}

View File

@ -581,6 +581,12 @@
"type": "text",
"placeholders": {}
},
"loadingIdle": "......",
"@loadingIdle": {
"description": "......",
"type": "text",
"placeholders": {}
},
"loadingError": "loading error",
"@loadingError": {
"description": "加载出错了",

View File

@ -1,5 +1,5 @@
{
"@@last_modified": "2019-07-25T17:55:44.478744",
"@@last_modified": "2019-07-26T16:49:38.161457",
"appName": "One Day List",
"@appName": {
"description": "app的名字",
@ -580,6 +580,12 @@
"type": "text",
"placeholders": {}
},
"loadingIdle": "...",
"@loadingIdle": {
"description": "......",
"type": "text",
"placeholders": {}
},
"loadingError": "loading error",
"@loadingError": {
"description": "加载出错了",

View File

@ -580,6 +580,12 @@
"type": "text",
"placeholders": {}
},
"loadingIdle": "......",
"@loadingIdle": {
"description": "......",
"type": "text",
"placeholders": {}
},
"loadingError": "加载出错了",
"@loadingError": {
"description": "加载出错了",