FLUTTER ECOSYSTEM

theiskaa/insta-like-button

Instagram 帖子风格的可自定义卡片小部件,带有默认点赞功能

insta-like-button 项目封面
Stars
15
Forks
2
最近推送(UTC)
2021年8月19日
项目状态
未归档
Ismael GitHub avatar
GITHUB User

Ismael ↗

Libertas aut mors

@tnet-organizationGeorgia
语言Dart

技术话题

此仓库发布的插件

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

Insta Like Button

License: MIT License: MIT

Installing

Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  insta_like_button: ^0.1.1
Install it

You can install packages from the command line:

$ flutter pub get
...
Import it

Now in your Dart code, you can use:

import 'package:insta_like_button/insta_like_button.dart';

Usage & Overview

https://raw.githubusercontent.com/theiskaa/insta-like-button/develop/example/overview/overview.gif
With required parameters.
InstaLikeButton(
  image: AssetImage("example/overview/img.jpg"),
  onChanged: () {
    // Do something...
  },
),
With all parameters (Customized InstaLikeButton).
InstaLikeButton(
  image: NetworkImage("https://picsum.photos/200/300"),
  onChanged: () {
    // Do something...
  },
  icon: Icons.favorite_border,
  iconSize: 80,
  iconColor: Colors.red,
  curve: Curves.fastLinearToSlowEaseIn,
  height: 200,
  width: MediaQuery.of(context).size.width - 20,
  duration: const Duration(seconds: 1),
  onImageError: (e, _) {
    // Do something...
  },
  imageAlignment: Alignment.topLeft,
  imageBoxfit: BoxFit.fill,
  imageScale: 2.0,
  imageColorFilter: ColorFilter.mode(
    Colors.black.withOpacity(0.5),
    BlendMode.dstATop,
  ),
),