sidebar_drawer 0.0.1+2 copy "sidebar_drawer: ^0.0.1+2" to clipboard
sidebar_drawer: ^0.0.1+2 copied to clipboard

A custom drawer for web and mobile which adapts itseld based on the the screen size.

example/lib/main.dart

import 'package:example/customDrawer.dart';
import 'package:flutter/material.dart';
import 'package:sidebar_drawer/sidebar_drawer.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      //  body: Bodyy(),
      body: SidebarDrawer(
        drawer: CustomDrawer(),
        body: Column(
          children: [
            AppBar(
              leading: DrawerIcon(),
            ),
            MainBody(),
          ],
        ),
      ),
    );
  }
}

class MainBody extends StatelessWidget {
  const MainBody({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    print('main body rebuild');
    return const Center(
      child: Text(
        'This is a page',
      ),
    );
  }
}
11
likes
140
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

A custom drawer for web and mobile which adapts itseld based on the the screen size.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter, provider

More

Packages that depend on sidebar_drawer