preloaded_images 0.0.1 copy "preloaded_images: ^0.0.1" to clipboard
preloaded_images: ^0.0.1 copied to clipboard

outdated

A new flutter plugin to fetch latest 'X' images from mobile storage. It returns list of asset url's and works both on IOS and Android.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List allImage = List();
  bool loading = true;

  @override
  void initState() {
    super.initState();
    getImages();
  }

  getImages() async {
    allImage = [];
    List allImageTemp = await PreloadedImages.getImages(count: 5);
    allImage.addAll(allImageTemp);
    print(allImage);
    setState(() {
      loading = false;
    });
  }

  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: loading
            ? CircularProgressIndicator()
            : Container(
                alignment: Alignment.center,
                child: Image.asset(
                  // displaying only first image
                  // but will return you the count
                  "${allImage.first}",
                  fit: BoxFit.contain,
                ),
              ),
      ),
    );
  }
}
9
likes
0
pub points
0%
popularity

Publisher

verified publishersuresh-konakanchi.in

A new flutter plugin to fetch latest 'X' images from mobile storage. It returns list of asset url's and works both on IOS and Android.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on preloaded_images