Code Monkey home page Code Monkey logo

resfandiari / flutter_side_menu Goto Github PK

View Code? Open in Web Editor NEW
41.0 2.0 22.0 445 KB

Flutter's full customizable side menu has been used as a directory for Related Pages, Navigation Items, and more.

Home Page: https://pub.dev/packages/flutter_side_menu

License: BSD 3-Clause "New" or "Revised" License

Kotlin 0.13% Swift 1.17% Objective-C 0.04% Dart 56.02% CMake 18.28% C++ 21.09% C 1.44% HTML 1.84%
flutter menu menu-navigation menubar sidemenu web

flutter_side_menu's People

Contributors

binhodev avatar markfili avatar resfandiari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_side_menu's Issues

There is not some features

I want to use this library but I cant find some features. I made several features by some third part ways but others I cant. First there is not way to close drawer whole close, I change min width to zero but it return error. Second there is not onToggle method to listen drawer. There is not isOpen method. There is not expandable menu item group. How to disable linear view on left side of selected item. items only accept SideMenuItemDataTile not widget. When header and footer is not enabled, items move to top, how to set in center.

My code is below :

import 'package:flutter/material.dart';
import 'package:flutter_side_menu/flutter_side_menu.dart';
import 'package:flutter_svg/svg.dart';

import 'my_input_theme.dart';

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

const primaryColor = Color(0xFF2697FF);
const secondaryColor = Color(0xFF2A2D3E);
const bgColor = Color(0xFF212332);

class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);

@OverRide
State createState() => _MyAppState();
}

class _MyAppState extends State {
final List headerTitle = [
"Dashboard",
"Sensors",
"Equipments",
"Alerts Log",
"Notification Delivery Logs",
"Equipment and Sensor map",
"Maintenance",
];

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: bgColor,
canvasColor: secondaryColor,
inputDecorationTheme: MyInputTheme().theme(),
),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Row(
children: [
SideMenu(
hasResizer: false,
resizerToggleData: const ResizerToggleData(iconColor: Colors.white, opacity: 1, iconSize: 24),
maxWidth: 280,
minWidth: 50,
controller: GlobalVars.controller,
backgroundColor: secondaryColor,
mode: SideMenuMode.open,
builder: (data) {
return SideMenuData(
header: SizedBox(
height: 200,
child: DrawerHeader(
child: Image.asset("assets/images/main_logo.png",
fit: BoxFit.fitHeight),
),
),
items: [
for (int i = 0; i < headerTitle.length; i++)
drawerListTileSvg(
title: headerTitle.elementAt(i),
svgSrc: "assets/icons/side_menu
${i + 2}.svg",
index: i,
),
],
);
},
),
Expanded(
child: Container(
color: bgColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
GlobalVars._controller.toggle();
},
child: const Text('change side menu state'),
)
],
),
),
),
],
),
),
);
}

SideMenuItemDataTile drawerListTileSvg(
{required String title, required String svgSrc, required int index}) {
return SideMenuItemDataTile(
isSelected: GlobalVars.selectedMenuItem == index,
onTap: () => setState(() => GlobalVars.selectedMenuItem = index),
title: title,
selectedTitleStyle: const TextStyle(color: Colors.white70, fontSize: 20),
icon: Padding(
padding: const EdgeInsets.all(6),
child: SvgPicture.asset(
svgSrc,
color: Colors.white54,
),
),
highlightSelectedColor: Colors.grey.withOpacity(0.1),
hoverColor: Colors.grey.withOpacity(0.05),
selectedIcon: Padding(
padding: const EdgeInsets.all(4),
child: SvgPicture.asset(
svgSrc,
color: Colors.blue,
),
),
titleStyle: const TextStyle(color: Colors.white54, fontSize: 18),
);
}
}

class GlobalVars {
static var selectedMenuItem = 0;
static final _controller = SideMenuController();
}

"titleStyle" cant change text color

I try to change text color to Colors.amber but it's still black.

SideMenuItemDataTile(
isSelected: _currentIndex == 3,
onTap: () => setState(() => _currentIndex = 3),
title: 'Demo',
icon: const Icon(Icons.car_crash),
titleStyle: GoogleFonts.notoSansThai(
textStyle: const TextStyle(
fontSize: 14,
color: Colors.amber,
),
),
),

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.