darshan0 / floatingactionbubble Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
this parameter goes to
FloatingActionButton(
backgroundColor: iconColor,
....
}
and it should go to focusColor AND also provide at the same time the backgroundColor of the FloatingActionButton as a parameter too!!!
How can we open the menu bubble horizontally from right to left?
it is needed for us to understand whta is changed
FloatingActionBubble
accepts only Bubble
as items
, but Bubble
is not a widget (BubbleMenu
is) so one can not assign key
to it.
Why not make Bubble
a StatelessWidget
and get rid of BubbleMenu
?
I mean:
/// Creates a bubble item for floating action menu button.
class Bubble extends StatelessWidget {
const Bubble({
required IconData icon,
required Color iconColor,
required String title,
required TextStyle titleStyle,
required Color bubbleColor,
required this.onPress,
super.key,
}) : _icon = icon,
_iconColor = iconColor,
_title = title,
_titleStyle = titleStyle,
_bubbleColor = bubbleColor;
final IconData _icon;
final Color _iconColor;
final String _title;
final TextStyle _titleStyle;
final Color _bubbleColor;
final void Function() onPress;
@override
Widget build(BuildContext context) => MaterialButton(
shape: const StadiumBorder(),
padding: const EdgeInsets.only(top: 11, bottom: 13, left: 32, right: 32),
color: _bubbleColor,
splashColor: Colors.grey.withOpacity(0.1),
highlightColor: Colors.grey.withOpacity(0.1),
elevation: 2,
highlightElevation: 2,
disabledColor: _bubbleColor,
onPressed: onPress,
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(
_icon,
color: _iconColor,
),
const SizedBox(
width: 10.0,
),
Text(
_title,
style: _titleStyle,
),
],
),
);
}
You just use:
child: items[index],
instead of:
child: BubbleMenu(items[index]),
and it works.
It's simple as that and doesn't break compatibility.
Here are some features I suggest:
FloatingActionButton.extended
No icons for Bubble
and remove @required
I Added these parts manually so I thought you may want to implement these features so that others could use :)
As the title suggests, please update the sample code in the README section on pub.dev. There is still the old "onpress" part, which only opens the bubbles but doesn't close them.
Clicking outside the bubbles should dismiss the bubbles menu.
The FloatingActionBubble widget placed in Stack when opened overlaps the content behind it full width.
Widget build(BuildContext context) {
return Stack(
children: [
MyContentPageWidget(...),
Align(
alignment: Alignment.bottomRight,
child: FloatingActionBubble(...)
),
],
);
}
Can display the Bubble menu items under FloatingActionButton?
======== Exception caught by widgets library =======================================================
The following NoSuchMethodError was thrown building Builder:
The method 'dependOnInheritedWidgetOfExactType' was called on null.
Receiver: null
Tried calling: dependOnInheritedWidgetOfExactType<_EffectiveTickerMode>()
E/flutter (22371): [ERROR:flutter/shell/common/shell.cc(103)] Dart Unhandled Exception: Looking up a deactivated widget's ancestor is unsafe.
E/flutter (22371): At this point the state of the widget's element tree is no longer stable.
E/flutter (22371): To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method., stack trace: #0 Element._debugCheckStateIsActiveForAncestorLookup. (package:flutter/src/widgets/framework.dart:3935:9)
Hey,
First of all, thanks for your work.
Do you have any plan to develop to a null-safety version of your plugin?
The only way to close items is to click on them
the items wont disappear by clicking on fab
Also please update code sample
Thanks.
I am getting the following errors when two instances of FloatingActionBubble are used in my app. Is there anyway that we can set heroTag like we can do for FloatingActionButton?
There are multiple heroes that share the same tag within a subtree.
Within each subtree for which heroes are to be animated (i.e. a PageRoute subtree), each Hero must have a unique non-null tag.
In this case, multiple heroes had the following tag:
Here is the subtree for one of the offending heroes: Hero
Some users would like to use standard Icon instances (as the animated icon library is very restricted).
FloatingActionButton(
...
child: AnimatedIcon(
icon: icon,
progress: _animation,
),
onPressed: onPress,
),
Tried the sample code but the main open/close fab button is not rotating
Hi,
I'm using the bubble fab on page viewer that display dynamically the fab (onpagechanged).
The standard fab is fading "normally" but with floating action bubble is appearing from another place.
Is it normal? How could we have a normal fade?
Screens below:
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.