패키지, 저장소 및 앱 카테고리 검색

progress_state_button 표지
패키지 상세v1.0.4

progress_state_button

Flutter Android, IOS 및 Web용 사용자 지정 가능한 진행률 버튼 위젯입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.4천
좋아요
373
Pub 점수
130

패키지 설치

flutter pub add progress_state_button

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter용 사용자 정의 가능한 진행률 버튼 위젯으로 Android, iOS, Web, macOS, Windows, Linux를 지원합니다. 로딩, 성공, 오류, 대기 상태와 같은 동적 상태를 가진 버튼을 만들 수 있어 폼 제출이나 API 호출과 같은 작업 중 사용자 피드백을 향상시킵니다. 이 위젯은 색상, 레이블, 아이콘, 애니메이션 등을 사용자 정의할 수 있도록 매우 유연하며 기존의 Flutter 앱에 원활하게 통합되어 플랫폼 간 일관된 경험을 제공합니다.

사용 사례

  • 로딩 상태를 가진 폼 제출
  • 인증 흐름 진행 상황
  • 파일 업로드 표시기
  • 결제 처리 UI
  • 온보딩 워즈드 단계

주요 기능

  • 다중 상태 지원 (정지, 로딩, 성공, 오류)
  • 사용자 정의 가능한 외관 및 동작
  • 크로스 플랫폼 호환성
  • 상태 간의 애니메이션 전환
  • 사용자 정의 가능한 레이블 및 아이콘
  • 기존 위젯과의 간편한 통합

적합한 대상

  • 인터랙티브 폼을 개발하는 개발자
  • UX 일관성을 우선시하는 팀
  • 실시간 피드백이 필요한 앱
  • 크로스 플랫폼 모바일 및 웹 애플리케이션
  • 복잡한 사용자 워크플로우를 가진 프로젝트

고려 사항

  • Flutter 상태 관리에 대한 이해가 필요합니다
  • 복잡한 디자인의 경우 추가 스타일링이 필요할 수 있습니다
  • 버튼 전용 사용 사례에 한정
  • 상호작용이 없는 요소에 적합하지 않습니다
  • 플랫폼별 렌더링 동작에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Progress State Button

A customizable progress button for Flutter

Test with DartPad

Installation

https://pub.dev/packages/progress_state_button

progress_state_button: "^1.0.4"

Usage

Icon

ProgressButton.icon(iconedButtons: {
      ButtonState.idle:
        IconedButton(
            text: "Send",
            icon: Icon(Icons.send,color: Colors.white),
            color: Colors.deepPurple.shade500),
      ButtonState.loading:
        IconedButton(
            text: "Loading",
            color: Colors.deepPurple.shade700),
      ButtonState.fail:
        IconedButton(
            text: "Failed",
            icon: Icon(Icons.cancel,color: Colors.white),
            color: Colors.red.shade300),
      ButtonState.success:
        IconedButton(
            text: "Success",
            icon: Icon(Icons.check_circle,color: Colors.white,),
            color: Colors.green.shade400)
    }, 
    onPressed: onPressed,
    state: ButtonState.idle);
With Custom Widgets

ProgressButton(
      stateWidgets: {
        ButtonState.idle: Text("Idle",style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500),),
        ButtonState.loading: Text("Loading",style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500),),
        ButtonState.fail: Text("Fail",style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500),),
        ButtonState.success: Text("Success",style: TextStyle(color: Colors.white, fontWeight: FontWeight.w500),)
      },
      stateColors: {
        ButtonState.idle: Colors.grey.shade400,
        ButtonState.loading: Colors.blue.shade300,
        ButtonState.fail: Colors.red.shade300,
        ButtonState.success: Colors.green.shade400,
      },
      onPressed: onPressed,
      state: ButtonState.idle,
    );
Constructors
Default constructor of ProgressButton
stateWidgets - Widgets of states
stateColors - Background color oof states
state = ButtonState.idle` - Current state of button
onPressed - onPressed function same like MaterialButton
onAnimationEnd - onAnimatedEnd function calls like that onAnimatedEnd(AnimationStatus animationStatus,ButtonState currentState).
minWidth = 200.0 - Loading state width
maxWidth = 400.0 - failed,success,idle states width
radius = 16.0 - Button radius
height = 53.0 - Button height
circularProgressIndicator - CircularProgressIndicator widget, default is instating with current state color.
progressIndicatorAlignment = MainAxisAlignment.spaceBetween` - ProgressIndicator aligment
progressIndicatorSize = 35.0 - size of progress indicator
padding = EdgeInsets.zero - Padding of button
minWidthStates = List of min width states, loading is the default. If you want to make small only icon states define them on this.
animationDuration = Transition animation duration.
ProgressButton.icon() specific constructors
Map<ButtonState, IconedButton> iconedButtons- State and IconedButton map
double iconPadding: 4.0 - Padding of icon 
TextStyle textStyle - TextStyle of all of states

License

This project is licensed under the MIT License - see the LICENSE.md file for details

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.