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

custom_pointed_popup 표지
패키지 상세v0.0.4

custom_pointed_popup

목표 위젯에 표시할 수 있는 팝업으로 사용자 지정된 화살표 디자인을 지원합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
116
좋아요
23
Pub 점수
130

패키지 설치

flutter pub add custom_pointed_popup

패키지 개요

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

특정 위젯에 고정된 사용자 정의 가능한 화살표가 있는 팝업을 표시할 수 있는 플러터 패키지입니다. 방향성 화살표를 갖춘 독창적인 디자인을 지원하며, 툴팁이나 맥락 기반 힌트에 적합합니다. 타겟에 대해 정확하게 위치시킬 수 있으며, 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼과 호환됩니다. UI 흐름을 방해하지 않고 시각적 피드백을 제공하여 사용자 경험을 향상시킵니다.

사용 사례

  • 버튼에 툴팁 표시
  • 사용자 정의 컨텍스트 메뉴 만들기
  • 폼 필드 강조 표시
  • 상호작용형 안내 제공
  • 위젯 근처에 동적 정보 표시

주요 기능

  • 사용자 정의 가능한 포인터 모양
  • 대상 위젯에 대한 정밀한 위치
  • 다중 플랫폼 렌더링 지원
  • 사용자 정의 위젯을 통한 확장 가능한 설계
  • 부드러운 애니메이션 전환

적합한 대상

  • 인터랙티브 요소를 찾는 UI/UX 디자이너
  • 가이드된 온보딩 흐름을 구축하는 개발자
  • 컨텍스트 기반 도움 시스템이 필요한 앱
  • 풍부한 상호작용 인터페이스를 가진 프로젝트
  • 크로스 플랫폼 앱을 위한 Flutter 사용 팀

고려 사항

  • 신중한 레이아웃 관리가 필요합니다
  • 복잡한 디자인의 경우 추가 스타일링이 필요할 수 있습니다
  • 많은 동시 팝업으로 인한 성능 영향
  • 제한된 내장 테마, 사용자 정의 구현 필요
  • 크기 제한으로 인해 큰 콘텐츠 영역에는 적합하지 않습니다

원본 README

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

custom_pointed_popup

Popup that can be shown on any targeted widget with customized pointed design.

Screenshots

alt text alt text alt text alt text

Getting Started

Example
  final GlobalKey widgetKey = GlobalKey();

  CustomPointedPopup getCustomPointedPopup(BuildContext context) {
    return CustomPointedPopup(
      backgroundColor: Colors.red,
      context: context,
      lineColor: Colors.tealAccent,
      widthFractionWithRespectToDeviceWidth: 3,
      displayBelowWidget: true,
      triangleDirection: TriangleDirection.FullLeft,
      popupElevation: 10,

      ///you can also add border radius
      ////popupBorderRadius:,
      item: CustomPointedPopupItem(
        title: 'Popup that can be shown on any targeted widget with customized pointed design.',
        textStyle: Theme.of(context).textTheme.caption!.copyWith(
              color: Theme.of(context).cardColor,
            ),
        iconWidget: Icon(
          Icons.add_moderator,
          color: Theme.of(context).cardColor,
        ),

        ///Or you can add custom item widget below instead above 3
        ///itemWidget: Container(),
      ),
      onClickWidget: (onClickMenu) {
        print('popup item clicked');
      },
      onDismiss: () {
        print('on dismissed called');
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          'Custom Pointed Popup [CPP]',
        ),
      ),
      body: Container(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                'CPP with straight pointer & item.',
                style: TextStyle(
                  color: Colors.red,
                  fontSize: 14.0,
                  fontStyle: FontStyle.italic,
                  fontWeight: FontWeight.bold,
                ),
              ),
              SizedBox(
                height: 40,
              ),
              GestureDetector(
                onTap: () {
                  getCustomPointedPopup(context)
                    ..show(
                      widgetKey: widgetKey,
                    );
                },
                child: Card(
                  key: widgetKey,
                  elevation: 10,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(20),
                  ),
                  child: Container(
                    height: 100,
                    width: 100,
                    child: Center(
                      child: Text(
                        'Click Me \nTo\n Display CPP',
                        textAlign: TextAlign.center,
                        overflow: TextOverflow.clip,
                        style: TextStyle(
                          color: Colors.blueGrey,
                          fontWeight: FontWeight.w900,
                          fontSize: 14.0,
                        ),
                      ),
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

Important Class, Function And Enum

The important class to know. CustomPointedPopupItem - Model item to display inside the pointed popup:

Attribute Type Default Required Description
iconWidget Widget No This will create an icon inside the pointed popup.
title String No Title or text for the pointed popup.
textStyle TextStyle No Text style for the title.
textAlign TextAlign No Alignment for the title.
itemWidget Widget No Custom item widget or child for the pointed popup. No need to add iconWidget & title if you added this.

The important function to know. show - Function to show the custom pointed popup:

Attribute Type Default Required Description
rect Rect No The rect bound that the popup should appear around it.
widgetKey GlobalKey No The key to widget.
item CustomPointedPopupItem [class] No If you want the dynamic item widget or child inside the popup per action, you can add the item here.

The important enum to know. TriangleDirection - Enum to choose the direction of pointer or triangle shape:

Value Description
Straight This will create an pointer with straight upward.
Right This will create an pointer with slightly bended towards right.
FullRight This will create an pointer with fully bended towards right.
Left This will create an pointer with slightly bended towards left.
FullLeft This will create an pointer with fully bended towards left.

In order to create a custom pointed popup on the widget, there are several attributes that are supported by custom_pointed_popup:

Attribute Type Default Required Description
item CustomPointedPopupItem [class] Yes To create the item widget or child in pointed popup.
customHeight double Yes The custom height of the pointed popup.
displayBelowWidget bool false No If true always display the popup below the widget else automatically calculate the space and display the popup either up or below the widget.
triangleDirection TriangleDirection [enum] TraingleDirection.Straight No Determines the direction of pointer or triangle shape.
popupBorderRadius BorderRadius BorderRadius.circular(10.0) No Defines the border of the custom pointed popup.
popupElevation double 0 No The elevation of the pointed popup.
stateChanged Function(bool isShow) No This event function will fire immediately the the popup state changes.
backgroundColor Color Colors.red No Background color for pointed popup.
widthFractionWithRespectToDeviceWidth int 3 No Width ratio with respect to the device width.
onDismiss VoidCallBack No Callback function that fire when the custom pointed popup dismissed.
onClickWidget Function(CustomPointedPopupItem item) No Callback function that fire when the child of popup is clicked.
context BuildContext Yes Context where the popup to be shown.

##If you have any queries, email me to dipak.shrestha@eemc.edu.np

CREDITS

Contributors

Made with contributors-img.

카테고리

소스 저장소

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

아직 데이터가 없습니다.