? 前后 开源爱好者 许可证 构建状态 Awesome Flutter

一个 Flutter 包,可以更轻松地显示两张图片之间的差异。

源代码是100% Dart,所有代码都位于/lib文件夹中。

? GIF

Screenshot Screenshot Screenshot

? 安装

pubspec.yamldependencies: 部分,添加以下行

Version

dependencies:
  before_after_image_slider_nullsafty: <latest version>

❔ 用法

导入此类

import 'package:before_after_image_slider_nullsafty/before_after_image_slider_nullsafty.dart';

前后

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

? 定制和属性

BeforeAfter Widget 的所有可定制属性

属性名 示例值 描述
beforeImage (Widget) Image.asset(‘assets/before.jpg’) 设置前置图片
afterImage (Widget) Image.asset(‘assets/after.jpg’) 设置后置图片
isVertical (bool) 设置滑块的方向
imageHeight (double) 100.0 设置两张图片的尺寸高度
imageWidth (double) 200.0 设置图片的宽度
imageCornerRadius (double) 16.0 设置图片的圆角
thumbColor (Color) Colors.red 设置滑块的颜色
thumbRadius (double) 16.0 设置滑块圆圈的半径
overlayColor (Color) Colors.yellow 设置滑块圆圈覆盖层的颜色

? 如何贡献

  1. Fork 此项目
  2. 创建你的特性分支 (git checkout -b my-new-feature)
  3. 提交你的更改 (git commit -am ‘Add some feature’)
  4. 推送到分支 (git push origin my-new-feature)
  5. 创建新的 Pull Request

? 许可证

Copyright (c) 2022 Asad Khan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

入门

有关 Flutter 入门指南,请参阅我们的在线 文档

有关编辑包代码的帮助,请参阅 文档

GitHub

查看 Github