Skip to content

Commit

Permalink
Consume new vector_graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield committed Feb 22, 2023
1 parent 461ed86 commit c190052
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGES

## 2.0.2

- Consume newer version of vector_graphics with multiple fixes around
inheritence, patterns, and currentColor handling.

## 2.0.1

- Disable Isolate parsing in debug mode.
Expand Down
6 changes: 3 additions & 3 deletions lib/src/loaders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class SvgTheme {
///
/// Defaults the [fontSize] to 14.
const SvgTheme({
this.currentColor,
this.currentColor = const Color(0xFF000000),
this.fontSize = 14,
double? xHeight,
}) : xHeight = xHeight ?? fontSize / 2;

/// The default color applied to SVG elements that inherit the color property.
/// See: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentcolor_keyword
final Color? currentColor;
final Color currentColor;

/// The font size used when calculating em units of SVG elements.
/// See: https://www.w3.org/TR/SVG11/coords.html#Units
Expand All @@ -39,7 +39,7 @@ class SvgTheme {

vg.SvgTheme _toVgTheme() {
return vg.SvgTheme(
currentColor: currentColor != null ? vg.Color(currentColor!.value) : null,
currentColor: vg.Color(currentColor.value),
fontSize: fontSize,
xHeight: xHeight,
);
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: flutter_svg
description: An SVG rendering and widget library for Flutter, which allows painting and displaying Scalable Vector Graphics 1.1 files.
repository: https://github.com/dnfield/flutter_svg
issue_tracker: https://github.com/dnfield/flutter_svg/issues
version: 2.0.1
version: 2.0.2

dependencies:
flutter:
sdk: flutter
vector_graphics: ^1.0.1
vector_graphics_codec: ^1.0.1
vector_graphics_compiler: ^1.0.1
vector_graphics: ^1.1.0
vector_graphics_codec: ^1.1.0
vector_graphics_compiler: ^1.1.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit c190052

Please sign in to comment.