Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 775c8a7

Browse files
主题添加brightness,textTipsColor,linkDefaultColor属性
1 parent 951e869 commit 775c8a7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎lib/src/base/theme.dart‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/foundation.dart';
22
import 'package:flutter/material.dart';
3+
import 'package:flutter_weui/src/base/color.dart';
34
import 'package:smart_color/smart_color.dart';
45

56
// 黑暗主题对应颜色
@@ -132,6 +133,29 @@ class WeUITheme extends StatelessWidget {
132133

133134
@immutable
134135
class WeUIThemeData extends Diagnosticable {
136+
factory WeUIThemeData({
137+
Brightness brightness,
138+
Color textTipsColor,
139+
Color linkDefaultColor,
140+
}){
141+
brightness ??= Brightness.light;
142+
textTipsColor ??= weuiTextColorTips(brightness);
143+
linkDefaultColor ??= weuiLinkColorDefault(brightness);
144+
return WeUIThemeData.raw(
145+
brightness: brightness,
146+
textTipsColor: textTipsColor,
147+
linkDefaultColor: linkDefaultColor,
148+
);
149+
}
150+
const WeUIThemeData.raw({
151+
@required this.brightness,
152+
@required this.textTipsColor,
153+
@required this.linkDefaultColor,
154+
});
155+
final Brightness brightness;
156+
final Color textTipsColor;
157+
final Color linkDefaultColor;
158+
135159
factory WeUIThemeData.light() => null;
136160
}
137161

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /