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

popover 표지
패키지 상세v0.5.1

popover

팝오버는 컨트롤이나 영역을 탭할 때 화면의 다른 콘텐츠 위에 일시적으로 나타나는 전환 뷰입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
3.9만
좋아요
688
Pub 점수
160

패키지 설치

flutter pub add popover

패키지 개요

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

팝오버 패키지는 사용자 상호작용에 의해 트리거될 때 다른 콘텐츠 위에 일시적인 부유형 뷰를 표시하는 유연하고 플랫폼 인식 가능한 방식을 제공합니다. 버튼이나 아이콘과 같은 컨트롤과 함께 사용하도록 설계되었으며, Android, iOS, 웹, macOS, Windows, Linux에서 부드러운 애니메이션과 적응형 위치 조정을 지원합니다. 각 플랫폼의 네이티브 디자인 지침을 존중하면서도 일관된 동작을 보장합니다. 메뉴, 툴팁 또는 빠른 작업 패널과 같이 주 UI 흐름을 방해하지 않으면서도 적합합니다.

사용 사례

  • 컨텍스트 메뉴 표시
  • 빠른 작업 패널 표시
  • 툴팁 만들기
  • 폼 검증 힌트 표시
  • 인라인 편집 옵션 활성화

주요 기능

  • 크로스 플랫폼 호환성
  • 적응형 위치 지정
  • 부드러운 애니메이션
  • 사용자 정의 가능한 콘텐츠
  • 터치 및 포인터 이벤트를 지원합니다
  • 화면 경계에 반응

적합한 대상

  • 인터랙티브 UI를 구축하는 개발자
  • 다중 플랫폼을 대상으로 하는 Teams
  • 맥락 오버레이가 필요한 앱
  • 재사용 가능한 팝오버가 필요한 디자인 시스템
  • Material 또는 Cupertino 위젯을 사용하는 프로젝트

고려 사항

  • 적절한 취소 제스처 처리가 필요합니다
  • 복잡한 레이아웃을 위해 맞춤 스타일링이 필요할 수 있습니다
  • 많은 동시 팝오버가 있는 성능 영향
  • 제한된 내장 테마 옵션
  • 지속적인 콘텐츠에 적합하지 않습니다

원본 README

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

Popover

Popover screenshots

Popover for Flutter

Supported platforms Popover is released under the MIT license. Effective Dart PRs welcome!
Current Build Status.

Content

Features

A popover is a transient view that appears above other content onscreen when you tap a control or in an area. Typically, a popover includes an arrow pointing to the location from which it emerged. Popovers can be nonmodal or modal. A nonmodal popover is dismissed by tapping another part of the screen or a button on the popover. A modal popover is dismissed by tapping a Cancel or other button on the popover.

Source: Human Interface Guidelines.

Requirements

  • Dart: 3.9.0+
  • Flutter: 3.35.0+

Install

dependencies:
  popover: ^0.4.0

Example

See example/lib/main.dart.

import 'package:flutter/material.dart';
import 'package:popover/popover.dart';

class PopoverExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Popover Example')),
        body: const SafeArea(
          child: Padding(
            padding: EdgeInsets.all(16),
            child: Button(),
          ),
        ),
      ),
    );
  }
}

class Button extends StatelessWidget {
  const Button({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 80,
      height: 40,
      decoration: const BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.all(Radius.circular(5)),
        boxShadow: [BoxShadow(color: Colors.black26, blurRadius: 5)],
      ),
      child: GestureDetector(
        child: const Center(child: Text('Click Me')),
        onTap: () {
          showPopover(
            context: context,
            bodyBuilder: (context) => const ListItems(),
            onPop: () => print('Popover was popped!'),
            direction: PopoverDirection.bottom,
            width: 200,
            height: 400,
            arrowHeight: 15,
            arrowWidth: 30,
          );
        },
      ),
    );
  }
}

class ListItems extends StatelessWidget {
  const ListItems({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
        padding: const EdgeInsets.symmetric(vertical: 8),
        child: ListView(
          padding: const EdgeInsets.all(8),
          children: [
            InkWell(
              onTap: () {
                Navigator.of(context)
                  ..pop()
                  ..push(
                    MaterialPageRoute<SecondRoute>(
                      builder: (context) => SecondRoute(),
                    ),
                  );
              },
              child: Container(
                height: 50,
                color: Colors.amber[100],
                child: const Center(child: Text('Entry A')),
              ),
            ),
            const Divider(),
            Container(
              height: 50,
              color: Colors.amber[200],
              child: const Center(child: Text('Entry B')),
            ),
            const Divider(),
            Container(
              height: 50,
              color: Colors.amber[300],
              child: const Center(child: Text('Entry C')),
            ),
          ],
        ),
    );
  }
}

class SecondRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Second Route'),
        automaticallyImplyLeading: false,
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () => Navigator.pop(context),
          child: const Text('Go back!'),
        ),
      ),
    );
  }
}

To see examples of the following package on a device or simulator:

cd example && flutter run

Support

This project accepts pull requests only.

If you've encountered a bug or have an improvement in mind, please open a PR with a minimal fix or a reproduction in the example app. See CONTRIBUTING.md for the full contribution process.

License

The source code of the Popover project is available under the MIT license. See the LICENSE file for more info.

카테고리

소스 저장소

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