Tuesday, September 26, 2023

flutter package which makes it easier to display the difference between two images

 Before After     

A flutter package which makes it easier to display the differences between two images..

The source code is 100% Dart, and everything resides in the /lib folder.



In the dependencies: section of your pubspec.yaml, add the following line:

  before_after: <latest version>


Import this class

import 'package:before_after/before_after.dart';

before after

     beforeImage: Image.asset('assets/after.jpg'),
     afterImage: Image.asset('assets/before.jpg'),

Customization and Attributes

All customizable attributes for BeforeAfter Widget

Attribute NameExample ValueDescription
beforeImage (Widget)Image.asset(‘assets/before.jpg’)Sets the Before Image
afterImage (Widget)Image.asset(‘assets/after.jpg’)Sets the After Image
isVertical (bool)falseSets the orientation of the slider
imageHeight (double)100.0Sets height of both the images
imageWidth (double)200.0Sets width of the images
imageCornerRadius (double)16.0Sets the corner radius of the images
thumbColor (Color)Colors.redSets the color of the slider
thumbRadius (double)16.0Sets the radius of the thumb circle
overlayColor (Color)Colors.yellowSets the color of the slider thumb overlay

How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am ‘Add some feature’)
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request