-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexample.dart
60 lines (57 loc) · 1.85 KB
/
example.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
import 'package:flutter/material.dart';
import 'package:swipe_up/swipe_up.dart';
class SwipeUpExample extends StatefulWidget {
@override
_SwipeUpExampleState createState() => _SwipeUpExampleState();
}
class _SwipeUpExampleState extends State<SwipeUpExample> {
@override
Widget build(BuildContext context) {
return SwipeUp(
color: Colors.white,
sensitivity: 0.5,
onSwipe: () {
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => SecondPage()));
},
body: Material(
color: Colors.lightBlueAccent,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('COOL',
style: TextStyle(color: Colors.white, fontSize: 94.0)),
Text('NEW',
style: TextStyle(color: Colors.white, fontSize: 166.0)),
Text('STUFF',
style: TextStyle(color: Colors.white, fontSize: 94.0))
],
),
),
),
child: Material(
color: Colors.transparent,
child: Text('Swipe Up', style: TextStyle(color: Colors.white))));
}
}
class SecondPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
color: Colors.greenAccent,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('UP',
style: TextStyle(color: Colors.white, fontSize: 94.0)),
Text('YOU',
style: TextStyle(color: Colors.white, fontSize: 166.0)),
Text('SWIPED!',
style: TextStyle(color: Colors.white, fontSize: 94.0))
],
)
),
);
}
}