Skip to content

backgroundColor should be a widget instead of Color #39

@huteri

Description

@huteri
======== 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(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions