image_network 2.5.6 copy "image_network: ^2.5.6" to clipboard
image_network: ^2.5.6 copied to clipboard

PlatformiOSweb

Image Network is a package that allows you to render images on the web using CanvasKit without having problems with CORS

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ImageNetwork',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo ImageNetwork'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final String imageUrl =
      "https://www.imagenetwork.scaffoldtecnologia.com.br/flutter.jpg";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: ImageNetwork(
          image: imageUrl,
          height: 150,
          width: 150,
          duration: 1500,
          curve: Curves.easeIn,
          onPointer: true,
          debugPrint: false,
          fullScreen: false,
          fitAndroidIos: BoxFit.cover,
          fitWeb: BoxFitWeb.cover,
          onLoading: const CircularProgressIndicator(
            color: Colors.indigoAccent,
          ),
          onError: const Icon(
            Icons.error,
            color: Colors.red,
          ),
          borderRadius: BorderRadius.circular(10),
          onTap: () {
            showDialog(
                context: context,
                builder: (_) => const AlertDialog(
                      content: Text("©gabrielpatricksouza"),
                    ));
            debugPrint("©gabriel_patrick_souza");
          },
        ),
      ),
    );
  }
}
151
likes
140
points
17k
downloads

Publisher

unverified uploader

Weekly Downloads

Image Network is a package that allows you to render images on the web using CanvasKit without having problems with CORS

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, webviewimage

More

Packages that depend on image_network