File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -6,22 +6,40 @@ import 'dart:ui' as ui;
6
6
7
7
import 'package:flutter/material.dart' ;
8
8
9
+ /// Screens utils with multiple properties access.
10
+ /// 获取屏幕各项属性的工具类
9
11
class Screens {
10
12
const Screens ._();
11
13
14
+ /// Get [MediaQueryData] from [ui.window]
15
+ /// 通过 [ui.window] 获取 [MediaQueryData]
12
16
static MediaQueryData get mediaQuery => MediaQueryData .fromWindow (ui.window);
13
17
18
+ /// The number of device pixels for each logical pixel.
19
+ /// 设备每个逻辑像素对应的dp比例
14
20
static double get scale => mediaQuery.devicePixelRatio;
15
21
22
+ /// The horizontal extent of this size.
23
+ /// 水平范围的大小
16
24
static double get width => mediaQuery.size.width;
17
25
26
+ /// The horizontal pixels of this size.
27
+ /// 水平范围的像素值
18
28
static int get widthPixels => (width * scale).toInt ();
19
29
30
+ /// The vertical extent of this size.
31
+ /// 垂直范围的大小
20
32
static double get height => mediaQuery.size.height;
21
33
34
+ /// The vertical pixels of this size.
35
+ /// 垂直范围的像素值
22
36
static int get heightPixels => (height * scale).toInt ();
23
37
38
+ /// Top offset in the [ui.window] , usually is the notch size.
39
+ /// 从 [ui.window] 获取的顶部偏移(间距),通常是刘海的大小。
24
40
static double get topSafeHeight => mediaQuery.padding.top;
25
41
42
+ /// Bottom offset in the [ui.window] , usually is the action bar/navigation bar size.
43
+ /// 从 [ui.window] 获取的底部偏移(间距),通常是操作条/导航条的大小。
26
44
static double get bottomSafeHeight => mediaQuery.padding.bottom;
27
45
}
Original file line number Diff line number Diff line change 2
2
/// [Author] Alex (https://github.com/AlexVincent525)
3
3
/// [Date] 2020/4/7 10:25
4
4
///
5
+
6
+ /// Text delegate that controls text in widgets.
7
+ /// 控制部件中的文字实现
5
8
abstract class TextDelegate {
6
9
/// Confirm string for confirm button.
7
10
/// 确认按钮的字段
@@ -52,6 +55,8 @@ abstract class TextDelegate {
52
55
String videoIndicatorBuilder (Duration duration);
53
56
}
54
57
58
+ /// Default text delegate implements with Chinese.
59
+ /// 中文文字实现
55
60
class DefaultTextDelegate implements TextDelegate {
56
61
factory DefaultTextDelegate () => _instance;
57
62
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import 'package:flutter/material.dart';
8
8
9
9
import '../constants/constants.dart' ;
10
10
11
+ /// A custom app bar.
12
+ /// 自定义的顶栏
11
13
class FixedAppBar extends StatelessWidget {
12
14
const FixedAppBar ({
13
15
Key key,
@@ -23,15 +25,44 @@ class FixedAppBar extends StatelessWidget {
23
25
this .blurRadius = 0.0 ,
24
26
}) : super (key: key);
25
27
28
+ /// Title widget.
29
+ /// 标题部件
26
30
final Widget title;
31
+
32
+ /// Leading widget.
33
+ /// 头部部件
27
34
final Widget leading;
35
+
36
+ /// Action widgets.
37
+ /// 尾部操作部件
28
38
final List <Widget > actions;
39
+
40
+ /// Padding for actions.
41
+ /// 尾部操作部分的内边距
29
42
final EdgeInsetsGeometry actionsPadding;
43
+
44
+ /// Whether it should imply leading with [BackButton] automatically.
45
+ /// 是否会自动检测并添加返回按钮至头部
30
46
final bool automaticallyImplyLeading;
47
+
48
+ /// Whether the [title] should be at the center of the [FixedAppBar] .
49
+ /// [title] 是否会在正中间
31
50
final bool centerTitle;
51
+
52
+ /// Background color.
53
+ /// 背景颜色
32
54
final Color backgroundColor;
55
+
56
+ /// The size of the shadow below the app bar.
57
+ /// 底部阴影的大小
33
58
final double elevation;
59
+
60
+ /// Height of the app bar.
61
+ /// 高度
34
62
final double height;
63
+
64
+ /// Value that can enable the app bar using filter with [ui.ImageFilter]
65
+ /// 实现高斯模糊效果的值
35
66
final double blurRadius;
36
67
37
68
@override
You can’t perform that action at this time.
0 commit comments