retroportalstudio / focused_menu Goto Github PK
View Code? Open in Web Editor NEWThis is a repository for Flutter Focused Menu, an easy to implement package for adding Focused Long Press Menu to Flutter Applications
License: MIT License
This is a repository for Flutter Focused Menu, an easy to implement package for adding Focused Long Press Menu to Flutter Applications
License: MIT License
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
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
I want to change trailing Icon as i want, the widget that "trailing Icon" get only "Icon" widget, but i want to add "Container" widget. How can i do that?
So this package triggers the focused animation when we click on the gridtile, anywhere on the gridtile. I would want the animation to only trigger if the user taps on a small icon, like a menu item. is that possible?
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
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.
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.
Edge: On same screen, user taps menu button and you can see the menu.
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))
],
),
],
),
),
),
)
],
),
),
),
)
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).
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'
Kindly add callbacks for when the menu appears and the menu disappears from the screen.
How can i change to show foucused menu when onLongPress event
This package should be migrated to null safety so that other apps and packages depending on it can (more easily) migrate to null safety as well.
Do you have any plans for this?
Thanks.
Related links:
https://dart.dev/null-safety/migration-guide
https://www.youtube.com/watch?v=bvq7wbn4VAA&ab_channel=Flutter
Is it possible to bring up the menu on longPress only?
Add an option to add haptic feedback when opening a focused menu
openWithTap is not opening menuItems
It only call onPress Function
focused_menu use olde flutter version
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.
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!
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.