flutter_svg_image 1.0.0 copy "flutter_svg_image: ^1.0.0" to clipboard
flutter_svg_image: ^1.0.0 copied to clipboard

Svg ImageProvider for Flutter. Use jovial_svg to parse svg and use flutter_cache_manager to cache svg files.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_svg_image/flutter_svg_image.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Builder(
          builder: (context) {
            final size = MediaQuery.of(context).size;
            return SizedBox(
              width: double.infinity,
              height: double.infinity,
              child: Image(
                fit: BoxFit.contain,
                image: SvgImage.cachedNetwork(
                  'https://jovial.com/images/jupiter.svg',
                  height: size.height >= size.width ? size.height : null,
                  width: size.width > size.height ? size.width : null,
                ),
              ),
            );
          },
        ),
      ),
    );
  }
}
8
likes
0
pub points
86%
popularity

Publisher

unverified uploader

Svg ImageProvider for Flutter. Use jovial_svg to parse svg and use flutter_cache_manager to cache svg files.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_cache_manager, jovial_svg

More

Packages that depend on flutter_svg_image