- flutter_svg: 2.0.0
N/A
-
color
has been deprecated inSvgPicture.asset(...)
. We will need to replace it withcolorFilter
. -
The test case in
test/features/notification/system_notification/notification_item_test
fails due to the following issues:-
The getter
pictureProvider
isn't defined for the typeSvgPicture
anymore. -
ExactAssetPicture
isn't defined anymore.Code snippet reference:
WidgetPredicate _widgetPredicate(S localization, String icon) => (Widget widget) => widget is SvgPicture && widget.semanticsLabel == localization.semanticNotificationInformationIcon && (widget.pictureProvider is sn && (widget.pictureProvider as ExactAssetPicture).assetName == notificationWarningIcon);
-
-
As per the documentation of
flutter_svg
,pictureProvider
no longer provides any kind of functionality andExactAssetPicture
belonged topictureProvider
itself. We can safely remove the line where we used it. -
replace color with colorFilter in SvgPicture.asset(...)
//before
SvgPicture.asset(
icon,
color:context.theme.base04Color,
),
//after
SvgPicture.asset(
icon,
colorFilter: ColorFilter.mode(
context.theme.base04Color,
BlendMode.srcIn),
),