Created
August 5, 2020 15:22
-
-
Save celesteking/f3322ab7c0e77d50693545ab6f2b3d4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('xx'), | |
), | |
drawer: MyDrawer(), | |
), | |
); | |
} | |
} | |
class MyDrawer extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Drawer( | |
child: ListView( | |
children: <Widget>[ | |
DrawerHeader( | |
decoration: BoxDecoration(color: Colors.blue), | |
child: Text('Drawer header') | |
), | |
GestureDetector( | |
onTap: () { | |
print('Gesture intercepted onTap!'); | |
}, | |
child: Container( | |
child: ListTile( | |
title: Text('Item 1'), | |
onTap: () { | |
print('item 1 hit'); | |
}, | |
), | |
), | |
), | |
GestureDetector( | |
behavior: HitTestBehavior.opaque, | |
child: AboutListTile( | |
applicationName: 'Super Duper App', | |
applicationIcon: FlutterLogo(), | |
icon: Icon(Icons.info), | |
), | |
onTap: () { | |
print('clicked!'); | |
Navigator.pop(context); | |
}, | |
) | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment