File tree Expand file tree Collapse file tree 6 files changed +105
-1
lines changed Expand file tree Collapse file tree 6 files changed +105
-1
lines changed Original file line number Diff line number Diff line change @@ -257,4 +257,14 @@ const PAGE_ITEMS = [
257257 "img" : PageImage .FLUTTER_OPEN ,
258258 "click" : PageName .INTER_DRAG ,
259259 },
260+ {
261+ "title" : PageName .INTER_GESTURE ,
262+ "img" : PageImage .FLUTTER_OPEN ,
263+ "click" : PageName .INTER_GESTURE ,
264+ },
265+ {
266+ "title" : PageName .INTER_DISMISSIBLE ,
267+ "img" : PageImage .FLUTTER_OPEN ,
268+ "click" : PageName .INTER_DISMISSIBLE ,
269+ },
260270];
Original file line number Diff line number Diff line change @@ -56,4 +56,6 @@ class PageName {
5656 static const ANIM_PYH_MODEL = "PyhModel" ;
5757 static const ANIM_OPACITY = "OpacityPage" ;
5858 static const INTER_DRAG = "Draggable" ;
59+ static const INTER_GESTURE = "Gesture" ;
60+ static const INTER_DISMISSIBLE = "Dismissible" ;
5961}
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ class FlutterOpenApp extends StatelessWidget {
7070 PageName .ANIM_PYH_MODEL : (context) => PyhModelPage (),
7171 PageName .ANIM_OPACITY : (context) => AnimOpacityPage (),
7272 PageName .INTER_DRAG : (context) => DraggablePage (),
73+ PageName .INTER_GESTURE : (context) => GesturePage (),
74+ PageName .INTER_DISMISSIBLE : (context) => DismissiblePage (),
7375 },
7476 );
7577 }
Original file line number Diff line number Diff line change 1+ ///
2+ /// Created by NieBin on 2019/6/12
3+ /// Github: https://github.com/nb312
4+ /// Email: niebin312@gmail.com
5+ ///
6+ import "package:flutter/material.dart" ;
7+ import "package:flutter_widgets/const/_const.dart" ;
8+
9+ class DismissiblePage extends StatefulWidget {
10+ @override
11+ _DismissibleState createState () => _DismissibleState ();
12+ }
13+
14+ class _DismissibleState extends State <DismissiblePage > {
15+ var _key = GlobalKey ();
16+
17+ @override
18+ Widget build (BuildContext context) {
19+ return Scaffold (
20+ appBar: AppBar (
21+ title: Text (PageName .INTER_DISMISSIBLE ),
22+ ),
23+ body: Dismissible (
24+ key: _key,
25+ child: Container (
26+ constraints: BoxConstraints .expand (height: 100 ),
27+ alignment: Alignment .center,
28+ child: Text (
29+ "Hello" ,
30+ style: TextStyle (color: TEXT_BLACK , fontSize: 20 ),
31+ ),
32+ color: BLUE ,
33+ ),
34+ background: Container (
35+ color: RED_LIGHT ,
36+ constraints: BoxConstraints .expand (height: 100 , width: 40 ),
37+ alignment: Alignment .center,
38+ child: Text (
39+ "Remove" ,
40+ style: TextStyle (color: TEXT_BLACK_LIGHT , fontSize: 10 ),
41+ ),
42+ ),
43+ direction: DismissDirection .startToEnd,
44+ onDismissed: (direction) {
45+ print ("Dissmiss" );
46+ _key.currentState.dispose ();
47+ }),
48+ );
49+ }
50+ }
Original file line number Diff line number Diff line change 1+ ///
2+ /// Created by NieBin on 2019/6/12
3+ /// Github: https://github.com/nb312
4+ /// Email: niebin312@gmail.com
5+
6+ import "package:flutter/material.dart" ;
7+ import "package:flutter_widgets/const/_const.dart" ;
8+
9+ class GesturePage extends StatefulWidget {
10+ @override
11+ _GestureState createState () => _GestureState ();
12+ }
13+
14+ class _GestureState extends State <GesturePage > {
15+ Widget _gesture (context) => GestureDetector (
16+ child: Text ("You can tab me then look the log." ),
17+ onTap: () {
18+ print ("Hello world" );
19+ Scaffold .of (context).showSnackBar (
20+ SnackBar (
21+ content: Text ("You have click me." ),
22+ ),
23+ );
24+ },
25+ );
26+
27+ @override
28+ Widget build (BuildContext context) {
29+ return Scaffold (
30+ appBar: AppBar (
31+ title: Text (PageName .INTER_GESTURE ),
32+ ),
33+ body: Builder (
34+ builder: (context) => _gesture (context),
35+ ),
36+ );
37+ }
38+ }
Original file line number Diff line number Diff line change 33/// Github: https://github.com/nb312
44/// Email: niebin312@gmail.com
55///
6- export "DraggablePage.dart" ;
6+ export "DraggablePage.dart" ;
7+ export "GesturePage.dart" ;
8+ export "DismissiblePage.dart" ;
You can’t perform that action at this time.
0 commit comments