File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -137,10 +137,15 @@ class CommonUtils {
137137 static pushTheme (Store store, int index) {
138138 ThemeData themeData;
139139 List <Color > colors = getThemeListColor ();
140- themeData = new ThemeData (primarySwatch : colors[index], platform : TargetPlatform .iOS );
140+ themeData = getThemeData ( colors[index]);
141141 store.dispatch (new RefreshThemeDataAction (themeData));
142142 }
143143
144+
145+ static getThemeData (Color color) {
146+ return ThemeData (primarySwatch: color, platform: TargetPlatform .android);
147+ }
148+
144149 /**
145150 * 切换语言
146151 */
Original file line number Diff line number Diff line change 11import 'dart:async' ;
22
3- import 'package:flutter/cupertino.dart' ;
43import 'package:flutter/foundation.dart' ;
54import 'package:flutter/material.dart' ;
6- import 'package:event_bus/event_bus.dart' ;
75import 'package:flutter_localizations/flutter_localizations.dart' ;
86import 'package:fluttertoast/fluttertoast.dart' ;
97import 'package:gsy_github_app_flutter/common/event/HttpErrorEvent.dart' ;
@@ -34,10 +32,7 @@ class FlutterReduxApp extends StatelessWidget {
3432 userInfo: User .empty (),
3533 eventList: new List (),
3634 trendList: new List (),
37- themeData: new ThemeData (
38- primarySwatch: GSYColors .primarySwatch,
39- platform: TargetPlatform .android,//fix #192
40- ),
35+ themeData: CommonUtils .getThemeData (GSYColors .primarySwatch),
4136 locale: Locale ('zh' , 'CH' )),
4237 );
4338
@@ -99,6 +94,7 @@ class _GSYLocalizations extends State<GSYLocalizations> {
9994
10095 @override
10196 Widget build (BuildContext context) {
97+
10298 return new StoreBuilder <GSYState >(builder: (context, store) {
10399 ///通过 StoreBuilder 和 Localizations 实现实时多语言切换
104100 return new Localizations .override (
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ class _LoginPageState extends State<LoginPage> {
6161 body: new Container (
6262 color: Theme .of (context).primaryColor,
6363 child: new Center (
64+ //防止overFlow的现象
6465 child: SafeArea (
6566 child: SingleChildScrollView (
6667 child: new Card (
You can’t perform that action at this time.
0 commit comments