base_image 0.0.7 copy "base_image: ^0.0.7" to clipboard
base_image: ^0.0.7 copied to clipboard

BaseImage provides a full range of display formats of images :Network images, SVG images, Local images

example/lib/main.dart

import 'dart:developer';
import 'package:base_image/base_image.dart';
import 'package:flutter/material.dart';
import 'dart:async';

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('Base image widget'),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: const [
              /// Example: Load image from network
              NetworkImageWidget(
                url:
                    "https://img.meta.com.vn/Data/image/2022/01/13/anh-dep-thien-nhien-3.jpg",
                height: 200,
                width: double.infinity,
                boxFit: BoxFit.cover,
              ),
              SizedBox(
                height: 50,
              ),

              /// Example: Load svg image
              SVGImageWidget(url: "assets/svg_address.svg"),
              SizedBox(
                height: 50,
              ),

              /// Example: Load image from asset
              LocalImageWidget(
                url: "assets/png_no_image.png",
                height: 200,
                width: double.infinity,
              ),
              SizedBox(
                height: 50,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
64
downloads

Publisher

unverified uploader

Weekly Downloads

BaseImage provides a full range of display formats of images :Network images, SVG images, Local images

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cached_network_image, flutter, flutter_svg, lottie, plugin_platform_interface

More

Packages that depend on base_image