@@ -93,13 +93,14 @@ class NavigatorUtils {
9393 return Navigator .push (
9494 context,
9595 new SizeRoute (
96- widget: pageContainer (RepositoryDetailPage (userName, reposName))));
96+ widget: pageContainer (
97+ RepositoryDetailPage (userName, reposName), context)));
9798 }
9899
99100 ///荣耀列表
100101 static Future goHonorListPage (BuildContext context, List list) {
101- return Navigator .push (
102- context, new SizeRoute (widget: pageContainer (HonorListPage (list))));
102+ return Navigator .push (context,
103+ new SizeRoute (widget: pageContainer (HonorListPage (list), context )));
103104 }
104105
105106 ///仓库版本列表
@@ -161,7 +162,7 @@ class NavigatorUtils {
161162 pageBuilder: (BuildContext buildContext, Animation <double > animation,
162163 Animation <double > secondaryAnimation) {
163164 return Builder (builder: (BuildContext context) {
164- return pageContainer (SearchPage (centerPosition));
165+ return pageContainer (SearchPage (centerPosition), context );
165166 });
166167 },
167168 barrierDismissible: false ,
@@ -253,17 +254,18 @@ class NavigatorUtils {
253254
254255 ///公共打开方式
255256 static NavigatorRouter (BuildContext context, Widget widget) {
256- return Navigator .push (context,
257- new CupertinoPageRoute (builder: (context) => pageContainer (widget)));
257+ return Navigator .push (
258+ context,
259+ new CupertinoPageRoute (
260+ builder: (context) => pageContainer (widget, context)));
258261 }
259262
260263 ///Page页面的容器,做一次通用自定义
261- static Widget pageContainer (widget) {
264+ static Widget pageContainer (widget, BuildContext context ) {
262265 return MediaQuery (
263266
264267 ///不受系统字体缩放影响
265- data: MediaQueryData .fromWindow (WidgetsBinding .instance.window)
266- .copyWith (textScaleFactor: 1 ),
268+ data: MediaQuery .of (context).copyWith (textScaleFactor: 1 ),
267269 child: widget);
268270 }
269271
0 commit comments