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

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

Open
chrisokwakol opened this issue Dec 19, 2023 · 4 comments

Comments

@chrisokwakol
Copy link

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
`

@sososdk
Copy link
Owner

sososdk commented Dec 19, 2023

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

@chrisokwakol
Copy link
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

@chrisokwakol
Copy link
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,
  );
}`

@dev-thinks
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants