gaps.dart
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:Parlando/res/resources.dart';
/// 间隔
/// 官方做法:https://github.com/flutter/flutter/pull/54394
class Gaps {
/// 水平间隔
static const Widget hGap4 = SizedBox(width: Dimens.gap_dp4);
static const Widget hGap5 = SizedBox(width: Dimens.gap_dp5);
static const Widget hGap8 = SizedBox(width: Dimens.gap_dp8);
static const Widget hGap10 = SizedBox(width: Dimens.gap_dp10);
static const Widget hGap12 = SizedBox(width: Dimens.gap_dp12);
static const Widget hGap15 = SizedBox(width: Dimens.gap_dp15);
static const Widget hGap16 = SizedBox(width: Dimens.gap_dp16);
static const Widget hGap32 = SizedBox(width: Dimens.gap_dp32);
/// 垂直间隔
static const Widget vGap4 = SizedBox(height: Dimens.gap_dp4);
static const Widget vGap5 = SizedBox(height: Dimens.gap_dp5);
static const Widget vGap8 = SizedBox(height: Dimens.gap_dp8);
static const Widget vGap10 = SizedBox(height: Dimens.gap_dp10);
static const Widget vGap12 = SizedBox(height: Dimens.gap_dp12);
static const Widget vGap15 = SizedBox(height: Dimens.gap_dp15);
static const Widget vGap16 = SizedBox(height: Dimens.gap_dp16);
static const Widget vGap24 = SizedBox(height: Dimens.gap_dp24);
static const Widget vGap32 = SizedBox(height: Dimens.gap_dp32);
static const Widget vGap50 = SizedBox(height: Dimens.gap_dp50);
// static Widget line = const SizedBox(
// height: 0.6,
// width: double.infinity,
// child: const DecoratedBox(decoration: BoxDecoration(color: Colours.line)),
// );
static const Widget line = Divider();
static const Widget vLine = SizedBox(
width: 0.6,
height: 24.0,
child: VerticalDivider(),
);
static const Widget empty = SizedBox.shrink();
/// 补充一种空Widget实现 https://github.com/letsar/nil
/// https://github.com/flutter/flutter/issues/78159
}