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

outdated

A image cache widget that works with dynamic urls

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  void _resetButtonHandler() {
    Navigator.pushAndRemoveUntil(
      context, 
      MaterialPageRoute(builder: (context) => MyHomePage()), 
      (_) => false);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Dynamic Id Image Cache"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            DynamicIdImageCache(
              imageId: 'testIdImage123', 
              imageUrl: 'https://picsum.photos/200/300',
              height: 300,
              width: 300,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _resetButtonHandler,
        tooltip: 'Reset',
        child: Icon(Icons.refresh),
      ),
    );
  }
}
4
likes
0
pub points
17%
popularity

Publisher

unverified uploader

A image cache widget that works with dynamic urls

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, path_provider

More

Packages that depend on dynamic_url_image_cache