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

solid_bottom_sheet 표지
패키지 상세v0.1.13

solid_bottom_sheet

완전히 사용자 정의 가능한 하단 시트로 구현이 매우 간편합니다. Scaffold 위젯의 bottomSheet 속성에 넣기만 하면 마법을 볼 수 있습니다. 자세한 내용은 README.md를 참조하세요.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
3천
좋아요
210
Pub 점수
120

패키지 설치

flutter pub add solid_bottom_sheet

패키지 개요

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

SolidBottomSheet는 Flutter용으로 고도로 사용자 정의 가능한 바텀 시트 위젯으로, Scaffold의 bottomSheet 속성에 원활하게 통합되도록 설계되었습니다. 부드러운 애니메이션, 외관 및 동작에 대한 완전한 제어를 제공하며, 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼을 지원합니다. 최소한의 설정으로 개발자는 앱 디자인에 맞게 반응형이고 시각적으로 매력적인 바텀 시트를 신속하게 구현할 수 있습니다. 이 패키지는 유연성을 희생하지 않고도 사용의 용이성을 강조합니다.

사용 사례

  • 접을 수 있는 콘텐츠 패널 구현
  • 드래그 제스처를 사용하여 상호작용 모달 만들기
  • 동적 폼 또는 필터 만들기
  • 사용자 정의 탐색 드로어 설계
  • 확장 가능한 정보 카드 추가

주요 기능

  • 완전히 사용자 정의 가능한 외관
  • 부드러운 드래그 전개 애니메이션
  • 크로스 플랫폼 지원
  • Scaffold와의 간단한 통합
  • 사용자 정의 가능한 높이 및 스냅 포인트
  • 중첩 스크롤을 지원합니다

적합한 대상

  • 빠른 바텀 시트 구현을 원하는 개발자
  • 다양한 플랫폼 간 일관된 하단 시트 UX가 필요한 앱
  • 시트 스타일링에 대해 세밀한 제어를 원하는 디자이너
  • 복잡한 바텀 시트 상호작용을 가진 프로젝트

고려 사항

  • 복잡한 레이아웃을 위해 추가 스타일링이 필요할 수 있습니다
  • 많은 콘텐츠 사용 시 성능에 미치는 영향
  • 제한된 내장 테마 옵션
  • 매우 크거나 밀도 높은 콘텐츠 영역에는 적합하지 않음

원본 README

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

Solid bottom sheet

Pub

A full customizable bottom sheet easy to implement. Just put it on your bottomSheet property on your Scaffold widget and see the magic. For more details see the README.md. Feel free to contribute. This package is open to recieve pull request on github. Enjoy! :D

Screenshots

Usage

SolidBottomSheet(
        headerBar: Container(), // Your header here
        body: Container(), // Your body here
      ),

Properties

  // This controls the minimum height of the body. Must be greater or equal of 0.
  // By default is 0
  final double minHeight;

  // This controls the minimum height of the body. By default is 500
  final double maxHeight;

  // This is the content that will be hided of your bottomSheet. You can fit any
  // widget. This parameter is required
  final Widget body;

  // This is the header of your bottomSheet. This widget is the swipeable area
  // where user will interact. This parameter is required
  final Widget headerBar;

  // This flag is used to enable the automatic swipe of the bar. If it's true
  // the bottomSheet will automatically appear or disappear when user stops
  // swiping, but if it's false, it will stay at the last user finger position.
  // By default is true
  final bool autoSwiped;

  // This flag enable that the user can toggle the visibility with just tapping on
  // the header bar. By default is false
  final bool toggleVisibilityOnTap;

  // This flag enable that users can swipe the body and hide or show the
  // solid bottom sheet. Turn on false if you don't want to let the user
  // interact with the solid bottom sheet. By default is false.
  final bool draggableBody;
  
  // This flag enable that users can swipe the header and hide or show the 
  // solid bottom sheet. Turn on false if you don't want to let the user 
  // interact with the solid bottom sheet. By default is true. 
  final bool canUserSwipe;

  // This property defines how 'smooth' or fast will be the animation. Low is
  // the slowest velocity and high is the fastest. By default is medium.
  final Smoothness smoothness;

  // This property is the elevation of the bottomSheet. Must be greater or equal
  // to 0. By default is 0.
  final double elevation;

  // This flag controls if the body is shown to the user by default. If it's
  // true, the body will be shown. If it's false the body will be hided. By
  // default it's false.
  final bool showOnAppear;

  // This object used to control behavior internally
  // from the app and don't depend of user's interaction.
  // can hide and show  methods plus have isOpened variable
  // to check widget visibility on a screen
  final SolidController controller;

  // This method will be executed when the solid bottom sheet is completely
  // opened.
  final Function onShow;

  // This method will be executed when the solid bottom sheet is completely
  // closed.
  final Function onHide;

Controller

  // This is the current smoothness of the bottomSheet
  Smoothness smoothness;

  // Returns the value of the height as stream
  Stream<double> heightStream;

  // Returns the value of the visibility as stream
  Stream<bool> isOpenStream;

  // Returns the value of the height
  double height;

  //  Returns if the solid bottom sheet is opened or not
  bool isOpened;

  // This method sets the value of the height using streams
  void height(double value);

  // Updates the visibility value to false
  void hide();

  // Updates the visibility value to true
  void show();

Example

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Solid bottom sheet example"),
      ),
      body: Center(
      child: FlutterLogo(),
      ),
      bottomSheet: SolidBottomSheet(
        headerBar: Container(
          color: Theme.of(context).primaryColor,
          height: 50,
          child: Center(
            child: Text("Swipe me!"),
          ),
        ),
        body: Container(
          color: Colors.white,
          height: 30,
          child: Center(
            child: Text(
              "Hello! I'm a bottom sheet :D",
              style: Theme.of(context).textTheme.display1,
            ),
          ),
        ),
      ),
    );
  }
}

Contribute

Feel free to fork and make pull request to enhance the package.

Github here.

Special Thanks

Viktor Goltstein - Github Nicolei Esperida - Github

Posible incoming features

  • A Shadow that covers the back of the bottom sheet to feel more native.
  • Full view option that displays the bottom sheet like a new navigated page.
  • Controller callbacks to execute when show() and hide() methods are invoked.

카테고리

소스 저장소

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

아직 데이터가 없습니다.