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

chore: upgrade - flutter_svg, camera #3945

Merged
merged 6 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/scanner/shared/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_svg: 1.1.6
flutter_svg: 2.0.5
visibility_detector: 0.4.0+2

dev_dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:ui' as ui;

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
Expand Down Expand Up @@ -51,7 +53,12 @@ class _SvgAsyncAssetState extends State<SvgAsyncAsset> {
snapshot.data!,
width: widget.assetCacheHelper.width,
height: widget.assetCacheHelper.height,
color: widget.assetCacheHelper.color,
colorFilter: widget.assetCacheHelper.color == null
? null
: ui.ColorFilter.mode(
widget.assetCacheHelper.color!,
ui.BlendMode.srcIn,
),
fit: BoxFit.contain,
placeholderBuilder: (BuildContext context) =>
widget.assetCacheHelper.getEmptySpace(),
Expand Down
6 changes: 5 additions & 1 deletion packages/smooth_app/lib/cards/category_cards/svg_cache.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:ui' as ui;

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:smooth_app/cards/category_cards/abstract_cache.dart';
Expand Down Expand Up @@ -54,7 +56,9 @@ class SvgCache extends AbstractCache {
}
return SvgPicture.network(
iconUrl!,
color: forcedColor,
colorFilter: forcedColor == null
? null
: ui.ColorFilter.mode(forcedColor, ui.BlendMode.srcIn),
width: width,
height: height,
fit: BoxFit.contain,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:ui' as ui;

import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_svg/flutter_svg.dart';
Expand Down Expand Up @@ -34,7 +36,10 @@ class SmoothProductCardThanks extends StatelessWidget {
'assets/misc/checkmark.svg',
width: 36.0,
height: 36.0,
color: Colors.greenAccent,
colorFilter: const ui.ColorFilter.mode(
Colors.greenAccent,
ui.BlendMode.srcIn,
),
package: AppHelper.APP_PACKAGE,
),
],
Expand Down
4 changes: 2 additions & 2 deletions packages/smooth_app/lib/helpers/analytics_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class AnalyticsHelper {

// F-Droid special case
if (GlobalVars.storeLabel == StoreLabel.FDroid && !allow) {
await MatomoTracker.instance.setOptOut(optout: true);
await MatomoTracker.instance.setOptOut(optOut: true);
} else {
await MatomoTracker.instance.setOptOut(optout: false);
await MatomoTracker.instance.setOptOut(optOut: false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ class _SendAnonymousDataSettingState extends State<_SendAnonymousDataSetting> {
return UserPreferencesSwitchItem(
title: appLocalizations.send_anonymous_data_toggle_title,
subtitle: appLocalizations.send_anonymous_data_toggle_subtitle,
value: !MatomoTracker.instance.getOptOut(),
value: !MatomoTracker.instance.optOut,
onChanged: (final bool allow) async {
await AnalyticsHelper.setAnalyticsReports(allow);
setState(() {});
Expand Down
7 changes: 6 additions & 1 deletion packages/smooth_app/lib/pages/product/edit_product_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// ignore_for_file: use_build_context_synchronously

import 'dart:ui' as ui;

import 'package:auto_size_text/auto_size_text.dart';
import 'package:barcode_widget/barcode_widget.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -406,7 +408,10 @@ class _SvgIcon extends StatelessWidget {
assetName,
height: DEFAULT_ICON_SIZE,
width: DEFAULT_ICON_SIZE,
color: _iconColor(Theme.of(context)),
colorFilter: ui.ColorFilter.mode(
_iconColor(Theme.of(context)),
ui.BlendMode.srcIn,
),
package: AppHelper.APP_PACKAGE,
);

Expand Down
Loading