Skip to content

Commit

Permalink
Testing jovial_svg plugin [#4266].
Browse files Browse the repository at this point in the history
  • Loading branch information
mihail-varbanov committed Aug 5, 2024
1 parent 8656e98 commit 4ae6ae7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/ui/debug/DebugSVGPanel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@
*/

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:pinch_zoom/pinch_zoom.dart';
import 'package:rokwire_plugin/service/styles.dart';
import 'package:illinois/ui/widgets/HeaderBar.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:jovial_svg/jovial_svg.dart';

class DebugSVGPanel extends StatefulWidget{
_DebugSVGPanelState createState() => _DebugSVGPanelState();
}

class _DebugSVGPanelState extends State<DebugSVGPanel>{

static const String svgAssetName = 'images/building-example.svg';

@override
void initState() {
super.initState();
Expand All @@ -41,15 +45,21 @@ class _DebugSVGPanelState extends State<DebugSVGPanel>{
return Scaffold(
backgroundColor: Styles().colors.surface,
appBar: HeaderBar(title: "SVG Test",),
body: PinchZoom(maxScale: 12, child: _svgPictureWidget),
body: PinchZoom(maxScale: 12, child:
_scalableImageWidget
),
);
}

// ignore: unused_element
Widget get _svgPictureWidget =>
SvgPicture.asset(
'images/building-example.svg',
semanticsLabel: 'Building Example'
);
SvgPicture.asset(svgAssetName, semanticsLabel: 'Building Example');

// ignore: unused_element
Widget get _scalableImageWidget => ScalableImageWidget.fromSISource(
fit: BoxFit.contain,
si: ScalableImageSource.fromSvg(rootBundle, svgAssetName),
);
}


16 changes: 16 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.19.0"
jovial_misc:
dependency: transitive
description:
name: jovial_misc
sha256: f6e64f789ee311025bb367be9c9afe9759f76dd8209070b7f38e735b5f529eb1
url: "https://pub.dev"
source: hosted
version: "0.8.5"
jovial_svg:
dependency: "direct main"
description:
name: jovial_svg
sha256: "893dab3d9bbb8dd03e8225d457004950b9cf828d0009fd14c185cedacb96839c"
url: "https://pub.dev"
source: hosted
version: "1.1.22"
js:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ dependencies:
fl_chart: ^0.68.0
record: ^4.4.4
flutter_svg: ^2.0.10+1
jovial_svg: 1.1.22
font_awesome_flutter: '>= 4.7.0' # comment if published plugin is used

rokwire_plugin:
Expand Down

0 comments on commit 4ae6ae7

Please sign in to comment.