-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecoratedBoxAbout.dart
54 lines (51 loc) · 1.81 KB
/
DecoratedBoxAbout.dart
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
import 'package:flutter/material.dart';
import 'package:flutter_starter_notes/component/CommonTitle.dart';
class DecoratedBoxAbout extends StatelessWidget {
DecoratedBoxAbout({Key key, this.title});
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
CommonTitle('DecoratedBox 介绍'),
Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.all(16),
child: Text(
"DecoratedBox 可以在其子 widget 绘制前(或后)绘制一个装饰 Decoration(如背景、边框、渐变、阴影等)。"),
),
CommonTitle('DecoratedBox 示例'),
Padding(
padding: EdgeInsets.all(10),
child: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.red, Colors.orange[700]]), //背景渐变
borderRadius: BorderRadius.circular(3.0), //3像素圆角
boxShadow: [
//阴影
BoxShadow(
color: Colors.black54,
offset: Offset(2.0, 2.0),
blurRadius: 4.0)
]),
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 80.0, vertical: 18.0),
child: Text(
"Login",
style: TextStyle(color: Colors.white),
),
)),
),
],
),
),
);
}
}