Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backgroundColor should be a widget instead of Color #39

Closed
huteri opened this issue Jan 28, 2021 · 8 comments
Closed

backgroundColor should be a widget instead of Color #39

huteri opened this issue Jan 28, 2021 · 8 comments

Comments

@huteri
Copy link

huteri commented Jan 28, 2021

======== Exception caught by widgets library =======================================================
The following _TypeError was thrown building ResponsiveWrapper(dirty, state: _ResponsiveWrapperState#c9032):
type 'Color' is not a subtype of type 'Widget'

The relevant error-causing widget was: 
  ResponsiveWrapper file:///Users/huteri/flutter/.pub-cache/hosted/pub.dartlang.org/responsive_framework-0.0.14/lib/responsive_wrapper.dart:119:12
When the exception was thrown, this was the stack: 
#0      _ResponsiveWrapperState.build (package:responsive_framework/responsive_wrapper.dart:484:5)
#1      StatefulElement.build (package:flutter/src/widgets/framework.dart:4744:28)
#2      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4627:15)
#3      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4800:11)
#4      Element.rebuild (package:flutter/src/widgets/framework.dart:4343:5)
...
====================================================================================================
 /// First frame initialization default background color.
  /// Because layout initialization is delayed by 1 frame,
  /// a solid background color is displayed instead.
  /// Default white.
  final Color backgroundColor;

Used here as widget instead of color

return (screenWidth ==
            0) // Initialization check. Window measurements not available until postFrameCallback.
        ? (widget.backgroundColor ??
            Container(
                color: Color(
                    0xFFFFFFFF))) // First frame empty background color or default white.
        : InheritedResponsiveWrapper(
@rayliverified
Copy link
Contributor

Thank you for catching this error!

@huteri
Copy link
Author

huteri commented Jan 31, 2021

You are welcome @searchy2. Any plan to release this fix?

@rayliverified
Copy link
Contributor

I would like to batch the fix with some other fixes for a package release.
I'll push a fix for this bug and you can use it directly via Git import in a bit.

@rayliverified
Copy link
Contributor

rayliverified commented Feb 2, 2021

Fixed via c55ab5c

For now, you can use the fix on the latest branch with:

responsive_framework:
    git:
      url: https://github.com/Codelessly/ResponsiveFramework.git
      ref: master

@huteri
Copy link
Author

huteri commented Feb 9, 2021

thanks @searchy2 appreciate it.

@SdxCoder
Copy link

SdxCoder commented Feb 19, 2021

@searchy2 When the fix will be pushed to pub dev. Need to use this in a production app.

@rayliverified
Copy link
Contributor

@SdxCoder I'm fixing one more bug and then I'll release a fix.
Thank you for your patience.

@rayliverified
Copy link
Contributor

rayliverified commented Mar 3, 2021

Fix is now available in v0.0.15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants