Giter VIP home page Giter VIP logo

focused_menu's People

Contributors

dimzeta avatar dshrinath avatar henriquezanfa avatar ignaciotcrespo avatar letsdoit07 avatar peterwvj avatar retroportalstudio avatar sijangurung avatar ttorbik 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

focused_menu's Issues

Clicked Image Isn't showing in PopUp

The clicked Image isn't showing in the pop-up.

I thought it was from my project, but then I cloned yours and it gave me the same issue.

I tried it on both a real device and emulator.

See screenshots

Screenshot_1679126642
Screenshot_1679126649

My flutter and dark version:
Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision eb6d86ee27 (5 months ago) • 2022-10-04 22:31:45 -0700
Engine • revision c08d7d5efc
Tools • Dart 2.18.2 • DevTools 2.15.0

Not Working in ModalBottomSheet

It seems that the feature is currently not supported in ModalBottomSheet as shown below.
I think it's because off getOffset() function but I'm still a Junior profile and can't solve it by my self.

Thanks everyone !

Issue_ex_1
issue_ex_2

onLongPress

Hi there,

I was wondering if it is possible to use the package without having to longpress a button?

I want to have the focused_menu pop up after just one click but not sure how to do this or if this is possible?

Sorry for creating an issue for this but wasn't sure how to ask this question otherwise!

Thanks in advance

menu goes behind BottomNavigation!

the focused menu goes behind bottomNavigation .
Do you have a solution for it ?
The problem is if there is bottomnavigation, the focused_menu comes below the last item and is displayed behind the bottomnavigation.

Some users on Chrome cannot see the menu options, but Edge works.

Experiencing some inconsistencies on Chrome. Some users cannot see the focused menu items when tapping the focused menu holder. The overlay always appears, so it seems like it is opening, but the menu items are hidden somehow.

This is part of my code. Nothing fancy I don't think. Do I have any settings that could cause the menu items to be hidden? Could the size of a browser, the resolution, and my menuOffset or extent cause issues?

FocusedMenuHolder(
    animateMenuItems: false,
    onPressed: () {},
    openWithTap: true,
    menuOffset: 10,
    menuWidth: 550,
    menuItemExtent: 50,
    menuItems: [
      FocusedMenuItem(
          onPressed: () async {},
          title: Flexible(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                const Icon(
                  Icons.open_in_new,
                  color: Colors.white,
                ),
                const SizedBox(
                  width: 10,
                ),
                Text(
                  'LOAD ${loadButtonText.toUpperCase()}',
                  style: const TextStyle(
                    color: Colors.white,
                  ),
                ),
              ],
            ),
          ),
          backgroundColor: kAppGreenColor,
        ),
        
      FocusedMenuItem(
          onPressed: () async {},
          title: Flexible(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: const [
                Icon(
                  Icons.cloud_download,
                  color: Colors.white,
                ),
                SizedBox(
                  width: 10,
                ),
                Text(
                  'DOWNLOAD STICKER',
                  style: TextStyle(
                    color: Colors.white,
                  ),
                ),
              ],
            ),
          ),
          backgroundColor: kAppGreenColor,
        ),

      FocusedMenuItem(
          onPressed: () async {},
          title: Flexible(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: const [
                Icon(
                  Icons.cloud_download,
                  color: Colors.white,
                ),
                SizedBox(
                  width: 10,
                ),
                Text(
                  'DOWNLOAD HIGH RESOLUTION IMAGE',
                  style: TextStyle(
                    color: Colors.white,
                  ),
                ),
              ],
            ),
          ),
          backgroundColor: kAppGreenColor,
        ),
    ],
    child: Container(
      height: 40,
      decoration: BoxDecoration(
        color: kAppRedColor,
        borderRadius: BorderRadius.circular(4),
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: const [
          Icon(
            Icons.menu,
            color: Colors.white,
          ),
          SizedBox(
            width: 10,
          ),
          Center(
            child: Text(
              'ACTIONS',
              style: TextStyle(
                color: Colors.white,
                fontWeight: FontWeight.w800,
              ),
            ),
          ),
        ],
      ),
    ),
  ),

Chrome: User taps menu button and you can see overlay, but the menu does not appear. Note: Most users on Chrome do not have an issue.
image

Edge: On same screen, user taps menu button and you can see the menu.
image

blurBackgroundColor is not transparent

FocusedMenuHolder(
          menuWidth: MediaQuery.of(context).size.width * 0.90,
          blurSize: 5.0,
          menuItemExtent: 45,
          menuBoxDecoration: BoxDecoration(color: Colors.grey,borderRadius: BorderRadius.all(Radius.circular(15.0))),
          duration: Duration(milliseconds: 100),
          animateMenuItems: true,
          blurBackgroundColor: Color.fromRGBO(234, 111, 25, 0.2),
          menuItems: <FocusedMenuItem>[
            FocusedMenuItem(title: Text("Open"),trailingIcon: Icon(Icons.open_in_new) ,onPressed: (){
              //Navigator.push(context, MaterialPageRoute(builder: (context)=>ScreenTwo()));
            }),
            FocusedMenuItem(title: Text("Share"), trailingIcon: Icon(Icons.share) ,onPressed: (){}),
            FocusedMenuItem(title: Text("Favorite"), trailingIcon: Icon(Icons.favorite_border), onPressed: (){}),
            FocusedMenuItem(title: Text("Delete", style: TextStyle(color: Colors.redAccent),), trailingIcon: Icon(Icons.delete,color: Colors.redAccent,) ,onPressed: (){}),
          ],
          onPressed: (){},
          child: Padding(
            //key: ValueKey("$index"),
            padding: const EdgeInsets.all(8.0),
            child: Container(
                width: MediaQuery.of(context).size.width,
                height: MediaQuery.of(context).size.height * 0.13,
                color: whiteBG,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                  children: [
                    _showChecks ?
                    Container(
                      width: MediaQuery.of(context).size.width * 0.05,
                      color:  Colors.transparent,
                      child: InkWell(
                        onTap: (){
                          setState(() {
                            Customer.allCustomers[index].selected = Customer.allCustomers[index].selected ? Customer.allCustomers[index].selected = false : Customer.allCustomers[index].selected = true;
                          });
                        },
                        child: Container(
                          decoration: BoxDecoration(
                              shape: BoxShape.circle,
                              color: Customer.allCustomers[index].selected ? mainColor : Colors.transparent,
                              border: Border.all(color: grey, width: 1.0)
                          ),
                        ),
                      ),
                    )
                        :
                    Container(),
                    InkWell(
                      onDoubleTap: (){
                        setState(() {
                          _showChecks = _showChecks ? _showChecks = false : _showChecks = true;
                        });
                      },
                      child: Container(
                        width: _showChecks ? MediaQuery.of(context).size.width * 0.85 : MediaQuery.of(context).size.width * 0.95,
                        //color: Colors.deepPurple,
                        decoration: BoxDecoration(
                          color: Color(0x0d1c63ba),
                          borderRadius: BorderRadius.all(Radius.circular(20.0),),
                        ),
                        child: Padding(
                          padding: const EdgeInsets.only(left: 20.0, right: 10.0, top: 20.0),
                          child: Row(
                            mainAxisSize: MainAxisSize.max,
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                mainAxisAlignment: MainAxisAlignment.start,
                                children: [
                                  Text(Customer.allCustomers[index].firstName + " " + Customer.allCustomers[index].lastName,
                                    style: TextStyle(fontFamily: 'PoppinsSemiBold'),),
                                  Text(Customer.allCustomers[index].email),
                                  Text(Customer.allCustomers[index].phoneNumber,
                                      style: TextStyle(fontFamily: 'PoppinsSemiBold', color: mainColor))
                                ],
                              ),
                            ],
                          ),
                        ),
                      ),
                    )
                  ],
                ),
              ),
          ),
        )

Add curve to opening animation

Would be great if you could add a customizable curve to the opening animation so we can adjust it to our likening (i.e.: Curves.elasticOut to have a nice bouncy effect).

Expected a value of type 'SkDeletable', but got one of type 'Null'

With the update to Flutter 1.26.0-17.8.pre on beta channel with flutter web, on long press you get the following error:

======== Exception caught by widgets library =======================================================
The following TypeErrorImpl was thrown building FocusedMenuDetails(dirty, dependencies: [MediaQuery]):
Expected a value of type 'SkDeletable', but got one of type 'Null'

The relevant error-causing widget was:
GetMaterialApp file:///C:/source/AndroidStudioProjects/orpheus/lib/main.dart:42:12
When the exception was thrown, this was the stack:
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 236:49 throw
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 84:3 castError
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/types.dart 266:34 as
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/canvaskit/skia_object_cache.dart 146:55 new
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/canvaskit/image_filter.dart 26:3 __
...

Haptic Feedback

Add an option to add haptic feedback when opening a focused menu

Possible to add a `menuItemBuilder`?

In my use case I would like to use an InkWell instead of GestureDetector as menu items, since I would like ink splash effects when users press on it.
I think a menuItemBuilder should be helpful and make more customizations possible.

Keep menu opened

Is there a way to keep the menu opened when I click on a FocusedMenuItem?
I have a "Like" item, and I would like to keep it open if the user click it.

Thanks!

Quesition: change gesture to activiate

Hi. thanks for creating this, works great.
I do have a question on how I would be able to change the activation from a long-press to a tap?
I didn't see a configuration for it, but I do notice an onPressed in the FocusedMenuHolder and was wondering if there was a way to use that to display the menu on tap instead of long-press.

Any suggestions would be really appreciated.
thanks!

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.