bytes_image_viewer 0.0.4 copy "bytes_image_viewer: ^0.0.4" to clipboard
bytes_image_viewer: ^0.0.4 copied to clipboard

bytes_image_viewer, takes the url which returns the bytes as image. You can implement it with autherization factor.

example/example.dart

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

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

class HomeScreen extends StatefulWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: const Center(
          child: BytesImageViewer(
        height: 100, //optional
        width: 100, //optional
        fit: BoxFit.cover, //optional
        apiUrl:
            'https://cdn.pixabay.com/photo/2023/11/26/19/09/butterfly-8414148_1280.jpg',
        headers: {"Authorization": "Bearer yTiIsInN1YiI6IjEiLC"}, //optional
        loadingWidget: CircularProgressIndicator(
          color: Colors.red,
        ), //optional
        errorWidget: CircularProgressIndicator(
          color: Colors.red,
        ), //optional
      )),
      appBar: AppBar(
        title: const Text("Bytes image viewer example"),
      ),
    );
  }
}
3
likes
150
pub points
53%
popularity

Publisher

verified publisherandroidshashi.com

bytes_image_viewer, takes the url which returns the bytes as image. You can implement it with autherization factor.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, http

More

Packages that depend on bytes_image_viewer