Skip to content

Error: The argument type 'BorderRadius?' can't be assigned to the parameter type 'BorderRadiusGeometry' #72

Open

Description

@chrisokwakol

Trying to run my app with 'flutter run' produces this error:

`../../../../.pub-cache/hosted/pub.dev/flash-2.0.5+1/lib/flash.dart:534:30: Error: The argument type 'BorderRadius?' can't be assigned to the parameter type 'BorderRadiusGeometry' because 'BorderRadius?' is nullable and 'BorderRadiusGeometry' isn't.

  • 'BorderRadius' is from 'package:flutter/src/painting/border_radius.dart' ('../../../../../Chris/Desktop/flutter/flutter/packages/flutter/lib/src/painting/border_radius.dart').
  • 'BorderRadiusGeometry' is from 'package:flutter/src/painting/border_radius.dart' ('../../../../../Chris/Desktop/flutter/flutter/packages/flutter/lib/src/painting/border_radius.dart').
    borderRadius: widget.borderRadius,
    ^
    Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/Chris/Desktop/flutter/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1350

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/Users/Chris/Desktop/flutter/flutter/bin/flutter'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 13s
Running Gradle task 'assembleDebug'... 14.3s
Exception: Gradle task assembleDebug failed with exit code 1
`

Activity

  1. sososdk commented on Dec 19, 2023

    @sososdk
    Owner

    I don't think this is a issue with flash .

  2. chrisokwakol commented on Dec 19, 2023

    @chrisokwakol
    Author

    I'm new to flutter but based on what I've been reading and this error path '../../../../.pub-cache/hosted/pub.dev/flash-2.0.5+1/lib/flash.dart:534:30:' it looks kind of similar to this issue ReinBentdal/division#75

  3. chrisokwakol commented on Dec 20, 2023

    @chrisokwakol
    Author

    Adding this line fixed the issue :
    ` @OverRide
    Widget build(BuildContext context) {
    Widget child = widget.child;

    if (widget.borderRadius != null) {
      child = ClipRRect(
        // borderRadius: widget.borderRadius,
        borderRadius: widget.borderRadius ?? BorderRadius.zero, // add a default wherever BorderRadius? is used
        child: child,
      );
    }`
    
  4. dev-thinks commented on Mar 7, 2024

    @dev-thinks

    I don't think this is a issue with flash .

    @sososdk
    yes it is coming out from this plugin.

    @chrisokwakol can you please guide on the workaround for this issue. where to add the override build function,

    thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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