FLUTTER ECOSYSTEM

AndresR173/loading_transition_button

애니메이션 전환 버튼

loading_transition_button 프로젝트 이미지
Stars
5
Forks
0
최근 푸시(UTC)
2021. 5. 16.
프로젝트 상태
활성
Andres Rojas GitHub avatar
GITHUB User

Andres Rojas ↗

iOS developer, Open Source lover

Medellín, Colombia공식 웹사이트 ↗
언어DartSwiftKotlinObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개
  • flutter{"sdk":"flutter"}
  • vector_math^2.1.0
  • flutter_test개발 의존성{"sdk":"flutter"}
  • lint개발 의존성^1.3.1

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

Loading Transition button

https://badges.fyi/github/latest-tag/AndresR173/loading_transition_button https://badges.fyi/github/stars/AndresR173/loading_transition_button https://badges.fyi/github/license/AndresR173/loading_transition_button

A Customizable transition button for Flutter

Getting Started

To use this package, add loading_transition_button as a dependency in your pubspec.yaml file.

dependencies:
 ...
 loading_transition_button: ^0.0.1

How to use

In your project add the following import:

import  'package:loading_transition_button/loading_transition_button.dart';

In order to use this widget you have to use a LoadingButtonController to handler the different states.

final _controller = LoadingButtonController();

This widget starts a loading animation once it's tapped or by using the controller. You can the launcher to init an error animation or stop the loading animation.

LoadingButton(
    color: Colors.blue,
    onSubmit: () => print('onSubmit'),
    controller: _controller,
    errorColor: Colors.red,
    transitionDuration: Duration(seconds: 1),
    child: Text(
    'Hit me!',
    style: Theme.of(context)
        .textTheme
        .bodyText1!
        .copyWith(color: Colors.white),
    ),
),

To support the transition to a different page to have to call the moveToScreen method

_controller.moveToScreen(
    context: context,
    page: SearchPage(),
    stopAnimation: true,
    navigationCallback: (route) =>
        Navigator.of(context).push(route),
),

navigationCallback will send you a new route that you can use for different navigation method like push or replace.

LoadingTransitionButton

AnimatedButton