Skip to content

Instantly share code, notes, and snippets.

@celesteking
Created August 5, 2020 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celesteking/f3322ab7c0e77d50693545ab6f2b3d4a to your computer and use it in GitHub Desktop.
Save celesteking/f3322ab7c0e77d50693545ab6f2b3d4a to your computer and use it in GitHub Desktop.
// 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