I'm trying to build an app where you could open a drawer and scroll only content below DrawerHeader(). When I have DrawerHeader as a child of ListView, naturally it scrolls with the whole list. I've tried
Drawer(child:Column(children: <Widget>[DrawerHeader(), ListView()]))
but seems that it crashes the app.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
drawer: Drawer(
child: ListView(
children: <Widget>[
DrawerHeader(
child: Text('Projects related tools'),
decoration: BoxDecoration(color: Colors.blue),
),
ExpansionTile(
title: Text('Project 1'),
children: <Widget>[
Text('Property 1'),
Text('Property 2'),
],
),
],
),
),
body: SafeArea(child: ListView()),
));
}
}