Skeleton-Text
Skeleton-Text copied to clipboard
Fix 'BorderRadius?' can't be assigned to the parameter type 'BorderRadiusGeometry' error on 3.12.0-1.1.pre
Thank you for your work and I really love this package!
I'm using Flutter Channel beta, 3.12.0-1.1.pre. The following error occured when I tried to run my project using skeleton_text 3.0.0
:
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
../lib/skeleton_text.dart:70:49: 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' ('/E:/flutter/packages/flutter/lib/src/painting/border_radius.dart').
- 'BorderRadiusGeometry' is from 'package:flutter/src/painting/border_radius.dart' ('/E:/flutter/packages/flutter/lib/src/painting/border_radius.dart').
borderRadius: widget.borderRadius as BorderRadius?,
^
To reproduce, just use the example in this package. (Since the example in this package was too old to run, so I re-generate the example
directory to make it runable.)
After a quick search, I found this Flutter PR: Fix nullability of ClipRRect.borderRadius, and it was merged since Flutter channel beta 3.12.0, commit 8fcb74d. So I simply deleted as BorderRadius?
in lib/skeleton_text.dart
to make it work on 3.12.0-1.1.pre.
Since it was fixed in Flutter 3.12.0 and this version is still in beta channel, so I also made a limitation, flutter: ">=3.12.0-0.0.pre"
, in pubspec.yaml
. SDK version number was set to sdk: ">=2.12.0 <4.0.0"
to upgrade to Dart 3.x.
Could you please check this PR and consider releasing a new version? Thanks!
This error now occurs when using the stable version of Flutter (3.13).
Can you resolve the conflict @Foldblade ?
@iamhssingh Hello, I've solve the conflict. Please take a look 😉