Git Product home page Git Product logo

floatingactionbubble's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

floatingactionbubble's Issues

iconColor changes background and not icon color

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!!!

Why Bubble isn't a Widget?

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.

some Personalization

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 :)

Tried calling: dependOnInheritedWidgetOfExactType<_EffectiveTickerMode>()

======== 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>()

The relevant error-causing widget was:
MaterialApp file:///D:/MyProjects/Chromatic%20App/chromatic-app/lib/main.dart:52:12
When the exception was thrown, this was the stack:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 TickerMode.of (package:flutter/src/widgets/ticker_provider.dart:61:50)
#2 SingleTickerProviderStateMixin.didChangeDependencies (package:flutter/src/widgets/ticker_provider.dart:163:36)
#3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4724:11)
#4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4540:5)

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)

Multiple instances of FloatingActionBubble

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

rtl Directionality Support

When surrounding a page with Directionality(textDirection: TextDirection.rtl, ...., the animation breaks down.
The still bubbles come from left to right and are being cut from the right.
WhatsApp Image 2020-08-29 at 7 10 41 PM

User is forced to use AnimatedIcon

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,
),

Dynamic fab animation

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:

Floating action bubble
bubble

Standard floating action button
fab

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.