before_after_image_slider_nullsafty 1.0.1 copy "before_after_image_slider_nullsafty: ^1.0.1" to clipboard
before_after_image_slider_nullsafty: ^1.0.1 copied to clipboard

A flutter package which makes it easier to display the difference between two images Side by Side With a before and after slideer.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.teal,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Before After'),
        centerTitle: true,
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Expanded(
              flex: 1,
              child: BeforeAfter(
                beforeImage: Image.asset('assets/after.jpg'),
                afterImage: Image.asset('assets/before.jpg'),
              ),
            ),
            Expanded(
              flex: 1,
              child: BeforeAfter(
                beforeImage: Image.asset('assets/after.jpg'),
                afterImage: Image.asset('assets/before.jpg'),
                isVertical: true,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
29
likes
150
points
1.24k
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package which makes it easier to display the difference between two images Side by Side With a before and after slideer.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on before_after_image_slider_nullsafty