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

合并关注页修改

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