File tree 5 files changed +26
-20
lines changed
5 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 1
1
<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
2
2
package =" com.flutter.beer"
3
- android : versionCode =" 1"
4
- android : versionName =" 1.0"
5
3
android : installLocation =" preferExternal" >
6
4
7
5
<!-- 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 {
8
8
return Text (
9
9
this .text,
10
10
style: TextStyle (
11
- // fontStyle: FontStyle.normal,
11
+ color : Theme . of (context).primaryTextTheme.title.color
12
12
),
13
13
);
14
14
}
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import '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;
4
5
5
6
class Index extends StatelessWidget {
6
7
final String url;
@@ -18,17 +19,20 @@ class Index extends StatelessWidget {
18
19
Widget build (BuildContext context) {
19
20
return WebviewScaffold (
20
21
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
+ ),
23
32
),
24
33
withZoom: true ,
25
34
withLocalStorage: true ,
26
35
hidden: true ,
27
- // initialChild: Container(
28
- // child: const Center(
29
- // child: CircularProgressIndicator(),
30
- // ),
31
- // ),
32
36
);
33
37
}
34
38
}
Original file line number Diff line number Diff line change @@ -84,17 +84,14 @@ class IndexState extends State<Index> {
84
84
this .model = model;
85
85
return Scaffold (
86
86
appBar: AppBar (
87
- /* title: Header.Index(
88
- this.title,
89
- ), */
87
+ title: Text (this .title),
90
88
elevation: 0 ,
91
- backgroundColor: Color (AppTheme .secondColor),
92
89
actions: this .getActions (
93
90
context,
94
91
),
95
92
leading: IconButton (
96
93
icon: Icon (Icons .arrow_back),
97
- color: Color ( AppTheme .blackColor) ,
94
+ color: Theme . of (context).primaryTextTheme.title.color ,
98
95
onPressed: () => Navigator .pop (context),
99
96
),
100
97
),
@@ -133,7 +130,7 @@ class IndexState extends State<Index> {
133
130
getActions (context) {
134
131
return [
135
132
IconButton (
136
- color: Color ( AppTheme .blackColor) ,
133
+ color: Theme . of (context).primaryTextTheme.title.color ,
137
134
icon: Icon (
138
135
Icons .insert_link,
139
136
),
@@ -154,7 +151,7 @@ class IndexState extends State<Index> {
154
151
), */
155
152
IconButton (
156
153
icon: Icon (Icons .share),
157
- color: Color ( AppTheme .blackColor) ,
154
+ color: Theme . of (context).primaryTextTheme.title.color ,
158
155
onPressed: () {
159
156
final String msg =
160
157
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;
7
7
*/
8
8
9
9
class AppTheme {
10
-
11
10
//static int mainColor = 0xFFD32F2F;
12
11
static int mainColor = materialColor['red' ];
13
12
static int secondColor = 0xFFFFFFFF ;
@@ -17,7 +16,7 @@ class AppTheme {
17
16
static int lineColor = 0xFFEEEEEE ;
18
17
static getThemeData (String theme) {
19
18
print ('==================================getThemeData=$theme ' );
20
- mainColor = materialColor[theme];
19
+ mainColor = materialColor[theme];
21
20
ThemeData themData = ThemeData (
22
21
textTheme: TextTheme (
23
22
body1: TextStyle (
@@ -37,6 +36,14 @@ class AppTheme {
37
36
),
38
37
accentColor: Colors .grey, // 选中颜色
39
38
primaryColor: Color (mainColor), // appbar背景
39
+ primaryTextTheme: TextTheme (
40
+ title: TextStyle (
41
+ // color: Colors.red
42
+ ),
43
+ button: TextStyle (
44
+ color: Colors .red
45
+ )
46
+ ),
40
47
scaffoldBackgroundColor: Color (secondColor), // 整体的scaffold背景颜色
41
48
);
42
49
return themData;
You can’t perform that action at this time.
0 commit comments