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

commit

parent 16c7ab29
...@@ -3,18 +3,16 @@ import 'package:flutter/material.dart'; ...@@ -3,18 +3,16 @@ 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,
...@@ -24,8 +22,7 @@ class AttentionListItem extends StatelessWidget { ...@@ -24,8 +22,7 @@ class AttentionListItem extends StatelessWidget {
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),
),
); );
} }
...@@ -39,8 +36,7 @@ class AttentionListItem extends StatelessWidget { ...@@ -39,8 +36,7 @@ class AttentionListItem extends StatelessWidget {
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,
), ),
borderSide: BorderSide(color: ALColors.Color323232),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero), shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () { onPressed: () {
// todo 跳转到原生页面 详情页面 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, color: ALColors.Color323232, fontSize: ScreenUtil().setSp(20)));
fontSize: ScreenUtil().setSp(20)
)
);
} }
var width = ScreenUtil().setWidth(16); var width = ScreenUtil().setWidth(16);
...@@ -28,40 +24,32 @@ Widget messageTop(imgUrl, title, content, count) { ...@@ -28,40 +24,32 @@ Widget messageTop(imgUrl, title, content, count) {
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(
left: ScreenUtil().setWidth(4), top: height, bottom: height),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: ALColors.ColorFFFFFF, color: ALColors.ColorFFFFFF,
image: DecorationImage( image: DecorationImage(
image: AssetImage(imgUrl), image: AssetImage(imgUrl),
alignment: Alignment.centerLeft alignment: Alignment.centerLeft)),
)
),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text( Text(title,
title,
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13), fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold fontWeight: FontWeight.bold)),
)
),
SizedBox( SizedBox(
width: ScreenUtil().setWidth(16), width: ScreenUtil().setWidth(16),
), ),
Container( Container(
width: ScreenUtil().setWidth(200), width: ScreenUtil().setWidth(200),
child: Text( child: Text(content,
content,
style: TextStyle( style: TextStyle(
color: ALColors.Color8E8E8E, color: ALColors.Color8E8E8E,
fontSize: ScreenUtil().setSp(13) fontSize: ScreenUtil().setSp(13)),
),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis overflow: TextOverflow.ellipsis))
)
)
], ],
), ),
), ),
...@@ -77,43 +65,63 @@ Widget messageTop(imgUrl, title, content, count) { ...@@ -77,43 +65,63 @@ Widget messageTop(imgUrl, title, content, count) {
)), )),
) )
], ],
) ));
);
} }
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(
top: ScreenUtil().setHeight(2),
bottom: ScreenUtil().setHeight(2),
left: ScreenUtil().setWidth(7),
right: ScreenUtil().setWidth(7)),
decoration: BoxDecoration( decoration: BoxDecoration(
color: ALColors.Color323232, color: ALColors.Color323232,
borderRadius: BorderRadius.circular(22.0) borderRadius: BorderRadius.circular(22.0)),
),
child: Text( child: Text(
count.toString(), count.toString(),
style: TextStyle( style: TextStyle(
color: ALColors.ColorFFFFFF, color: ALColors.ColorFFFFFF,
fontSize: ScreenUtil().setSp(11), fontSize: ScreenUtil().setSp(11),
height: 1.0 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),
...@@ -127,9 +135,12 @@ Widget messageList(list) { ...@@ -127,9 +135,12 @@ Widget messageList(list) {
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', {
"url": 'alpha://user_detail?user_id=${list.userId}'
});
}, },
child: Container( child: Container(
width: 42.0, width: 42.0,
...@@ -137,15 +148,19 @@ Widget messageList(list) { ...@@ -137,15 +148,19 @@ Widget messageList(list) {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
image: DecorationImage( image: DecorationImage(
image: NetworkImage(list.icon) 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: Container(
child: Column( child: Column(
...@@ -154,72 +169,55 @@ Widget messageList(list) { ...@@ -154,72 +169,55 @@ Widget messageList(list) {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Text( Text(list.name,
list.name,
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13), fontSize: ScreenUtil().setSp(13),
fontWeight: FontWeight.bold fontWeight: FontWeight.bold)),
)
),
SizedBox(width: ScreenUtil().setWidth(10)), SizedBox(width: ScreenUtil().setWidth(10)),
Text( Text(
content[list.repliedContent?.type]['showText'], content[list.repliedContent?.type]
['showText'],
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13) fontSize: ScreenUtil().setSp(13)))
)
)
], ],
), ),
Container( Container(
width: ScreenUtil().setWidth(210), width: ScreenUtil().setWidth(210),
child: Text( child: Text(list.content,
list.content,
style: TextStyle( style: TextStyle(
color: ALColors.Color323232, color: ALColors.Color323232,
fontSize: ScreenUtil().setSp(13) fontSize: ScreenUtil().setSp(13)),
),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis overflow: TextOverflow.ellipsis),
),
), ),
Text( Text(MessageDate(list.time).diffTime(),
MessageDate(list.time).diffTime(),
style: TextStyle( style: TextStyle(
color: Color(0xfff8e8e8e), color: Color(0xfff8e8e8e),
fontSize: ScreenUtil().setSp(10) fontSize: ScreenUtil().setSp(10)))
) ])))
) ]),
]
)
)
)
]
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
onClickButton('photo', {'business_id': list.repliedContent.id.toString()}); onClickButton('photo',
jumpToNative('message_home', {"url": 'alpha://${content[list.repliedContent?.type]['openUrl']}'}); {'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: Image.network( child: Image.network(
list.repliedContent.content, list.repliedContent.content,
width: ScreenUtil().setWidth(48), width: ScreenUtil().setWidth(48),
fit: BoxFit.fill, 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
});
} }
...@@ -2,19 +2,17 @@ import 'package:cached_network_image/cached_network_image.dart'; ...@@ -2,19 +2,17 @@ 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,
...@@ -24,8 +22,7 @@ class FocusListItem extends StatelessWidget { ...@@ -24,8 +22,7 @@ class FocusListItem extends StatelessWidget {
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),
),
); );
} }
...@@ -39,8 +36,7 @@ class FocusListItem extends StatelessWidget { ...@@ -39,8 +36,7 @@ class FocusListItem extends StatelessWidget {
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,34 +3,36 @@ import 'package:flutter/material.dart'; ...@@ -3,34 +3,36 @@ 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(
onTap: () {
jumpToNative('url_page',
{"url": 'alpha://user_detail?user_id=${item.userId}'});
},
child: ClipOval(
child: Container( child: Container(
color: ALColors.ColorE4E4E4, color: ALColors.ColorE4E4E4,
child: CachedNetworkImage( child: CachedNetworkImage(
...@@ -39,21 +41,35 @@ class LikeListItem extends StatelessWidget { ...@@ -39,21 +41,35 @@ class LikeListItem extends StatelessWidget {
imageUrl: item.icon, imageUrl: item.icon,
fit: BoxFit.cover, 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(
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( child: Container(
color: ALColors.ColorE4E4E4, color: ALColors.ColorE4E4E4,
child: CachedNetworkImage( child: CachedNetworkImage(
...@@ -62,18 +78,16 @@ class LikeListItem extends StatelessWidget { ...@@ -62,18 +78,16 @@ class LikeListItem extends StatelessWidget {
imageUrl: commentImg, imageUrl: commentImg,
fit: BoxFit.cover, 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,
), ),
borderSide: BorderSide(color: ALColors.Color323232),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero), shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () { onPressed: () {
// todo 跳转到原生页面 详情页面 jumpToNative('url_page', {
"url":
"alpha://pictorial_detail?pictorial_id=${item.likeContent.id}&show_reply=${true}"
});
}, },
child: myText('查看', ALColors.Color323232, 13.0) 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(),
listItemButton() item.likeContent == null
? 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();
...@@ -134,11 +140,11 @@ class _MyAppState extends State<MyApp> { ...@@ -134,11 +140,11 @@ class _MyAppState extends State<MyApp> {
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,
...@@ -152,7 +158,6 @@ class _MyAppState extends State<MyApp> { ...@@ -152,7 +158,6 @@ class _MyAppState extends State<MyApp> {
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