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

commit

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