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

After flutter upgrade, I've got this error #75

Open
just-abdul1ah opened this issue Sep 18, 2023 · 2 comments
Open

After flutter upgrade, I've got this error #75

just-abdul1ah opened this issue Sep 18, 2023 · 2 comments

Comments

@just-abdul1ah
Copy link

/C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dev/division-0.9.0/lib/src/build.dart:100:48: 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' ('/D:/src/flutter/packages/flutter/lib/src/painting/border_radius.dart').
    border_radius.dart:1

  • 'BorderRadiusGeometry' is from 'package:flutter/src/painting/border_radius.dart' ('/D:/src/flutter/packages/flutter/lib/src/painting/border_radius.dart').
    border_radius.dart:1
    borderRadius: decoration?.borderRadius as BorderRadius?,
    ^

Target kernel_snapshot failed: Exception

@justoke
Copy link

justoke commented Oct 10, 2023

After upgrading Flutter to 3.13.6 from 3.7.1, I get the same error

@justoke
Copy link

justoke commented Oct 10, 2023

@just-abdul1ah
I got around this by just modifying the build.dart file from the flutter cache, allowing me to build it. I'd suggest this as a workaround. I'll submit a pull request when I can get round to it.

Basically, you need to add a default wherever BorderRadius? is used:
youruserfolder\AppData\Local\Pub\Cache\hosted\pub.dev\division-0.9.0\lib\src\build.dart

Replace all instances of
BorderRadius?,
with
BorderRadius? ?? BorderRadius.circular(0.0),
image

I have no idea if the constant I used is suitable for all scenarios, but alternatively you could use:
BorderRadius ?? BorderRadius.zero,

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

2 participants