Skip to content

Commit fdb8c32

Browse files
committed
📝 Document (dartdoc) update.
1 parent 085519b commit fdb8c32

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

lib/src/constants/screens.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,40 @@ import 'dart:ui' as ui;
66

77
import 'package:flutter/material.dart';
88

9+
/// Screens utils with multiple properties access.
10+
/// 获取屏幕各项属性的工具类
911
class Screens {
1012
const Screens._();
1113

14+
/// Get [MediaQueryData] from [ui.window]
15+
/// 通过 [ui.window] 获取 [MediaQueryData]
1216
static MediaQueryData get mediaQuery => MediaQueryData.fromWindow(ui.window);
1317

18+
/// The number of device pixels for each logical pixel.
19+
/// 设备每个逻辑像素对应的dp比例
1420
static double get scale => mediaQuery.devicePixelRatio;
1521

22+
/// The horizontal extent of this size.
23+
/// 水平范围的大小
1624
static double get width => mediaQuery.size.width;
1725

26+
/// The horizontal pixels of this size.
27+
/// 水平范围的像素值
1828
static int get widthPixels => (width * scale).toInt();
1929

30+
/// The vertical extent of this size.
31+
/// 垂直范围的大小
2032
static double get height => mediaQuery.size.height;
2133

34+
/// The vertical pixels of this size.
35+
/// 垂直范围的像素值
2236
static int get heightPixels => (height * scale).toInt();
2337

38+
/// Top offset in the [ui.window], usually is the notch size.
39+
/// 从 [ui.window] 获取的顶部偏移(间距),通常是刘海的大小。
2440
static double get topSafeHeight => mediaQuery.padding.top;
2541

42+
/// Bottom offset in the [ui.window], usually is the action bar/navigation bar size.
43+
/// 从 [ui.window] 获取的底部偏移(间距),通常是操作条/导航条的大小。
2644
static double get bottomSafeHeight => mediaQuery.padding.bottom;
2745
}

lib/src/constants/text_delegate.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
/// [Author] Alex (https://github.com/AlexVincent525)
33
/// [Date] 2020/4/7 10:25
44
///
5+
6+
/// Text delegate that controls text in widgets.
7+
/// 控制部件中的文字实现
58
abstract class TextDelegate {
69
/// Confirm string for confirm button.
710
/// 确认按钮的字段
@@ -52,6 +55,8 @@ abstract class TextDelegate {
5255
String videoIndicatorBuilder(Duration duration);
5356
}
5457

58+
/// Default text delegate implements with Chinese.
59+
/// 中文文字实现
5560
class DefaultTextDelegate implements TextDelegate {
5661
factory DefaultTextDelegate() => _instance;
5762

lib/src/widget/fixed_appbar.dart

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import 'package:flutter/material.dart';
88

99
import '../constants/constants.dart';
1010

11+
/// A custom app bar.
12+
/// 自定义的顶栏
1113
class FixedAppBar extends StatelessWidget {
1214
const FixedAppBar({
1315
Key key,
@@ -23,15 +25,44 @@ class FixedAppBar extends StatelessWidget {
2325
this.blurRadius = 0.0,
2426
}) : super(key: key);
2527

28+
/// Title widget.
29+
/// 标题部件
2630
final Widget title;
31+
32+
/// Leading widget.
33+
/// 头部部件
2734
final Widget leading;
35+
36+
/// Action widgets.
37+
/// 尾部操作部件
2838
final List<Widget> actions;
39+
40+
/// Padding for actions.
41+
/// 尾部操作部分的内边距
2942
final EdgeInsetsGeometry actionsPadding;
43+
44+
/// Whether it should imply leading with [BackButton] automatically.
45+
/// 是否会自动检测并添加返回按钮至头部
3046
final bool automaticallyImplyLeading;
47+
48+
/// Whether the [title] should be at the center of the [FixedAppBar].
49+
/// [title] 是否会在正中间
3150
final bool centerTitle;
51+
52+
/// Background color.
53+
/// 背景颜色
3254
final Color backgroundColor;
55+
56+
/// The size of the shadow below the app bar.
57+
/// 底部阴影的大小
3358
final double elevation;
59+
60+
/// Height of the app bar.
61+
/// 高度
3462
final double height;
63+
64+
/// Value that can enable the app bar using filter with [ui.ImageFilter]
65+
/// 实现高斯模糊效果的值
3566
final double blurRadius;
3667

3768
@override

0 commit comments

Comments
 (0)