sidebarx 0.0.1 sidebarx: ^0.0.1 copied to clipboard
cros-platform sidebar menu.
import 'package:flutter/material.dart';
import 'package:sidebarx/sidebarx.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
backgroundColor: Colors.grey,
body: Row(
children: [
SidebarX(
theme: const SidebarXTheme(
decoration: BoxDecoration(
color: Colors.white,
),
),
items: [
SidebarXItem(
icon: Icons.home,
onTap: () {
debugPrint('Hello');
},
),
const SidebarXItem(icon: Icons.search),
const SidebarXItem(icon: Icons.people),
const SidebarXItem(icon: Icons.favorite),
],
),
Expanded(
child: ListView.builder(
itemBuilder: (context, index) => Container(
height: 100,
width: double.infinity,
margin: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
boxShadow: const [BoxShadow()],
),
),
),
),
],
),
),
);
}
}