30 lines
697 B
Dart
30 lines
697 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
class AtomImageSVGTheme extends StatelessWidget {
|
|
|
|
final String filename;
|
|
final double width;
|
|
final double height;
|
|
|
|
const AtomImageSVGTheme({
|
|
super.key,
|
|
required this.filename,
|
|
required this.width,
|
|
required this.height
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final brightness = MediaQuery.of(context).platformBrightness;
|
|
final isDarkMode = brightness == Brightness.dark;
|
|
final pathImage = "assets/images/${isDarkMode ? "dark" : "light"}/$filename.svg";
|
|
|
|
return SvgPicture.asset(
|
|
pathImage,
|
|
width: width,
|
|
height: height,
|
|
);
|
|
}
|
|
}
|