xsahil03x/before_after

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

Dart

1,036

53 commits

updated Nov 16, 2024

See the code

README

👏 Before After Open Source Love License before_after Awesome Flutter FlutterWeekly

Say Thanks! Twitter

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.

Live Demo: https://xsahil03x.github.io/before_after

Show some ❤️ and star the repo to support the project

GitHub stars GitHub forks GitHub watchers GitHub followers
Twitter Follow

🔅 Gifs

ScreenshotScreenshotScreenshot

💻 Installation

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

Version

dependencies:
  before_after: <latest version>

❔ Usage

Import this class

import 'package:before_after/before_after.dart';

before after

BeforeAfter(
  value: value,
  before: Image.asset('assets/after.png'),
  after: Image.asset('assets/before.png'),
  onValueChanged: (value) {
    setState(() => this.value = value);
  },
)

🎨 Customization and Attributes

FieldTypeDescription
beforeWidgetThe widget to be displayed before the slider.
afterWidgetThe widget to be displayed after the slider.
directionSliderDirectionThe drag direction of the slider.
heightdouble?The height of the BeforeAfter widget.
widthdouble?The width of the BeforeAfter widget.
trackWidthdouble?The width of the slider track.
trackColorColor?The color of the slider track.
hideThumbboolWhether to hide the slider thumb.
thumbHeightdouble?The height of the slider thumb.
thumbWidthdouble?The width of the slider thumb.
thumbColorColor?The color of the slider thumb.
overlayColorMaterialStateProperty<Color?>?The highlight color that's typically used to indicate that the slider thumb is focused.
thumbDecorationBoxDecoration?The decoration of the slider thumb.
divisionsint?The number of discrete divisions on the slider.
valuedoubleThe position of the slider, ranging from 0.0 to 1.0.
onValueChangedValueChanged?A callback function that is called when the value of the slider changes.
thumbDivisionsint?The number of discrete divisions on the slider thumb.
thumbPositiondoubleThe position of the slider thumb, ranging from 0.0 to 1.0.
onThumbPositionChangedValueChanged?A callback function that is called when the position of the thumb changes.
focusNodeFocusNode?The focus node for the widget.
autofocusboolWhether the widget should be focused automatically.
mouseCursorMouseCursor?The cursor for a mouse pointer when it enters or hovers over the widget.

📃 License

MIT License

before-after
dart
flutter
flutter-package
hacktoberfest
slider

xsahil03x/before_after

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

Dart

1,036

53 commits

updated Nov 16, 2024

See the code

README

👏 Before After Open Source Love License before_after Awesome Flutter FlutterWeekly

Say Thanks! Twitter

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.

Live Demo: https://xsahil03x.github.io/before_after

Show some ❤️ and star the repo to support the project

GitHub stars GitHub forks GitHub watchers GitHub followers
Twitter Follow

🔅 Gifs

ScreenshotScreenshotScreenshot

💻 Installation

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

Version

dependencies:
  before_after: <latest version>

❔ Usage

Import this class

import 'package:before_after/before_after.dart';

before after

BeforeAfter(
  value: value,
  before: Image.asset('assets/after.png'),
  after: Image.asset('assets/before.png'),
  onValueChanged: (value) {
    setState(() => this.value = value);
  },
)

🎨 Customization and Attributes

FieldTypeDescription
beforeWidgetThe widget to be displayed before the slider.
afterWidgetThe widget to be displayed after the slider.
directionSliderDirectionThe drag direction of the slider.
heightdouble?The height of the BeforeAfter widget.
widthdouble?The width of the BeforeAfter widget.
trackWidthdouble?The width of the slider track.
trackColorColor?The color of the slider track.
hideThumbboolWhether to hide the slider thumb.
thumbHeightdouble?The height of the slider thumb.
thumbWidthdouble?The width of the slider thumb.
thumbColorColor?The color of the slider thumb.
overlayColorMaterialStateProperty<Color?>?The highlight color that's typically used to indicate that the slider thumb is focused.
thumbDecorationBoxDecoration?The decoration of the slider thumb.
divisionsint?The number of discrete divisions on the slider.
valuedoubleThe position of the slider, ranging from 0.0 to 1.0.
onValueChangedValueChanged?A callback function that is called when the value of the slider changes.
thumbDivisionsint?The number of discrete divisions on the slider thumb.
thumbPositiondoubleThe position of the slider thumb, ranging from 0.0 to 1.0.
onThumbPositionChangedValueChanged?A callback function that is called when the position of the thumb changes.
focusNodeFocusNode?The focus node for the widget.
autofocusboolWhether the widget should be focused automatically.
mouseCursorMouseCursor?The cursor for a mouse pointer when it enters or hovers over the widget.

📃 License

MIT License

before-after
dart
flutter
flutter-package
hacktoberfest
slider

Significant stargazers

Dmitry Shibanov

98 followers · starred Nov 2021