/
main.dart
203 lines (195 loc) · 8 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// © Cosmos Software | Ali Yigit Bireroglu /
// All material used in the making of this code, project, program, application, software et cetera (the "Intellectual Property") /
// belongs completely and solely to Ali Yigit Bireroglu. This includes but is not limited to the source code, the multimedia and /
// other asset files. /
// If you were granted this Intellectual Property for personal use, you are obligated to include this copyright text at all times. /
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:animated_overflow/animated_overflow.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Animated Overflow Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: MyHomePage(title: 'Animated Overflow Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, this.title}) : super(key: key);
final String? title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
double _width = MediaQuery.of(context).size.width;
return Scaffold(
backgroundColor: const Color(0xFF29292A),
appBar: AppBar(
backgroundColor: const Color(0xFF1B1D1E),
title: Text(widget.title!),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
constraints: const BoxConstraints.expand(height: 20.0),
),
Center(
child: AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: const Text(
"The quick brown fox jumps over the lazy dog.",
style: const TextStyle(color: Colors.blue, fontSize: 15, fontWeight: FontWeight.bold),
maxLines: 1,
overflow: TextOverflow.visible,
),
maxWidth: _width / 2.0,
padding: 40.0,
speed: 50.0,
),
),
Container(
constraints: const BoxConstraints.expand(height: 20.0),
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: const Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
style: const TextStyle(color: Colors.green, fontSize: 20, fontWeight: FontWeight.bold),
maxLines: 1,
overflow: TextOverflow.visible,
),
maxWidth: _width / 2.0 * 3.0,
padding: 60.0,
speed: 100.0,
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: const Text(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
style: const TextStyle(color: Colors.green, fontSize: 20, fontWeight: FontWeight.bold),
maxLines: 1,
overflow: TextOverflow.visible,
),
maxWidth: _width / 2.0 * 3.0,
padding: 60.0,
speed: 50.0,
),
Container(
constraints: const BoxConstraints.expand(height: 20.0),
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.VERTICAL,
child: FlutterLogo(
size: _width,
),
maxHeight: 200,
padding: 20.0,
speed: 150.0,
),
Container(
constraints: const BoxConstraints.expand(height: 20.0),
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: const Text(
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.",
style: const TextStyle(color: Colors.red, fontSize: 25, fontWeight: FontWeight.bold),
maxLines: 1,
overflow: TextOverflow.visible,
),
maxWidth: _width,
padding: 80.0,
speed: 200.0,
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: const Text(
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.",
style: const TextStyle(color: Colors.red, fontSize: 25, fontWeight: FontWeight.bold),
maxLines: 1,
overflow: TextOverflow.visible,
),
maxWidth: _width,
padding: 80.0,
speed: 150.0,
),
Row(
children: [
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.VERTICAL,
child: FlutterLogo(
size: _width / 2.0,
),
maxHeight: 100,
padding: 20.0,
speed: 50.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.VERTICAL,
child: FlutterLogo(
size: _width / 2.0,
),
maxHeight: 50,
padding: 20.0,
speed: 200.0,
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: const FlutterLogo(
size: 50,
),
maxWidth: _width / 2.0,
padding: 20.0,
speed: 200.0,
),
],
),
],
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: const Text(
"Cosmos Software",
style: const TextStyle(color: Colors.white, fontSize: 75, fontWeight: FontWeight.bold),
maxLines: 1,
overflow: TextOverflow.visible,
),
maxWidth: _width,
padding: 10.0,
speed: 50.0,
),
AnimatedOverflow(
animatedOverflowDirection: AnimatedOverflowDirection.HORIZONTAL,
child: Container(
width: _width * 2.0,
height: 200.0,
decoration: const BoxDecoration(
image: const DecorationImage(
image: const AssetImage(
"assets/panoramic.jpg",
),
fit: BoxFit.cover,
),
),
),
maxWidth: _width,
padding: 0.0,
speed: 50.0,
),
],
),
);
}
}