atomized_image 0.1.0 copy "atomized_image: ^0.1.0" to clipboard
atomized_image: ^0.1.0 copied to clipboard

A widget which paints and animates images with particles to achieve an atomized effect.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Atomized Image demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final List<String> _images = [
    '947228834121658368/z3AHPKHY_400x400.jpg',
    '1322300827726356480/QUIpVQ_M_400x400.jpg',
  ];
  int _index = 0;

  void _nextImage() {
    _index = (_index + 1) % _images.length;
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Atomized Image'),
      ),
      body: AtomizedImage(
        image: NetworkImage(
          'https://pbs.twimg.com/profile_images/${_images[_index]}',
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _nextImage,
        tooltip: 'Next',
        child: const Icon(Icons.navigate_next),
      ),
    );
  }
}
43
likes
40
pub points
26%
popularity

Publisher

unverified uploader

A widget which paints and animates images with particles to achieve an atomized effect.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter, vector_math

More

Packages that depend on atomized_image