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

This image viewer, takes the url which returns the bytes as image. You can implement it with authorization factor.

example/example.dart

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

void main() {
  runApp(const MaterialApp(home: 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: double.infinity,
            //optional
            width: double.infinity,
            //optional
            fit: BoxFit.fill,
            //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"),
      ),
    );
  }
}
4
likes
150
points
74
downloads

Publisher

verified publisherandroidshashi.com

Weekly Downloads

This image viewer, takes the url which returns the bytes as image. You can implement it with authorization factor.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, http

More

Packages that depend on bytes_image_viewer