Commit bd6fdfe4 authored by 林生雨's avatar 林生雨

commit

parent 16c7ab29
......@@ -3,44 +3,40 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
class AttentionListItem extends StatelessWidget {
final Data item;
AttentionListItem(this.item);
Text myText(
String text,
Color color,
double size,
{int maxLines = 1, bool weight = false}
) {
Text myText(String text, Color color, double size,
{int maxLines = 1, bool weight = false}) {
return Text(
text,
softWrap: true,
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setSp(size),
color: color,
height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal
),
fontSize: ScreenUtil().setSp(size),
color: color,
height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal),
);
}
Widget listItemHead() {
return ClipOval(
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: item.icon,
fit: BoxFit.cover,
),
)
);
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: item.icon,
fit: BoxFit.cover,
),
));
}
Widget listItemInfo() {
......@@ -50,16 +46,22 @@ class AttentionListItem extends StatelessWidget {
children: <Widget>[
Container(
margin: EdgeInsets.only(left: ScreenUtil().setWidth(10.0)),
child: myText('${item.title}', ALColors.Color464646, 13.0, weight: true),
child: myText('${item.title}', ALColors.Color464646, 13.0,
weight: true),
),
Padding(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(10.0), top: ScreenUtil().setHeight(4.0)),
child: myText('${item.content}', ALColors.Color666666, 13.0, maxLines: 2),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(10.0),
top: ScreenUtil().setHeight(4.0)),
child: myText('${item.content}', ALColors.Color666666, 13.0,
maxLines: 2),
),
Padding(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(10.0), top: ScreenUtil().setHeight(3.0)),
child: myText(MessageDate(item.pushTime).diffTime(), ALColors.Color999999, 10.0)
)
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(10.0),
top: ScreenUtil().setHeight(3.0)),
child: myText(MessageDate(item.pushTime).diffTime(),
ALColors.Color999999, 10.0))
],
),
);
......@@ -67,20 +69,21 @@ class AttentionListItem extends StatelessWidget {
Widget listItemButton() {
return Container(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(5.0), left: ScreenUtil().setWidth(12.0)),
padding: EdgeInsets.only(
top: ScreenUtil().setHeight(5.0), left: ScreenUtil().setWidth(12.0)),
width: ScreenUtil().setWidth(66.0),
height: ScreenUtil().setHeight(34.0),
child: OutlineButton(
padding: const EdgeInsets.only(left: 0.0, right: 0.0,),
borderSide: BorderSide(
color: ALColors.Color323232
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () {
// todo 跳转到原生页面 详情页面
},
child: myText('详情', ALColors.Color323232, 13.0)
),
padding: const EdgeInsets.only(
left: 0.0,
right: 0.0,
),
borderSide: BorderSide(color: ALColors.Color323232),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () {
jumpToNative('url_page', {"url": item.url});
},
child: myText('详情', ALColors.Color323232, 13.0)),
);
}
......@@ -89,11 +92,7 @@ class AttentionListItem extends StatelessWidget {
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
listItemHead(),
listItemInfo(),
listItemButton()
],
children: <Widget>[listItemHead(), listItemInfo(), listItemButton()],
),
);
}
......
......@@ -2,19 +2,15 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/MyMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart';
import 'package:gmalpha_flutter/commonModel/base/AppBase.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
messageTitle(String text) {
return Text(
text,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(20)
)
);
return Text(text,
style: TextStyle(
color: ALColors.Color323232, fontSize: ScreenUtil().setSp(20)));
}
var width = ScreenUtil().setWidth(16);
......@@ -22,204 +18,206 @@ var width = ScreenUtil().setWidth(16);
Widget messageTop(imgUrl, title, content, count) {
var height = ScreenUtil().setHeight(12);
return Container(
padding: EdgeInsets.only(left: width, right: width),
width: double.infinity,
child: Stack(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(28)),
margin: EdgeInsets.only(left: ScreenUtil().setWidth(4), top: height, bottom: height),
width: double.infinity,
decoration: BoxDecoration(
color: ALColors.ColorFFFFFF,
image: DecorationImage(
image: AssetImage(imgUrl),
alignment: Alignment.centerLeft
)
padding: EdgeInsets.only(left: width, right: width),
width: double.infinity,
child: Stack(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(28)),
margin: EdgeInsets.only(
left: ScreenUtil().setWidth(4), top: height, bottom: height),
width: double.infinity,
decoration: BoxDecoration(
color: ALColors.ColorFFFFFF,
image: DecorationImage(
image: AssetImage(imgUrl),
alignment: Alignment.centerLeft)),
child: Row(
children: <Widget>[
Text(title,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold)),
SizedBox(
width: ScreenUtil().setWidth(16),
),
Container(
width: ScreenUtil().setWidth(200),
child: Text(content,
style: TextStyle(
color: ALColors.Color8E8E8E,
fontSize: ScreenUtil().setSp(13)),
maxLines: 1,
overflow: TextOverflow.ellipsis))
],
),
),
child: Row(
children: <Widget>[
Text(
title,
style: TextStyle(
getNum(count),
Positioned(
right: ScreenUtil().setWidth(14),
top: ScreenUtil().setHeight(12),
child: Hero(
tag: "arrow_right",
child: SvgPicture.asset(
"images/arrow_right.svg",
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold
)
),
SizedBox(
width: ScreenUtil().setWidth(16),
),
Container(
width: ScreenUtil().setWidth(200),
child: Text(
content,
style: TextStyle(
color: ALColors.Color8E8E8E,
fontSize: ScreenUtil().setSp(13)
),
maxLines: 1,
overflow: TextOverflow.ellipsis
)
)
],
),
),
getNum(count),
Positioned(
right: ScreenUtil().setWidth(14),
top: ScreenUtil().setHeight(12),
child: Hero(
tag: "arrow_right",
child: SvgPicture.asset(
"images/arrow_right.svg",
color: ALColors.Color323232,
)),
)
],
)
);
)),
)
],
));
}
Widget getNum([int count]) {
if(count > 0) {
if (count > 0) {
return Positioned(
right: 0,
top: ScreenUtil().setHeight(12),
child: Container(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(2), bottom: ScreenUtil().setHeight(2), left: ScreenUtil().setWidth(7), right: ScreenUtil().setWidth(7)),
decoration: BoxDecoration(
color: ALColors.Color323232,
borderRadius: BorderRadius.circular(22.0)
),
child: Text(
count.toString(),
style: TextStyle(
color: ALColors.ColorFFFFFF,
fontSize: ScreenUtil().setSp(11),
height: 1.0
),
)
),
padding: EdgeInsets.only(
top: ScreenUtil().setHeight(2),
bottom: ScreenUtil().setHeight(2),
left: ScreenUtil().setWidth(7),
right: ScreenUtil().setWidth(7)),
decoration: BoxDecoration(
color: ALColors.Color323232,
borderRadius: BorderRadius.circular(22.0)),
child: Text(
count.toString(),
style: TextStyle(
color: ALColors.ColorFFFFFF,
fontSize: ScreenUtil().setSp(11),
height: 1.0),
)),
);
} else {
return Container();
}
}
Widget messageList(list) {
Widget messageList(Data list) {
var content = {
1: {'showText': '评论了你', 'opeUrl': 'topic_detail?call_keyboard=1&open_comment=0&topic_id=${list.repliedContent.topicId}&reply_id=${list.id}'},
2: {'showText': '评论了你的评论', 'opeUrl': 'topic_detail?call_keyboard=1&open_comment=0&topic_id=${list.repliedContent.topicId}&reply_id=${list.id}'},
3: {'showText': '评论了你', 'opeUrl': 'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}&reply_id=${list.id}&show_reply=${false}'},
4: {'showText': '评论了你的评论', 'opeUrl': 'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}&reply_id=${list.id}&show_reply=${false}'},
5: {'showText': '关注了你的问题', 'opeUrl': 'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}'}
1: {
'showText': '评论了你',
'opeUrl':
'topic_detail?call_keyboard=1&open_comment=0&topic_id=${list.repliedContent.topicId}&reply_id=${list.id}'
},
2: {
'showText': '评论了你的评论',
'opeUrl':
'topic_detail?call_keyboard=1&open_comment=0&topic_id=${list.repliedContent.topicId}&reply_id=${list.id}'
},
3: {
'showText': '评论了你',
'opeUrl':
'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}&reply_id=${list.id}&show_reply=${false}'
},
4: {
'showText': '评论了你的评论',
'opeUrl':
'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}&reply_id=${list.id}&show_reply=${false}'
},
5: {
'showText': '关注了你的问题',
'opeUrl':
'pictorial_detail?pictorial_id=${list.repliedContent.pictorialId}'
}
};
return Container(
padding: EdgeInsets.only(left: width, right: width),
margin: EdgeInsets.only(bottom: ScreenUtil().setHeight(25)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: (){
onClickButton('head_photo', {'business_id': list.userId.toString()});
jumpToNative('message_home', {"url": 'alpha://user_detail?user_id=${list.userId}'});
},
child: Container(
width: 42.0,
height: 42.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(list.icon)
)
)
)
),
SizedBox(width: ScreenUtil().setWidth(10)),
GestureDetector(
onTap: (){
onClickButton('comment');
padding: EdgeInsets.only(left: width, right: width),
margin: EdgeInsets.only(bottom: ScreenUtil().setHeight(25)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
GestureDetector(
onTap: () {
onClickButton('head_photo',
{'business_id': list.userId.toString()});
jumpToNative('url_page', {
"url": 'alpha://user_detail?user_id=${list.userId}'
});
},
child: Container(
width: 42.0,
height: 42.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: NetworkImage(list.icon))))),
SizedBox(width: ScreenUtil().setWidth(10)),
GestureDetector(
onTap: () {
onClickButton('comment');
messagePopPicker({
"show_like": list.isLike,
"commment_id": "${list.id}",
"page_name": "message_home",
"topic_id": "${list.repliedContent.topicId}",
"user_name": list.name,
"pictorial_id": list.repliedContent.pictorialId
});
},
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Text(list.name,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold)),
SizedBox(width: ScreenUtil().setWidth(10)),
Text(
content[list.repliedContent?.type]
['showText'],
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)))
],
),
Container(
width: ScreenUtil().setWidth(210),
child: Text(list.content,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)),
maxLines: 1,
overflow: TextOverflow.ellipsis),
),
Text(MessageDate(list.time).diffTime(),
style: TextStyle(
color: Color(0xfff8e8e8e),
fontSize: ScreenUtil().setSp(10)))
])))
]),
GestureDetector(
onTap: () {
onClickButton('photo',
{'business_id': list.repliedContent.id.toString()});
// jumpToNative('url_page', {"url": 'alpha://${content[list.repliedContent?.type]['openUrl']}'});
jumpToNative('url_page', {
"url":
'alpha://topic_detail?topic_id=${list.repliedContent.topicId}'
});
},
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Text(
list.name,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold
)
),
SizedBox(width: ScreenUtil().setWidth(10)),
Text(
content[list.repliedContent?.type]['showText'],
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
)
)
],
),
Container(
width: ScreenUtil().setWidth(210),
child: Text(
list.content,
style: TextStyle(
color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13)
),
maxLines: 1,
overflow: TextOverflow.ellipsis
),
),
Text(
MessageDate(list.time).diffTime(),
style: TextStyle(
color: Color(0xfff8e8e8e),
fontSize: ScreenUtil().setSp(10)
)
)
]
)
)
)
]
),
GestureDetector(
onTap: () {
onClickButton('photo', {'business_id': list.repliedContent.id.toString()});
jumpToNative('message_home', {"url": 'alpha://${content[list.repliedContent?.type]['openUrl']}'});
},
child: Image.network(
list.repliedContent.content,
width: ScreenUtil().setWidth(48),
fit: BoxFit.fill,
)
)
],
)
);
child: Image.network(
list.repliedContent.content,
width: ScreenUtil().setWidth(48),
fit: BoxFit.fill,
))
],
));
}
void onClickButton(buttonName, [params]) {
RouterCenterImpl()
.findBuriedRouter()
?.onEvent('on_click_button', {
'page_name': 'message_home',
'button_name': buttonName,
...?params
});
}
\ No newline at end of file
RouterCenterImpl().findBuriedRouter()?.onEvent('on_click_button',
{'page_name': 'message_home', 'button_name': buttonName, ...?params});
}
......@@ -2,45 +2,41 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/FocusPageEntity.dart';
import 'package:gmalpha_flutter/commonModel/base/AppBase.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
class FocusListItem extends StatelessWidget {
final Followers item;
FocusListItem(this.item);
Text myText(
String text,
Color color,
double size,
{int maxLines = 1, bool weight = false}
) {
Text myText(String text, Color color, double size,
{int maxLines = 1, bool weight = false}) {
return Text(
text,
softWrap: true,
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setSp(size),
color: color,
height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal
),
fontSize: ScreenUtil().setSp(size),
color: color,
height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal),
);
}
Widget listItemHead() {
Widget listItemHead() {
return ClipOval(
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: item.icon,
fit: BoxFit.cover,
),
)
);
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: item.icon,
fit: BoxFit.cover,
),
));
}
Widget listItemInfo() {
......@@ -51,7 +47,7 @@ class FocusListItem extends StatelessWidget {
Container(
margin: EdgeInsets.only(left: ScreenUtil().setWidth(10.0)),
padding: EdgeInsets.only(top: ScreenUtil().setHeight(10.0)),
child: myText('${item.username??""}', ALColors.Color666666, 13.0),
child: myText('${item.username ?? ""}', ALColors.Color666666, 13.0),
)
],
),
......@@ -60,7 +56,12 @@ class FocusListItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
return GestureDetector(
onTap: () {
jumpToNative('url_page',
{"url": 'alpha://user_detail?user_id=${item.id}'});
},
child: Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
......@@ -68,6 +69,6 @@ class FocusListItem extends StatelessWidget {
listItemInfo(),
],
),
);
));
}
}
......@@ -3,78 +3,92 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LikePageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart';
import 'package:gmalpha_flutter/commonModel/base/AppBase.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
class LikeListItem extends StatelessWidget {
final Data item;
LikeListItem(this.item);
Text myText(
String text,
Color color,
double size,
{int maxLines = 1, bool weight = false}
) {
Text myText(String text, Color color, double size,
{int maxLines = 1, bool weight = false}) {
return Text(
text,
softWrap: true,
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil().setSp(size),
color: color,
height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal
),
fontSize: ScreenUtil.instance.setSp(size),
color: color,
height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal),
);
}
Widget listItemHead() {
return ClipOval(
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: item.icon,
fit: BoxFit.cover,
),
)
);
Widget listItemHead() {
return GestureDetector(
onTap: () {
jumpToNative('url_page',
{"url": 'alpha://user_detail?user_id=${item.userId}'});
},
child: ClipOval(
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: item.icon,
fit: BoxFit.cover,
),
)));
}
Widget listItemRight() {
var commentImg;
if(item.type!=2){
if( item.likeContent.content == null && item.likeContent.contentType != 1){
commentImg = item.likeContent.content ;
var commentImg;
if (item.type != 2) {
if (item.likeContent.content == null &&
item.likeContent.contentType != 1) {
commentImg = item.likeContent.content;
}
if(item.likeContent.content!=null && item.likeContent.contentType != 1){
if (item.likeContent.content != null &&
item.likeContent.contentType != 1) {
commentImg = 'http://alpha.iyanzhi.com/topic/2019/08/16/63ef62d019-w';
}
}
return Container(
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: commentImg,
fit: BoxFit.cover,
),
)
);
return GestureDetector(
onTap: () {
if (item.likeContent.type == 0) {
jumpToNative('url_page', {
"url": "alpha://topic_detail?topic_id=${item.likeContent.id}"
});
} else if (item.likeContent.type == 1) {
jumpToNative('url_page', {
"url":
"alpha://topic_detail?call_keyboard=1&open_comment=1&topic_id=${item.likeContent.id}"
});
}
},
child: Container(
child: Container(
color: ALColors.ColorE4E4E4,
child: CachedNetworkImage(
width: 42.0,
height: 42.0,
imageUrl: commentImg,
fit: BoxFit.cover,
),
)));
}
Widget listItemInfo() {
var commentInfo;
var commenTime;
if(item.type != 2){
if(item.likeContent.type == 0){
commentInfo = '赞了你的回答';
}
else{
commentInfo = '赞了你的评论';
var commentInfo;
var commenTime;
if (item.type != 2) {
if (item.likeContent.type == 0) {
commentInfo = '赞了你的回答';
} else {
commentInfo = '赞了你的评论';
}
commenTime = MessageDate(item.time).diffTime();
}
......@@ -83,14 +97,18 @@ class LikeListItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: ScreenUtil().setWidth(10.0)),
padding: EdgeInsets.only(top: ScreenUtil().setHeight(10.0)),
child: myText('${item.name??""}${item.content??""}${commentInfo??""}', ALColors.Color666666, 13.0),
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(16.0)),
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(10.0)),
child: myText(
'${item.name ?? ""}${item.content ?? ""}${commentInfo ?? ""}',
ALColors.Color666666,
13.0),
),
Padding(
padding: EdgeInsets.only(left: ScreenUtil().setWidth(10.0), top: ScreenUtil().setHeight(3.0)),
child: myText('${commenTime??""}', ALColors.Color999999, 10.0)
)
padding: EdgeInsets.only(
left: ScreenUtil.instance.setWidth(16.0),
top: ScreenUtil.instance.setHeight(3.0)),
child: myText('${commenTime ?? ""}', ALColors.Color999999, 10.0))
],
),
);
......@@ -98,48 +116,41 @@ class LikeListItem extends StatelessWidget {
Widget listItemButton() {
return Container(
padding: EdgeInsets.only(top: ScreenUtil().setHeight(5.0), left: ScreenUtil().setWidth(12.0)),
width: ScreenUtil().setWidth(54.0),
height: ScreenUtil().setHeight(29.0),
padding: EdgeInsets.only(
top: ScreenUtil.instance.setHeight(5.0),
left: ScreenUtil.instance.setWidth(12.0)),
width: ScreenUtil.instance.setWidth(54.0),
height: ScreenUtil.instance.setHeight(29.0),
child: OutlineButton(
padding: const EdgeInsets.only(left: 0.0, right: 0.0,),
borderSide: BorderSide(
color: ALColors.Color323232
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () {
// todo 跳转到原生页面 详情页面
},
child: myText('查看', ALColors.Color323232, 13.0)
),
padding: const EdgeInsets.only(
left: 0.0,
right: 0.0,
),
borderSide: BorderSide(color: ALColors.Color323232),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () {
jumpToNative('url_page', {
"url":
"alpha://pictorial_detail?pictorial_id=${item.likeContent.id}&show_reply=${true}"
});
},
child: myText('查看', ALColors.Color323232, 13.0)),
);
}
@override
Widget build(BuildContext context) {
if(item.type == 2){
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
listItemHead(),
listItemInfo(),
listItemButton()
],
),
);
}
else{
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
listItemHead(),
listItemInfo(),
listItemRight()
],
),
);
}
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
listItemHead(),
listItemInfo(),
item.likeContent == null
? Container()
: item.likeContent.type == 2 ? listItemButton() : listItemRight()
],
),
);
}
}
......@@ -13,7 +13,6 @@ export 'live/BaseModel.dart';
export 'live/LiveData.dart';
export 'net/Api.dart';
export 'net/DioUtil.dart';
export 'net/Responce/SimpleResponce.dart';
export 'net/ALNetWork.dart';
export 'picker/loadingPicker.dart';
export 'picker/base/BaseCenterPicker.dart';
......@@ -35,7 +35,7 @@ void jumpToNative(String jumpToName, Map params) {
platform.invokeMethod("FLUTTER_TO_NATIVE", map);
}
void jumpToFlutter(String jumpToName,Map params){
void jumpToFlutter(String jumpToName, Map params) {
Map map = {"page_name": jumpToName};
if (params != null) {
map.addAll(params);
......@@ -47,6 +47,11 @@ Future getBuriedInfo() async {
return await platform.invokeMethod(BURIED_METHOD, null);
}
Observable messagePopPicker(Map params) {
return Observable.fromFuture(
platform.invokeMethod("MESSAGE_POP_PICKER", params));
}
Observable getNetType() {
return Observable.fromFuture(platform.invokeMethod(NET_TYPE, null));
}
......@@ -104,7 +109,6 @@ void catchAllError(VoidCallback call) {
void collectLog(String line) {
//收集日志
}
void reportErrorAndLog(FlutterErrorDetails details) {
......
......@@ -104,26 +104,32 @@ class _MyAppState extends State<MyApp> {
: int.parse(params["template_id"]),
params["fromPage"]);
},
"message_focus":(pageName, params, _){
"message_focus": (pageName, params, _) {
if (!Api.getInstance().setDioCookie(params) ||
params["fromPage"] == null) {
return ErrorPage("出错:需要传递的参数为空");
}
return RouterCenterImpl().findNewMessageRouter()?.getFocusPage(params["fromPage"]);
return RouterCenterImpl()
.findNewMessageRouter()
?.getFocusPage(params["fromPage"]);
},
"message_attention":(pageName, params, _){
"message_attention": (pageName, params, _) {
if (!Api.getInstance().setDioCookie(params) ||
params["fromPage"] == null) {
return ErrorPage("出错:需要传递的参数为空");
}
return RouterCenterImpl().findNewMessageRouter()?.getAttentionPage(params["fromPage"]);
return RouterCenterImpl()
.findNewMessageRouter()
?.getAttentionPage(params["fromPage"]);
},
"message_like":(pageName, params, _){
"message_like": (pageName, params, _) {
if (!Api.getInstance().setDioCookie(params) ||
params["fromPage"] == null) {
return ErrorPage("出错:需要传递的参数为空");
}
return RouterCenterImpl().findNewMessageRouter()?.getLikePage(params["fromPage"]);
return RouterCenterImpl()
.findNewMessageRouter()
?.getLikePage(params["fromPage"]);
}
});
FlutterBoost.handleOnStartPage();
......@@ -132,27 +138,26 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Boost example',
debugShowCheckedModeBanner: false,
routes: {
'/': (context) {
return TestPage();
},
},
builder: buildOnce,
theme: new ThemeData(
primaryColor: Colors.white,
backgroundColor: Color(0xFFEFEFEF),
accentColor: Color(0xFF888888),
textTheme: TextTheme(
//设置Material的默认字体样式
body1: TextStyle(color: Color(0xFF888888), fontSize: 16.0),
),
iconTheme: IconThemeData(
color: Color(0xFFEFEFEF),
size: 35.0,
),
)
);
title: 'Flutter Boost example',
debugShowCheckedModeBanner: false,
// routes: {
// '/': (context) {
// return TestPage();
// },
// },
builder: buildOnce,
theme: new ThemeData(
primaryColor: Colors.white,
backgroundColor: Color(0xFFEFEFEF),
accentColor: Color(0xFF888888),
textTheme: TextTheme(
//设置Material的默认字体样式
body1: TextStyle(color: Color(0xFF888888), fontSize: 16.0),
),
iconTheme: IconThemeData(
color: Color(0xFFEFEFEF),
size: 35.0,
),
));
}
}
import 'package:flutter/material.dart';
class LikeList extends StatefulWidget {
@override
_LikeListState createState() => _LikeListState();
}
class _LikeListState extends State<LikeList> {
@override
Widget build(BuildContext context) {
return Container(
);
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
class LkeListItem extends StatefulWidget {
@override
_LkeListItemState createState() => _LkeListItemState();
}
class _LkeListItemState extends State<LkeListItem> {
@override
Widget build(BuildContext context) {
return Container(
);
}
}
\ No newline at end of file
......@@ -19,7 +19,7 @@ class CustomRoute extends PageRouteBuilder {
CustomRoute(this.widget, {RouteWay routeWay = RouteWay.TRAN_RIGHT_TO_LEFT})
: super(
// 设置过度时间
transitionDuration: Duration(milliseconds: 200),
transitionDuration: Duration(milliseconds: 230),
// 构造器
pageBuilder: (
// 上下文和动画
......
......@@ -206,10 +206,12 @@ class UserSettingModel extends BaseModel {
UserEntityImpl().savenickName(name);
UserEntityImpl().savecountryInfoId(countryId);
UserEntityImpl().savecountryInfoName(cityLive.data);
Timer(Duration(milliseconds: 200), () {
FlutterBoost.singleton.closePageForContext(context);
// Navigator.pop(context);
});
// Timer(Duration(milliseconds: 200), () {
// FlutterBoost.singleton.closePageForContext(context);
//// Navigator.pop(context);
// });
// FlutterBoost.singleton.closePageForContext(context);
Navigator.pop(context,"");
} else {
Toast.show(context, "保存失败");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment