Commit 049544f6 authored by 何碧荣's avatar 何碧荣

合并关注页修改

parents d77ee87c 841b1bc5
import 'package:flutter/widgets.dart';
import 'package:gmalpha_flutter/NewMessageModel/NewMessageRouter.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/AttentionPage.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/attention/AttentionPage.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/focusPage/FocusPage.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/likePage/LikePage.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/messagePage/MessagePage.dart';
......
......@@ -19,10 +19,11 @@ class AttentionListItem extends StatelessWidget {
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
),
);
}
......@@ -45,23 +46,17 @@ class AttentionListItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: ScreenUtil().setWidth(10.0)),
child: myText('${item.title}', ALColors.Color464646, 13.0,
weight: true),
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)),
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.instance.setWidth(10.0), top: ScreenUtil.instance.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.instance.setWidth(10.0), top: ScreenUtil.instance.setHeight(3.0)),
child: myText(MessageDate(item.pushTime).diffTime(), ALColors.Color999999, 10.0)
)
],
),
);
......@@ -69,10 +64,9 @@ class AttentionListItem extends StatelessWidget {
Widget listItemButton() {
return Container(
padding: EdgeInsets.only(
top: ScreenUtil().setHeight(5.0), left: ScreenUtil().setWidth(12.0)),
width: ScreenUtil().setWidth(66.0),
height: ScreenUtil().setHeight(34.0),
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(5.0), left: ScreenUtil.instance.setWidth(12.0)),
width: ScreenUtil.instance.setWidth(66.0),
height: ScreenUtil.instance.setHeight(34.0),
child: OutlineButton(
padding: const EdgeInsets.only(
left: 0.0,
......@@ -89,6 +83,7 @@ class AttentionListItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
ScreenUtil.instance = ScreenUtil(width: 375.0, height: 667.0, allowFontScaling: true)..init(context);
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
......
......@@ -2,20 +2,22 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/AttentionModel.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/AttentionListItem.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/attention/AttentionListItem.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/attention/AttentionModel.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
double width15 = ScreenUtil().setWidth(15.0);
double width16 = ScreenUtil().setWidth(16.0);
double width10 = ScreenUtil().setWidth(10.0);
double height16 = ScreenUtil().setHeight(16.0);
double height10 = ScreenUtil().setHeight(10.0);
double height20 = ScreenUtil().setHeight(20.0);
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
double width15 = ScreenUtil.instance.setWidth(15.0);
double width16 = ScreenUtil.instance.setWidth(16.0);
double width10 = ScreenUtil.instance.setWidth(10.0);
double height16 = ScreenUtil.instance.setHeight(16.0);
double height10 = ScreenUtil.instance.setHeight(10.0);
double height20 = ScreenUtil.instance.setHeight(20.0);
class AttentionPage extends StatefulWidget {
final AttentionModel _model;
......@@ -69,7 +71,7 @@ class _AttentionPageState extends BasePage<AttentionPage> {
textAlign: TextAlign.center,
style: TextStyle(
color: ALColors.Color999999,
fontSize: ScreenUtil().setSp(14.0),
fontSize: ScreenUtil.instance.setSp(14.0),
height: 1.07
),
);
......@@ -87,7 +89,7 @@ class _AttentionPageState extends BasePage<AttentionPage> {
),
Padding(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(6.0),
left: ScreenUtil.instance.setWidth(6.0),
top: height20,
bottom: height20
),
......@@ -102,7 +104,7 @@ class _AttentionPageState extends BasePage<AttentionPage> {
child: Container(
color: Color(0xFFF4F3F8),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(6.0),
left: ScreenUtil.instance.setWidth(6.0),
top: height20,
bottom: height20
),
......@@ -239,14 +241,14 @@ class _AttentionPageState extends BasePage<AttentionPage> {
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setHeight(5.0),
top: ScreenUtil.instance.setHeight(5.0),
left: width16,
right: width16,
bottom: ScreenUtil().setHeight(19.0)
bottom: ScreenUtil.instance.setHeight(19.0)
),
child: Text(
'通知',
style: TextStyle(fontSize: ScreenUtil().setSp(20.0), color: ALColors.Color323232),
style: TextStyle(fontSize: ScreenUtil.instance.setSp(20.0), color: ALColors.Color323232),
),
),
Container(
......
......@@ -10,19 +10,24 @@ 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.instance.setSp(size),
color: color,
height: 1.38,
fontWeight: weight ? FontWeight.bold : FontWeight.normal
),
);
}
......@@ -45,10 +50,10 @@ class FocusListItem 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.username ?? ""}', ALColors.Color666666, 13.0),
)
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)),
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(10.0)),
child: myText('${item.username??""} 关注了你', ALColors.Color666666, 13.0),
),
],
),
);
......
......@@ -10,12 +10,12 @@ import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
double width15 = ScreenUtil().setWidth(15.0);
double width16 = ScreenUtil().setWidth(16.0);
double width10 = ScreenUtil().setWidth(10.0);
double height16 = ScreenUtil().setHeight(16.0);
double height10 = ScreenUtil().setHeight(10.0);
double height20 = ScreenUtil().setHeight(20.0);
double width15 = ScreenUtil.instance.setWidth(15.0);
double width16 = ScreenUtil.instance.setWidth(16.0);
double width10 = ScreenUtil.instance.setWidth(10.0);
double height16 = ScreenUtil.instance.setHeight(16.0);
double height10 = ScreenUtil.instance.setHeight(10.0);
double height20 = ScreenUtil.instance.setHeight(20.0);
class FocusPage extends StatefulWidget {
final FocusModel _model;
......@@ -73,23 +73,24 @@ class _FocusState extends BasePage<FocusPage> {
text,
textAlign: TextAlign.center,
style: TextStyle(
color: ALColors.Color999999,
fontSize: ScreenUtil().setSp(14.0),
height: 1.07),
color: ALColors.Color999999,
fontSize: ScreenUtil.instance.setSp(14.0),
height: 1.07
),
);
if (mode == LoadStatus.loading || mode == LoadStatus.canLoading) {
return Container(
color: Color(0xFFF4F3F8),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 15.0,
height: 15.0,
child: CircularProgressIndicator(strokeWidth: 2.0),
),
Padding(
color: Color(0xFFF4F3F8),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 15.0,
height: 15.0,
child: CircularProgressIndicator(strokeWidth: 2.0),
),
Padding(
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(6.0),
top: height20,
......@@ -101,12 +102,14 @@ class _FocusState extends BasePage<FocusPage> {
return Opacity(
opacity: 1.0,
child: Container(
color: Color(0xFFF4F3F8),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(6.0),
top: height20,
bottom: height20),
child: loadText),
color: Color(0xFFF4F3F8),
padding: EdgeInsets.only(
left: ScreenUtil.instance.setWidth(6.0),
top: height20,
bottom: height20
),
child: loadText
),
);
}
}
......@@ -228,15 +231,14 @@ class _FocusState extends BasePage<FocusPage> {
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: ScreenUtil().setHeight(5.0),
left: width16,
right: width16,
bottom: ScreenUtil.instance.setHeight(19.0)),
top: ScreenUtil.instance.setHeight(5.0),
left: width16,
right: width16,
bottom: ScreenUtil.instance.setHeight(19.0)
),
child: Text(
'关注',
style: TextStyle(
fontSize: ScreenUtil.instance.setSp(20.0),
color: ALColors.Color323232),
style: TextStyle(fontSize: ScreenUtil.instance.setSp(20.0), color: ALColors.Color323232),
),
),
Container(
......
......@@ -19,10 +19,11 @@ class LikeListItem extends StatelessWidget {
maxLines: maxLines,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: ScreenUtil.instance.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
),
);
}
......@@ -82,33 +83,37 @@ class LikeListItem extends StatelessWidget {
}
Widget listItemInfo() {
var commentInfo;
var commenTime;
if (item.type != 2) {
if (item.likeContent.type == 0) {
commentInfo = '赞了你的回答';
} else {
commentInfo = '赞了你的评论';
var commentInfo;
var commenTime;
var textTop ;
if(item.type != 2){
if(item.likeContent.type == 0){
commentInfo = '赞了你的回答';
}
else{
commentInfo = '赞了你的评论';
}
commenTime = MessageDate(item.time).diffTime();
}
if(item.content != null){
textTop = 11.0 ;
}
else{
textTop = 0.0 ;
}
return Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
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),
margin: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0)),
padding: EdgeInsets.only(top: ScreenUtil.instance.setHeight(textTop)),
child: myText('${item.name??""}${item.content??""}${commentInfo??""}', ALColors.Color666666, 13.0),
),
Padding(
padding: EdgeInsets.only(
left: ScreenUtil.instance.setWidth(16.0),
top: ScreenUtil.instance.setHeight(3.0)),
child: myText('${commenTime ?? ""}', ALColors.Color999999, 10.0))
padding: EdgeInsets.only(left: ScreenUtil.instance.setWidth(10.0), top: ScreenUtil.instance.setHeight(3.0)),
child: myText('${commenTime??""}', ALColors.Color999999, 10.0)
)
],
),
);
......@@ -137,7 +142,7 @@ class LikeListItem extends StatelessWidget {
child: myText('查看', ALColors.Color323232, 13.0)),
);
}
@override
Widget build(BuildContext context) {
return Container(
......
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/AttentionPage.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/attention/AttentionPage.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/focusPage/FocusPage.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/likePage/LikePage.dart';
import 'package:gmalpha_flutter/commonModel/base/AppBase.dart';
......
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