PMU_Puchkina_A.A_PIbd-32/lib/presentation/common/svg_object.dart

35 lines
865 B
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:app/components/resources.g.dart';
abstract class SvgObjects {
static void init() {
final pics = <String>[
R.ASSETS_SVG_FLAG_GB_SVGREPO_COM_SVG,
R.ASSETS_SVG_FLAG_RU_SVGREPO_COM_SVG,
];
for (final String p in pics) {
final loader = SvgAssetLoader(p);
svg.cache.putIfAbsent(loader.cacheKey(null), () => loader.loadBytes(null));
}
}
}
class SvgRu extends StatelessWidget {
const SvgRu({super.key});
@override
Widget build(BuildContext context) {
return SvgPicture.asset(R.ASSETS_SVG_FLAG_RU_SVGREPO_COM_SVG);
}
}
class SvgUk extends StatelessWidget {
const SvgUk({super.key});
@override
Widget build(BuildContext context) {
return SvgPicture.asset(R.ASSETS_SVG_FLAG_GB_SVGREPO_COM_SVG);
}
}