-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
131 lines (125 loc) · 4.07 KB
/
main.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import 'package:flutter/material.dart';
import 'package:round_path_widget/shelf.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("round_path_widget"),
),
body: SingleChildScrollView(
child: Center(
child: Column(
children: <Widget>[
RoundPathWidget(
child: Image.asset(
'assets/images/girl.jpeg',
fit: BoxFit.cover,
width: 60,
height: 60,
),
),
RoundPathWidget(
pathShape: PathShapeEnum.RoundRect,
radius: 10,
child: Image.asset(
'assets/images/girl.jpeg',
fit: BoxFit.cover,
width: 70,
height: 70,
),
),
RoundPathWidget(
pathShape: PathShapeEnum.PartRoundRect,
leftTopRadius: 20,
rightBottomRadius: 20,
child: Image.asset(
'assets/images/girl.jpeg',
fit: BoxFit.cover,
width: 110,
height: 110,
),
),
RoundPathWidget(
pathShape: PathShapeEnum.PartRoundRect,
leftTopRadius: 20,
leftBottomRadius: 20,
child: Image.asset(
'assets/images/girl.jpeg',
fit: BoxFit.cover,
width: 90,
height: 90,
),
),
RoundPathWidget(
pathShape: PathShapeEnum.PartRoundRect,
leftTopRadius: 20,
leftBottomRadius: 10,
rightBottomRadius: 10,
child: Image.asset(
'assets/images/girl.jpeg',
fit: BoxFit.cover,
width: 150,
height: 150,
),
),
RoundPathWidget(
pathShape: PathShapeEnum.PartRoundRect,
rightTopRadius: 15,
rightBottomRadius: 15,
child:Container(
padding: const EdgeInsets.all(3),
width: 300,
color: Colors.blue,
child: Row(
children: <Widget>[
Expanded(child: Column(
children: <Widget>[
Center(child: Text("测试多种布局"),),
Text('支持不同角,不同圆弧大小')
],
)),
Image.asset(
'assets/images/girl.jpeg',
fit: BoxFit.cover,
width: 60,
height: 60,
)
],
),
),
),
],
),
),
),
);
}
}