forked from Tencent/tdesign-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtd_shadows_page.dart
More file actions
63 lines (57 loc) · 1.85 KB
/
td_shadows_page.dart
File metadata and controls
63 lines (57 loc) · 1.85 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import 'package:flutter/material.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
import '../../annotation/demo.dart';
import '../../base/example_widget.dart';
/// 圆角示例页面
class TDShadowsPage extends StatelessWidget {
const TDShadowsPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return ExamplePage(
title: tdTitle(context),
exampleCodeGroup: 'shadows',
children: [
ExampleModule(title: '投影', children: [
ExampleItem(desc: '基础投影', builder: _buildShadowsBase),
ExampleItem(desc: '中层投影', builder: _buildShadowsMiddle),
ExampleItem(desc: '上层投影', builder: _buildShadowsTop),
]),
]);
}
@Demo(group: 'shadows')
Widget _buildShadowsBase(BuildContext context) {
return Container(
width: 100,
height: 50,
decoration: BoxDecoration(
color: TDTheme.of(context).bgColorContainer,
boxShadow: TDTheme.of(context).shadowsBase,
borderRadius: BorderRadius.circular(TDTheme.of(context).radiusDefault),
),
);
}
@Demo(group: 'shadows')
Widget _buildShadowsMiddle(BuildContext context) {
return Container(
width: 100,
height: 50,
decoration: BoxDecoration(
color: TDTheme.of(context).bgColorContainer,
boxShadow: TDTheme.of(context).shadowsMiddle,
borderRadius: BorderRadius.circular(TDTheme.of(context).radiusDefault),
),
);
}
@Demo(group: 'shadows')
Widget _buildShadowsTop(BuildContext context) {
return Container(
width: 100,
height: 50,
decoration: BoxDecoration(
color: TDTheme.of(context).bgColorContainer,
boxShadow: TDTheme.of(context).shadowsTop,
borderRadius: BorderRadius.circular(TDTheme.of(context).radiusDefault),
),
);
}
}