marianocordoba / fab-circular-menu Goto Github PK
View Code? Open in Web Editor NEWA Flutter package to create a nice circular menu using a Floating Action Button.
Home Page: https://pub.dev/packages/fab_circular_menu
License: MIT License
A Flutter package to create a nice circular menu using a Floating Action Button.
Home Page: https://pub.dev/packages/fab_circular_menu
License: MIT License
when i set builder: (context) => FabCircularMenu( key: fabKey, // Cannot be
Alignment.centeralignment: **Alignment**(0.8,0.8), ringColor: Colors.white, ringDiameter: 500.0, ringWidth: 120.0, fabSize: 64.0, fabElevation: 8.0,
the problem is FabCircularMenu's children widget is disorder.
if the plugin can support floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked argment , it will be perfect project .
Hey! Congrats for this project! It's unique at this time!
2 This is the code structure:
`floatingActionButton: FabCircularMenu(
alignment: Alignment.bottomRight,
ringWidth: 130,
children: <Widget>[
IconButton(
iconSize: 40,
icon: Icon(
Icons.home,
),
onPressed: () {
print('Home');
}),
IconButton(
iconSize: 40,
icon: Icon(
Icons.favorite,
size: 40,
),
onPressed: () {
controller.go2List();
print('GoToLists');
}),
IconButton(
iconSize: 40,
icon: Icon(
Icons.favorite,
size: 40,
),
onPressed: () {
print('Favorite');
}),
IconButton(
iconSize: 40,
icon: Icon(
Icons.favorite,
size: 40,
),
onPressed: () {
print('Favorite');
}),
IconButton(
iconSize: 40,
icon: Icon(
Icons.favorite,
size: 40,
),
onPressed: () {
print('Favorite');
}),
],
ringColor: Color.fromARGB(70, 255, 255, 255),
),`
I tried to create a Column widget with the Icon and the Text widget, but then the button would be placed in a random place far away from where it was supposed to. I even tried the column as a child of the RawMaterialButton, but same result.
Is it possible to add text below the icon with this package? I would love know. Great package thanks for the content!
could yuu help me how can i do that?
Hey! First of all, thanks for waiting. I've just added a
controller
property that takes aFabCircularMenuController
which allows you to control the menu programatically.final controller = FabCircularMenuController(); FabCircularMenu( child: ..., controller: controller, options: <Widget>[ IconButton(icon: Icon(Icons.widgets), onPressed: () { controller.isOpen = false; }, iconSize: 48.0, color: Colors.white), ... ], )
I will improve documentation and examples soon.
Originally posted by @marianocordoba in #4 (comment)
Hello.
I wanna be change fab close button background color.
I do not find interface to change background color.
Can you add "fabCloseColor" property ?
Best regards.
Thanks to sharing very awesome library.
I have a question
In this library how can we have more scrollable items? By default there are fixed items with counts. For example can we have 50 scrollable items?
Hi. when use it inside tab view, after change of tab, I have this exception:
Basically in this case we need use animation after dispose, any idea?
AnimationController.reverse() called after AnimationController.dispose()
AnimationController methods should not be used after calling dispose.
'package:flutter/src/animation/animation_controller.dart':
Failed assertion: line 488 pos 7: '_ticker != null'
I need this kind of radial menu but without attaching it to the floatingActionButton section but simple as interaction on a widget
Hi,
First, thanks for the nice plugin from my point of view it's a good addition when it comes to usability and quick navigation.
I'm facing an issue that the first button in my list is hidden, it is drawn under the "bottomNavigationBar" which is in my case a TabSelecgtor widget. The image below shows the situation:
This is the code of the menu, please note the page is nested into another view using Scaffold to render the above mentioned bottom bar.
Scaffold(
body: ListView(
children: listItems,
),
floatingActionButton: state is ProjectHomeEditDetailsState
? null
: Builder(
builder: (context) => FabCircularMenu(
key: fabKey,
ringWidth: 50,
alignment: Alignment(1, 1),
ringDiameter: min(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height) *
0.9,
children: <Widget>[
//Not shown
IconButton(
icon: Icon(Icons.delete_forever),
onPressed: () {},
),
// All below are shown
IconButton(
icon: Icon(Icons.edit),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.search),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.sync),
onPressed: () {},
),
],
),
),
);
Hi, I am trying out my project on Web too. Thats where I need the ringWidth. I see you get this from ringDiameter.. and that from screenWidth.
Is there any recommended way that I may get that present ringWidth? Besides doing the entire thing from scratch with Screen class??
Also, if there isnt, how may I know when the widget has finished its constructor, because thats the time I might try to trap the fabKey.currentState.widget.ringDiameter value into a double variable.
thanks,
Great package by the way!
Automatically close when user clicks menu, or button loses focus.
Since you have merged my PR would you mind updating pub.dev?
Thanks
This is because the main Container
's transform: Matrix4.translationValues(16.0, 16.0, 0.0)
does not take into account the alignment and always does the translation into one direction both axis. It should be transform: Matrix4.translationValues(16.0 * _directionX, 16.0 * _directionY, 0.0)
instead. I'll push a fix.
We need null safety support for this package. Please :)
I just wrap children in GestureDetector
so I can do something onTap
. but it's not working.
options: <Widget>[
GestureDetector(
behavior: prefix0.HitTestBehavior.opaque,
onTap: () => print('1'),
child: IconButton(
icon: Icon(Icons.widgets),
onPressed: () {},
iconSize: 48.0,
color: Colors.red,
),
),
GestureDetector(
onTap: () => print('2'),
child: IconButton(
icon: Icon(Icons.widgets),
onPressed: () {},
iconSize: 48.0,
color: Colors.white,
),
),
GestureDetector(
onTap: () => print('3'),
child: IconButton(
icon: Icon(Icons.widgets),
onPressed: () {},
iconSize: 48.0,
color: Colors.white,
),
)
],
After clicked on one menu item, I want a solution to close menu by code but I can't found anyway to do it at the moment. This feature is quite comment, I think it should be an item in wishlist features :)
Thanks for your time.
If there is only one option passed to this widget, it will crash because of this line trying to divide by zero:
final double angle = 90.0 / (widgets.length * 2 - 2) * (index * 2);
I discovered it by pressing save after adding only one option, and hot reload resulted in an error.
Currently I would like my other buttons to close when I click on the FABcircularMenu, but the widget lacks an attribute for me to have a callback, I cant do so :(
Flutter with Null safety is coming. Would be nice have support to this feature
Take a look to this document with step by step.
FabCircularMenu(...) : assert(child != null), assert(options != null && options.length > 0);
export
statements. See other libs. Currently I am unable to use your code as a lib. I rather copied the source code into my own repository instead. @override
void dispose() {
controller?.dispose();
super.dispose();
}
You may find the problem, I don't currently.
initState()
method instead: @override
void initState() {
super.initState();
controller = AnimationController(duration: widget.animationDuration, vsync: this);
}
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.