Skip to content

Instantly share code, notes, and snippets.

@creativecreatorormaybenot
Created July 10, 2019 19:39
Show Gist options
  • Save creativecreatorormaybenot/cf45daddb43280cf4038f9a5774016b8 to your computer and use it in GitHub Desktop.
Save creativecreatorormaybenot/cf45daddb43280cf4038f9a5774016b8 to your computer and use it in GitHub Desktop.
ListTile onTap
import 'package:flutter/material.dart';
main() {
runApp(
MaterialApp(
home: Scaffold(
body: Center(
child: Container(
color: Colors.greenAccent,
child: ListTile(
dense: true,
leading: Material(child: const Text('leading')),
title: Material(child: const Text('title')),
subtitle: Material(child: const Text('subtitle')),
trailing: Material(child: const Text('trailing')),
),
),
),
),
),
);
}
import 'package:flutter/material.dart';
main() {
runApp(
MaterialApp(
home: Scaffold(
body: Center(
child: Container(
color: Colors.greenAccent,
child: ListTile(
dense: true,
leading: Material(child: const Text('leading')),
title: Material(
child: InkWell(
child: Row(
mainAxisSize: MainAxisSize.min,
children: const <Widget>[Icon(Icons.format_align_left), Text('title')],
),
onTap: () {},
),
),
subtitle: Material(child: const Text('subtitle')),
trailing: Material(child: const Text('trailing')),
),
),
),
),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment