drawer_pro 0.0.4
drawer_pro: ^0.0.4 copied to clipboard
A high-performance, parallax slide drawer inspired by Gemini, ChatGPT, and Marks. Features smooth 60fps animations, custom curves, and effortless integration.
import 'package:flutter/material.dart';
import 'package:drawer_pro/drawer_pro.dart'; // <--- This is your package!
void main() {
runApp(const MaterialApp(home: TestMyPackage()));
}
class TestMyPackage extends StatelessWidget {
const TestMyPackage({super.key});
@override
Widget build(BuildContext context) {
return DrawerPro(
// 1. Define your Drawer Menu
drawer: Container(
color: const Color(0xFF1E1E1E), // Dark background like Gemini
child: ListView(
padding: const EdgeInsets.all(20),
children: const [
DrawerHeader(
child: Text(
"My Drawer Pro",
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
ListTile(
leading: Icon(Icons.chat_bubble, color: Colors.white),
title: Text("Chat", style: TextStyle(color: Colors.white)),
),
ListTile(
leading: Icon(Icons.settings, color: Colors.white),
title: Text("Settings", style: TextStyle(color: Colors.white)),
),
],
),
),
// 2. Define your Main Screen
child: Scaffold(
appBar: AppBar(
title: const Text("Testing Drawer Pro"),
leading: Builder(
builder: (context) {
return IconButton(
icon: const Icon(Icons.menu),
// 3. Open the drawer using your package's method
onPressed: () => DrawerPro.of(context)?.open(),
);
},
),
),
body: const Center(
child: Text(
"Swipe from left or click menu!",
style: TextStyle(fontSize: 18),
),
),
),
);
}
}