File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
22import 'package:gsy_github_app_flutter/page/HomePage.dart' ;
33import 'package:gsy_github_app_flutter/page/LoginPage.dart' ;
4+ import 'package:gsy_github_app_flutter/page/PersonPage.dart' ;
45
56class NavigatorUtils {
67 static pushReplacementNamed (BuildContext context, String routeName) {
@@ -18,4 +19,8 @@ class NavigatorUtils {
1819 static goLogin (BuildContext context) {
1920 Navigator .pushReplacementNamed (context, LoginPage .sName);
2021 }
22+
23+ static goPerson (BuildContext context, String userName) {
24+ Navigator .push (context, new MaterialPageRoute (builder: (context) => new PersonPage (userName)));
25+ }
2126}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class PersonPage extends StatefulWidget {
2828class _PersonState extends State <PersonPage > with AutomaticKeepAliveClientMixin {
2929 final String userName;
3030
31- User userInfo;
31+ User userInfo = User . empty () ;
3232
3333 _PersonState (this .userName);
3434
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart' ;
33import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart' ;
44import 'package:gsy_github_app_flutter/common/utils/EventUtils.dart' ;
5+ import 'package:gsy_github_app_flutter/common/utils/NavigatorUtils.dart' ;
56import 'package:gsy_github_app_flutter/page/PersonPage.dart' ;
67import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart' ;
78
@@ -41,10 +42,7 @@ class EventItem extends StatelessWidget {
4142 ),
4243 ),
4344 onPressed: () {
44- Navigator .push (
45- context,
46- new MaterialPageRoute (builder: (context) => new PersonPage (eventViewModel.actionUser)),
47- );
45+ NavigatorUtils .goPerson (context, eventViewModel.actionUser);
4846 }),
4947 new Padding (padding: EdgeInsets .all (5.0 )),
5048 new Expanded (child: new Text (eventViewModel.actionUser, style: GSYConstant .smallTextBold)),
Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ class UserHeaderItem extends StatelessWidget {
8383 child: new Text (
8484 userInfo.bio == null ? GSYStrings .nothing_now : userInfo.bio,
8585 style: GSYConstant .subLightSmallText,
86- overflow: TextOverflow .ellipsis,
8786 ),
8887 margin: new EdgeInsets .only (top: 6.0 , bottom: 2.0 ),
8988 alignment: Alignment .topLeft),
You can’t perform that action at this time.
0 commit comments