Skip to content

Commit

Permalink
chore: upgrade - flutter_svg, camera (#3945)
Browse files Browse the repository at this point in the history
* chore: upgrade - flutter_svg, camera, matomo_tracker

Impacted files:
* `analytics_helper.dart`: minor refactoring with new matomo version
* `edit_product_page.dart`: minor refactoring with new svg version
* `pubspec.lock`: wtf
* `scanner/pubspec.yaml`: new svg version
* `smooth_app/pubspec.yaml`: new svg, camera and matomo versions
* `smooth_product_card_thanks.dart`: minor refactoring with new svg version
* `svg_async_asset.dart`: minor refactoring with new svg version
* `svg_cache.dart`: minor refactoring with new svg version
* `user_preferences_settings.dart`: minor refactoring with new matomo version

* Rolling back the matomo tracker upgrade

---------

Co-authored-by: Marvin Möltgen <[email protected]>
  • Loading branch information
monsieurtanuki and M123-dev authored May 13, 2023
1 parent 12a561a commit cd04135
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 61 deletions.
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
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

0 comments on commit cd04135

Please sign in to comment.