Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - Make a slide pannel looking like a Drawer

Tags:

flutter

slider

I want to make a little panel sliding from the right onPress to display some information. I already have a Drawer in my Scaffold to display a menu.

I am looking for something like this :

enter image description here

I haven't found anything yet except for Drawer

like image 853
Thomas Nicole Avatar asked Oct 21 '25 15:10

Thomas Nicole


1 Answers

You can use the drawer and endDrawer property of the Scaffold widget. The drawer slides in from the start (left) and the endDrawer slides in from the end (right). This way you can have two different drawers, one on the left side, one on the right side.

Here a quick minimal example:

Drawer Demo

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(),
        drawer: Drawer(
          child: Center(child: Text('Left!')),
        ),
        endDrawer: Drawer(
          child: Center(child: Text('Right!')),
        ),
    ),);
  }
}
like image 98
NiklasPor Avatar answered Oct 25 '25 05:10

NiklasPor