mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-20 14:19:05 +00:00
21 lines
558 B
Dart
21 lines
558 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
Widget buildIconFromPath(String? iconPath, {double height = 24.0, double width = 24.0}) {
|
|
if (iconPath != null && iconPath.contains('svg')) {
|
|
return SvgPicture.asset(
|
|
iconPath,
|
|
height: height,
|
|
width: width,
|
|
fit: BoxFit.contain,
|
|
);
|
|
} else if (iconPath != null && iconPath.isNotEmpty) {
|
|
return Image.asset(
|
|
iconPath,
|
|
height: height,
|
|
width: width,
|
|
);
|
|
} else {
|
|
return SizedBox(height: height, width: width);
|
|
}
|
|
}
|