File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ import 'package:algorithm_visualizer/core/resources/theme_manager.dart' ;
2+ import 'package:flutter/material.dart' ;
3+ import 'package:flutter_screenutil/flutter_screenutil.dart' ;
4+ import 'package:flutter_svg/flutter_svg.dart' ;
5+
6+ class CustomAssetsSvg extends StatelessWidget {
7+ const CustomAssetsSvg (
8+ this .path, {
9+ this .size,
10+ this .semanticLabel,
11+ this .color = ThemeEnum .focusColor,
12+ super .key,
13+ });
14+ final String path;
15+ final String ? semanticLabel;
16+ final double ? size;
17+ final ThemeEnum ? color;
18+ @override
19+ Widget build (BuildContext context) {
20+ final color = this .color;
21+ final size = this .size;
22+ if (path.isEmpty) return const RSizedBox ();
23+
24+ return SvgPicture .asset (
25+ path,
26+ height: size? .r,
27+ semanticsLabel: semanticLabel,
28+ colorFilter: color == null
29+ ? null
30+ : ColorFilter .mode (context.getColor (color), BlendMode .srcIn),
31+ );
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments