Skip to content

Commit 30478be

Browse files
committed
增加主题切换支持
1 parent 9e60506 commit 30478be

11 files changed

Lines changed: 55 additions & 59 deletions

‎lib/common/style/GSYStyle.dart‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ class GSYConstant {
114114
fontSize: middleTextWhiteSize,
115115
);
116116

117+
static const middleSubLightText = TextStyle(
118+
color: Color(GSYColors.subLightTextColor),
119+
fontSize: middleTextWhiteSize,
120+
);
121+
117122
static const middleTextBold = TextStyle(
118123
color: Color(GSYColors.mainTextColor),
119124
fontSize: middleTextWhiteSize,

‎lib/page/CodeDetailPage.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class _CodeDetailPageState extends State<CodeDetailPage> {
7878
child: new Row(
7979
mainAxisAlignment: MainAxisAlignment.center,
8080
children: <Widget>[
81-
new SpinKitDoubleBounce(color: Color(GSYColors.primaryValue)),
81+
new SpinKitDoubleBounce(color: Theme.of(context).primaryColor),
8282
new Container(width: 10.0),
8383
new Container(child: new Text(GSYStrings.loading_text, style: GSYConstant.middleText)),
8484
],

‎lib/page/CodeDetailPageWeb.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class _CodeDetailPageState extends State<CodeDetailPageWeb> {
8585
child: new Row(
8686
mainAxisAlignment: MainAxisAlignment.center,
8787
children: <Widget>[
88-
new SpinKitDoubleBounce(color: Color(GSYColors.primaryValue)),
88+
new SpinKitDoubleBounce(color: Theme.of(context).primaryColor),
8989
new Container(width: 10.0),
9090
new Container(child: new Text(GSYStrings.loading_text, style: GSYConstant.middleText)),
9191
],

‎lib/page/RepositoryDetailPage.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class _RepositoryDetailPageState extends State<RepositoryDetailPage> {
9191
child: new PopupMenuButton<String>(
9292
child: new FlatButton(
9393
onPressed: null,
94-
color: Color(GSYColors.primaryValue),
95-
disabledColor: Color(GSYColors.primaryValue),
94+
color: Theme.of(context).primaryColorDark,
95+
disabledColor: Theme.of(context).primaryColorDark,
9696
child: new GSYIConText(
9797
Icons.arrow_drop_up,
9898
data,

‎lib/page/RepositoryDetailReadmePage.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class RepositoryDetailReadmePageState extends State<RepositoryDetailReadmePage>
9090
child: new Row(
9191
mainAxisAlignment: MainAxisAlignment.center,
9292
children: <Widget>[
93-
new SpinKitDoubleBounce(color: Color(GSYColors.primaryValue)),
93+
new SpinKitDoubleBounce(color: Theme.of(context).primaryColor),
9494
new Container(width: 10.0),
9595
new Container(child: new Text(GSYStrings.loading_text, style: GSYConstant.middleText)),
9696
],

‎lib/widget/GSYMarkdownWidget.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class GSYMarkdownWidget extends StatelessWidget {
3939
}
4040

4141
_getStyleSheetDark(BuildContext context) {
42-
return _getCommonSheet(context, Theme.of(context).primaryColor).copyWith(
42+
return _getCommonSheet(context, Color(GSYColors.primaryValue)).copyWith(
4343
p: GSYConstant.smallTextWhite,
4444
h1: GSYConstant.largeLargeTextWhite,
4545
h2: GSYConstant.largeTextWhiteBold,
@@ -54,7 +54,7 @@ class GSYMarkdownWidget extends StatelessWidget {
5454
}
5555

5656
_getStyleSheetWhite(BuildContext context) {
57-
return _getCommonSheet(context, Theme.of(context).primaryColor).copyWith(
57+
return _getCommonSheet(context, Color(GSYColors.primaryValue)).copyWith(
5858
p: GSYConstant.smallText,
5959
h1: GSYConstant.largeLargeText,
6060
h2: GSYConstant.largeTextBold,

‎lib/widget/GSYPullLoadWidget.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class _GSYPullLoadWidgetState extends State<GSYPullLoadWidget> {
141141
Widget bottomWidget = (control.needLoadMore)
142142
? new Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
143143
///loading框
144-
new SpinKitRotatingCircle(color: Color(0xFF24292E)),
144+
new SpinKitRotatingCircle(color: Theme.of(context).primaryColor),
145145
new Container(
146146
width: 5.0,
147147
),

‎lib/widget/GSYSearchInputWidget.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class GSYSearchInputWidget extends StatelessWidget {
2121
decoration: new BoxDecoration(
2222
borderRadius: BorderRadius.all(Radius.circular(4.0)),
2323
color: Color(GSYColors.white),
24-
border: new Border.all(color: Color(GSYColors.primaryValue), width: 0.3),
25-
boxShadow: [BoxShadow(color: Color(GSYColors.primaryDarkValue), blurRadius: 4.0)]),
24+
border: new Border.all(color: Theme.of(context).primaryColor, width: 0.3),
25+
boxShadow: [BoxShadow(color: Theme.of(context).primaryColorDark, blurRadius: 4.0)]),
2626
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom: 12.0),
2727
child: new Row(
2828
children: <Widget>[
@@ -40,7 +40,7 @@ class GSYSearchInputWidget extends StatelessWidget {
4040
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
4141
padding: const EdgeInsets.only(right: 5.0, left: 10.0),
4242
constraints: const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
43-
child: new Icon(GSYICons.SEARCH, size: 15.0),
43+
child: new Icon(GSYICons.SEARCH, size: 15.0, color: Theme.of(context).primaryColorDark,),
4444
onPressed: onSubmitPressed)
4545
],
4646
),

‎lib/widget/GSYSelectItemWidget.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class _GSYSelectItemWidgetState extends State<GSYSelectItemWidget> {
5252
_GSYSelectItemWidgetState(this.selectItemChanged, this.itemNames, this.elevation, this.margin);
5353

5454
_renderItem(String name, int index) {
55-
var style = index == selectIndex ? GSYConstant.middleTextWhite : GSYConstant.middleSubText;
55+
var style = index == selectIndex ? GSYConstant.middleTextWhite : GSYConstant.middleSubLightText;
5656
return new Expanded(
5757
child: RawMaterialButton(
5858
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
@@ -94,7 +94,7 @@ class _GSYSelectItemWidgetState extends State<GSYSelectItemWidget> {
9494
return new GSYCardItem(
9595
elevation: elevation,
9696
margin: margin,
97-
color: Color(GSYColors.primaryValue),
97+
color: Theme.of(context).primaryColor,
9898
shape: new RoundedRectangleBorder(
9999
borderRadius: BorderRadius.all(Radius.circular(4.0)),
100100
),

‎lib/widget/ReposHeaderItem.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ReposHeaderItem extends StatelessWidget {
9797
return new Column(
9898
children: <Widget>[
9999
new GSYCardItem(
100-
color: new Color(GSYColors.primaryValue),
100+
color: Theme.of(context).primaryColorDark,
101101
child: new Container(
102102
///背景头像
103103
decoration: new BoxDecoration(

0 commit comments

Comments
 (0)