File tree Expand file tree Collapse file tree 5 files changed +26
-20
lines changed Expand file tree Collapse file tree 5 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 11<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
22 package =" com.flutter.beer"
3- android : versionCode =" 1"
4- android : versionName =" 1.0"
53 android : installLocation =" preferExternal" >
64
75 <!-- The INTERNET permission is required for development. Specifically,
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class Index extends StatelessWidget {
88 return Text (
99 this .text,
1010 style: TextStyle (
11- // fontStyle: FontStyle.normal,
11+ color : Theme . of (context).primaryTextTheme.title.color
1212 ),
1313 );
1414 }
Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
22import 'headerComp.dart' as Header;
3- import 'package:flutter_webview_plugin/flutter_webview_plugin.dart' show FlutterWebviewPlugin, WebviewScaffold;
3+ import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'
4+ show FlutterWebviewPlugin, WebviewScaffold;
45
56class Index extends StatelessWidget {
67 final String url;
@@ -18,17 +19,20 @@ class Index extends StatelessWidget {
1819 Widget build (BuildContext context) {
1920 return WebviewScaffold (
2021 url: this .url,
21- appBar: new AppBar (
22- title: Header .Index (this .title),
22+ enableAppScheme: false ,
23+ appBar: AppBar (
24+ title: Text (
25+ this .title,
26+ ),
27+ leading: IconButton (
28+ icon: Icon (Icons .arrow_back),
29+ color: Theme .of (context).primaryTextTheme.title.color,
30+ onPressed: () => Navigator .pop (context),
31+ ),
2332 ),
2433 withZoom: true ,
2534 withLocalStorage: true ,
2635 hidden: true ,
27- // initialChild: Container(
28- // child: const Center(
29- // child: CircularProgressIndicator(),
30- // ),
31- // ),
3236 );
3337 }
3438}
Original file line number Diff line number Diff line change @@ -84,17 +84,14 @@ class IndexState extends State<Index> {
8484 this .model = model;
8585 return Scaffold (
8686 appBar: AppBar (
87- /* title: Header.Index(
88- this.title,
89- ), */
87+ title: Text (this .title),
9088 elevation: 0 ,
91- backgroundColor: Color (AppTheme .secondColor),
9289 actions: this .getActions (
9390 context,
9491 ),
9592 leading: IconButton (
9693 icon: Icon (Icons .arrow_back),
97- color: Color ( AppTheme .blackColor) ,
94+ color: Theme . of (context).primaryTextTheme.title.color ,
9895 onPressed: () => Navigator .pop (context),
9996 ),
10097 ),
@@ -133,7 +130,7 @@ class IndexState extends State<Index> {
133130 getActions (context) {
134131 return [
135132 IconButton (
136- color: Color ( AppTheme .blackColor) ,
133+ color: Theme . of (context).primaryTextTheme.title.color ,
137134 icon: Icon (
138135 Icons .insert_link,
139136 ),
@@ -154,7 +151,7 @@ class IndexState extends State<Index> {
154151 ), */
155152 IconButton (
156153 icon: Icon (Icons .share),
157- color: Color ( AppTheme .blackColor) ,
154+ color: Theme . of (context).primaryTextTheme.title.color ,
158155 onPressed: () {
159156 final String msg =
160157 this .model.config.state.env.githubAssetOrigin + this .mdUrl;
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import 'color.dart' show materialColor;
77 */
88
99class AppTheme {
10-
1110 //static int mainColor = 0xFFD32F2F;
1211 static int mainColor = materialColor['red' ];
1312 static int secondColor = 0xFFFFFFFF ;
@@ -17,7 +16,7 @@ class AppTheme {
1716 static int lineColor = 0xFFEEEEEE ;
1817 static getThemeData (String theme) {
1918 print ('==================================getThemeData=$theme ' );
20- mainColor = materialColor[theme];
19+ mainColor = materialColor[theme];
2120 ThemeData themData = ThemeData (
2221 textTheme: TextTheme (
2322 body1: TextStyle (
@@ -37,6 +36,14 @@ class AppTheme {
3736 ),
3837 accentColor: Colors .grey, // 选中颜色
3938 primaryColor: Color (mainColor), // appbar背景
39+ primaryTextTheme: TextTheme (
40+ title: TextStyle (
41+ // color: Colors.red
42+ ),
43+ button: TextStyle (
44+ color: Colors .red
45+ )
46+ ),
4047 scaffoldBackgroundColor: Color (secondColor), // 整体的scaffold背景颜色
4148 );
4249 return themData;
You can’t perform that action at this time.
0 commit comments