Code Monkey home page Code Monkey logo

hidden_drawer_menu's Introduction

Mobile Developer(Android/Flutter)

In love with solutions that fit in the palm of the hand!

hidden_drawer_menu's People

Contributors

damato3 avatar froelund avatar hugoheneault avatar rafaelbarbosatec avatar vegidio 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hidden_drawer_menu's Issues

ItemHiddenMenu's onTap function does not work

Hi,

I am using the drawer menu in my application with the default menu (close the example of the homepage), and the navigation between pages works great.

However, in the 'logout' option I need to dispatch this event in my bloc, and not navigate to any page. So I tried using onTap by calling a logout function, But when I click, nothing happens. Any ideas?


  List<ScreenHiddenDrawer> itens = new List();

  _HomeScreenState(this._user);

  @override
  void initState() {
    super.initState();
    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
          name: 'Home',
          colorLineSelected: Colors.red[700],
          selectedStyle: TextStyle(fontWeight: FontWeight.w700),
        ),
        HomeTab()));
    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
            name: 'Card',
            colorLineSelected: Colors.red[700],
            selectedStyle: TextStyle(fontWeight: FontWeight.w700)),
        cardTab()));
    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
            name: 'Offers',
            colorLineSelected: Colors.red[700],
            selectedStyle: TextStyle(fontWeight: FontWeight.w700)),
        offersTab()));
    itens.add(new ScreenHiddenDrawer(
        new ItemHiddenMenu(
          name: 'Exit',
          colorLineSelected: Colors.red[700],
          selectedStyle: TextStyle(fontWeight: FontWeight.w700),
          onTap: () {
            _exitToApp();
          },
        ),
        null));   ///i'm replace with empty container, but has the same effect
  }

  void _exitToApp() {
    ...
  }

  @override
  void dispose() {
    super.dispose();
  }

  Widget cardTab() {
    ...
  }

  Widget homeTab() {
    ...
  }

  Widget offersTab() {
    ...
  }

  @override
  Widget build(BuildContext context) {
    return HiddenDrawerMenu(
      initPositionSelected: 0,
      backgroundColorMenu: Colors.grey,
      backgroundColorAppBar: Theme.of(context).primaryColor,
      elevationAppBar: 2,
      isTitleCentered: true,
      whithAutoTittleName: true,
      screens: itens,
      backgroundColorContent: Theme.of(context).scaffoldBackgroundColor,
      enableShadowItensMenu: true,
      contentCornerRadius: 10,
      slidePercent: 60,
      verticalScalePercent: 85,
      isDraggable: true,
      curveAnimation: Curves.fastLinearToSlowEaseIn,
      enableScaleAnimin: true,
      enableCornerAnimin: true ),
    );
  }
}```

No reload on item selection??

Sorry, if this request is going as a bug, I am new and do not know how github works.

I am using this hidden_drawer_menu, I have one Pageview which gets data from the json which is first item in the menu selection.

Everytime I click on this selection, the page reloads which should not happen.

Can you please update the code to get this functionality ?
Thanks in advance !!!

How to go back to main page using arrow icon?

Hi @RafaelBarbosatec, the use case scenario is similar to the one on the official guide: https://flutter.dev/docs/cookbook/navigation/navigation-basics#interactive-example

If inside Page1 i can navigate to pageX, how can i go back to Page1 using the button in the appbar? The drawer icon should became the back button (arrow icon instead 3 lines icon), but it isn't so. Also i need the appbar on every screen, so I can't use the gestures to navigate back.

HiddenDrawer works on iPad, but has issues with iPhone and Gesture detector

Hi,.

When run app with hidden drawer on iPad it works fine, but on iPhone it shows laggy and takes much time to detect the gesture on leading action button in app bar. I don't see any error in my debug console.

iPhone 14 Pro Max iOS ver. 17.1.1
iPad Air (5. Gen) iOS ver. 17.1.1
Flutter 3.16.0

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.1.1 23B81 darwin-arm64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.84.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Not sure why, but when i run it on iPad it flawlessly detect the open and close toggle on leading icon button.

I don't have such a complicated structure, just using the basic implementation.

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

  static const routeName = '/hidden_drawer';

  @override
  State<HiddenDrawer> createState() => _HiddenDrawerState();
}

class _HiddenDrawerState extends State<HiddenDrawer> {
  List<ScreenHiddenDrawer> _pages = [];

  final menuItemTextStyle = TextStyle(
      fontWeight: FontWeight.bold, fontSize: 18, color: AppTheme.corporate500);

  final menuItemTextStyleSelected = TextStyle(
      fontWeight: FontWeight.bold, fontSize: 18, color: AppTheme.corporate500);

  @override
  void initState() {
    super.initState();
    _pages = [
      ScreenHiddenDrawer(
        ItemHiddenMenu(
          name: 'Profile',
          baseStyle: menuItemTextStyle,
          selectedStyle: menuItemTextStyleSelected,
          colorLineSelected: Colors.black,
        ),
        CustomerProfileDetail(),
      ),
      ScreenHiddenDrawer(
        ItemHiddenMenu(
          name: 'Settings',
          baseStyle: menuItemTextStyle,
          selectedStyle: menuItemTextStyleSelected,
          colorLineSelected: Colors.black,
        ),
        SettingsPage(),
      ),
    ];
  }

  @override
  Widget build(BuildContext context) {
    return HiddenDrawerMenu(
      // elevationAppBar: 10,
      disableAppBarDefault: false,
      backgroundColorMenu: Theme.of(context).scaffoldBackgroundColor,
      screens: _pages,
      initPositionSelected: 1,
      slidePercent: 60,
      contentCornerRadius: 24,
    );
  }
}

Configurable _AnimatedDrawerContentState

Thanks for a great library - I certainly enjoy it!

In order to customise the look of the "open menu", I would like for slideAmount contentScale and cornerRadius to be configurable.

Page is disappearing using perspective and latest Flutter version.

Thanks for this awesome package!

Page disapears on latest Flutter version.

Flutter (Channel beta, v1.1.8, on Mac OS X 10.14.2 18C54, locale pt-BR)
hidden_drawer_menu 0.5.0

Simulate:
Just update flutter (Beta channel) and set 'enablePerspective' to true (version 0.5.0).

screenshot_1549048651

Question About Project License

Loving the work you've done here. I've been using your project and it's pretty awesome. Just wanted to bring up something that's been bugging me a bit - the license format.

Having a clear license is super important and makes it easy for everyone to know where they stand. I noticed that your license info is not so clear. Could you guys make it simpler to understand? Maybe in the readme file or somewhere else in the docs?

By the way, ever thought about monetizing your SDK/API with https://eartho.world? It helps with setting up license-based billing super easily. Might be something to check out.

How to pass controller toggle to another file?

Hi,

I want to pass my controller toggle (which is in the example custom menu script,) to another file so it will open and close my sliding menu.

Effectively I have disabled the app bar from being forced onto every screen it goes to, but I still want the feature of toggling the controller from the app bar

How would I be able to pass this to my second script?

Can post code below if anyone needs it!

Thanks
@RafaelBarbosatec

Support for orientation change

Currently on device orientation change event drawer is not recalculate slide percentage. If initial orientation was landscape and after startup we change orientation to portrait, "content" widget even not visible on the screen.

OrientationBuilder(
      builder: (context, orientation) {
         return ...;
}

Need to use OrientationBuilder inside hidden_drawer_menu, using it outside does not change "content" position

Gesture

is there a way to disable gestures on the pop up page?

SimpleHiddenDrawerController.of(context).setSelectedMenuPosition(SharedPref.getPreviousPosition(),openMenu: false); not working

Hi there, I am using your package in my application. The issue is that there's no implementation for the Routes. The problem is that our junior programmer who was tasked with this package sure that it's fine. but now it's not working.

1st issue the 2nd approach you've mentioned in your package takes screen as a widget. It's one screen per widget. How are we supposed to make it work with a bottom navigation bar? The package doesn't work with Routes.

I tried an approach of using Shared Preference and storing the current position of the Drawer's Current screen before moving to other. So I can use the value from Shared preference and set the selected position by using SimpleHiddenDrawerController.of(Context).setPosition.

image

Here you can see the snippet of how I am storing the value

image

Here you can see the way I am setting the selected position

The issue itself

When I set Position of the Drawer instead of moving to that screen the button opens up the Drawer menu itself!!!!

Dragg from right

I want to dragg from right when i have typeOpen: TypeOpen.FROM_RIGHT,

menu close

There is too much resistance to closing the menu

Keeping each ScreenHiddenDrawer alive?

Each of the ScreenHiddenDrawer is rebuilding each time I change the the screen from the drawer. How can stop rebuilding it? Tried to include automatickeepalivemixin in each of the screens but not working!

A package may not list itself as a dependency.

I try to use this plugin, but I get the following error:

[hidden_drawer_menu] flutter pub get
Running "flutter pub get" in hidden_drawer_menu...
Resolving dependencies...
Error on line 12, column 3 of pubspec.yaml: A package may not list itself as a dependency.
   ╷
12 │   hidden_drawer_menu: ^3.0.1
   │   ^^^^^^^^^^^^^^^^^^
   ╵
pub get failed
command: "C:\flutter\bin\cache\dart-sdk\bin\dart __deprecated_pub --directory . get --example"
pub env: {
  "FLUTTER_ROOT": "C:\flutter",
  "PUB_ENVIRONMENT": "vscode.dart-code:flutter_cli:get",
  "PUB_CACHE": "C:\Users\User\AppData\Local\Pub\Cache",
}
exit code: 65

exit code 65

My workspace:

Flutter 3.7.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 12cb4eb7a0 (2 weeks ago) • 2023-03-01 10:29:26 -0800
Engine • revision ada363ee93
Tools • Dart 2.19.3 • DevTools 2.20.1

AppBar doesn't update on Theme Changed

Hi. I was trying to redraw / update my AppBar backgroundColor but it doesn't rebuild itself when I toggle() my current Theme colors. AppBar only rebuilds itself with Hot Restart.

I tried:

  • setState
  • Provider
  • Inherited Widget
  • Hardcoding bool value and ternary operator to change background color, doesn't work either
  • Inheritance from another class
  • Passing values in constructor
  • Builder & StatefulBuilder

It only rebuilds itself with the provided values when I re Run the app | Hot Restart.

How can I rebuild this HiddenDrawerMenu when the color value has changed (with Provider for state management)?

return HiddenDrawerMenu( backgroundColorAppBar: myColor, // -> This doesn't change backgroundColorMenu: myColor, // -> This works fine screens: mynewList); }

hidden_drawer.dart

Thank you, guys.

Should set a screen without opening the menu

Hi.

In some cases, I should open some screens which are on the menu. If I open these screens using Navigator.push(), menu will not be shown. So, to handle this problem, I use SimpleHiddenDrawerProvider.of(context).setSelectedMenuPosition(). But everytime I use setSelectedMenuPosition(), it opens the menu. I should set screen without opening the menu for these kind of cases.

The named parameter 'colorTextUnSelected' isn't defined.

The named parameter 'colorTextUnSelected' isn't defined.
Try correcting the name to an existing named parameter, or defining a new parameter with this name.

code at the demo

I am a newbie, I don't know much. If you have time, help me. If you don't have time, it doesn't matter, just close the question.
image

How make a custom menu page?

I am trying to use the following code:

screenSelectedBuilder: (position) {
switch(position){
case 0 : return Page1(); break;
case 1 : return Page2(); break;
case 2 : return Page3(); break;
}
},
but it marks me error.
I'm guiding myself on the readme

appBar customisation

I don't know if this is the right place to post this, but I love your plugin and I'm wondering if it's possible to implement more customisation for the appbar. Now it's possible to set the appbar color etc. but this is for all the appbars. Would it be possible to set a different color for every 'screen'? Or would it else be possible to open/close the menu from a standard scaffold appbar?

Centered title on AppBar

First, I loved implementing your menu. It's really great.

But I want to center out the title of the AppBar like I do with the 'centerTitle' attribute.

Would be nice to have :)

Does not work in android release

When building an APK with the command, the drawer menu does not work. The menu does not move to the side as expected, but instead says on the left. The content does seem to scale,as well as the borders round.

Steps to reproduce:

cd example
flutter build apk --release
adb install build/app/outputs/apk/release/app-release.apk

Selected Screen (Current Screen) is intractable

Hello guys,
I've started to use the fabulous Hidden Drawer Menu, but my problem is that, while the menu is opened screen on the right is intractable.
What could I do to prevent it from interacting?
I want it opened if the user tapped on it.

Kind Regards

Integration with Maps

Hi,

I'm trying to integrate a SimpleHiddenDrawer widget with a GoogleMaps in the main screen.
Problem is that the GestureDetector prevents the map to be draggable, i've set the isDraggable to false but that doesn't work, the GestureDetector still gets the dragging events.

As a work around, i've altered a bit the animated_drawer_content.dart file to avoid the GestureDetector catching dragging events if the isDraggable flag is true.

Do you have another solution for this?

Thank you.

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.