bluemix / Gradient-Widgets

Flutter widgets wrapped with gradients
Apache License 2.0
348 stars 48 forks source link

'elevation != null && elevation >= 0.0': is not true. #5

Closed mkwsra closed 5 years ago

mkwsra commented 5 years ago

I can't use a simple circular button as shown here:

CircularGradientButton(
              child: Icon(Icons.add_location, size: 32.0),
              callback: (){},
            ),

I's immediately throwing an error as listed and shown here:

A piece of the exception message
I/flutter (29912): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (29912): The following assertion was thrown building CircularGradientButton(dirty, dependencies:
I/flutter (29912): [_LocalizationsScope-[GlobalKey#36ec3], _InheritedTheme], state:
I/flutter (29912): _CircularGradientButtonState#a3b0e(ticker inactive)):
I/flutter (29912): 'package:flutter/src/material/floating_action_button.dart': Failed assertion: line 85 pos 15:
I/flutter (29912): 'elevation != null && elevation >= 0.0': is not true.
I/flutter (29912): 
I/flutter (29912): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (29912): more information in this error message to help you determine and fix the underlying cause.
I/flutter (29912): In either case, please report this assertion by filing a bug on GitHub:
I/flutter (29912):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter (29912): 
I/flutter (29912): When the exception was thrown, this was the stack:
I/flutter (29912): #2      new FloatingActionButton (package:flutter/src/material/floating_action_button.dart:85:15)
I/flutter (29912): #3      _CircularGradientButtonState.build (package:gradient_widgets/src/circular_gradient_button.dart:87:16)
I/flutter (29912): #4      StatefulElement.build (package:flutter/src/widgets/framework.dart:3825:27)
I/flutter (29912): #5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3736:15)
I/flutter (29912): #6      Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
I/flutter (29912): #7      StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
I/flutter (29912): #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
I/flutter (29912): #9      RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4601:32)

image

bluemix commented 5 years ago

I've updated the package to 0.4.1, that has a fix to this bug, and now the pub package is in the awaiting state. thanks @mkwsra for reporting the issue