FLUTTER ECOSYSTEM

hnvn/flutter_flip_panel

一个带有内置动画的翻转面板包

flutter_flip_panel 项目封面
Stars
616
Forks
84
最近推送(UTC)
2022年4月2日
项目状态
未归档
HungHD GitHub avatar
GITHUB User

HungHD ↗

Full-stack developer (Android, iOS, Flutter, Blockchain, Solidity).

Hanoi, Vietnam官方网站 ↗
语言DartObjective-CJava

技术话题

此仓库发布的插件

使用的依赖

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

原始 README

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

展开 / 收起项目 README

Flip Panel

pub package https://github.com/hnvn/flutter_flip_panel/workflows/unit%20test/badge.svg

A package for flip panel with built-in animation

https://github.com/hnvn/flutter_flip_panel/blob/master/screenshots/flip_image.gif?raw=true https://github.com/hnvn/flutter_flip_panel/blob/master/screenshots/flip_clock.gif?raw=true

How to use

import 'package:flip_panel/flip_panel.dart';

Create a flip panel from iterable source:

final digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

FlipPanel.builder(
    itemBuilder: (context, index) => Container(
       color: Colors.black,
       padding: const EdgeInsets.symmetric(horizontal: 6.0),
       child: Text(
         '${digits[index]}',
         style: TextStyle(
             fontWeight: FontWeight.bold,
             fontSize: 50.0,
             color: Colors.white),
       ),
     ),
    itemsCount: digits.length,
    period: const Duration(milliseconds: 1000),
    loop: 1,
)

Create a flip panel from stream source:

FlipPanel<int>.stream(
      itemStream: Stream.periodic(Duration(milliseconds: 1000), (count) => count % 10),
      itemBuilder: (context, value) => Container(
        color: Colors.black,
        padding: const EdgeInsets.symmetric(horizontal: 6.0),
        child: Text(
          '$value',
          style: TextStyle(
            fontWeight: FontWeight.bold,
            fontSize: 50.0,
            color: Colors.white
          ),
        ),
      ),
      initValue: 0,
  );