FLUTTER ECOSYSTEM

israelhudson/side_sheet

一個用於實現側邊抽屜的 Flutter 套件

側邊欄 專案封面
Stars
9
Forks
8
最近推送(UTC)
2025年7月24日
專案狀態
未封存
Israel Hudson GitHub avatar
GITHUB User

Israel Hudson ↗

Flutter, Android, Flutter Instructor, Flutter speaker, Mobile Innovation.

Fortaleza-CE官方網站 ↗
語言C++DartCMakeHTMLCSwiftKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 2 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

side_sheet

A flutter package for implementing of side sheets

A sample. font: https://material.io/components/sheets-side#usage

sample

Simple Usage:

ElevatedButton(
    onPressed: () =>
        SideSheet.right(
            body: Text("Body"),
                context: context
        ),
    child: Text('OPEN RIGHT SIDE SHEET')),


ElevatedButton(
    onPressed: () =>
        SideSheet.left(
            body: Text("Body"),
                context: context
        ),
    child: Text('OPEN LEFT SIDE SHEET')),

Custom Width Side Sheet:

ElevatedButton(
    onPressed: () =>
        SideSheet.right(
            context: context
            width: MediaQuery.of(context).size.width * 0.3,
            body: Text("Body"),
        ),
    child: Text('OPEN RIGHT SIDE SHEET WITH CUSTOM WIDTH')),


ElevatedButton(
    onPressed: () =>
        SideSheet.left(
            context: context
            width: MediaQuery.of(context).size.width * 0.3,
            body: Text("Body"),
        ),
    child: Text('OPEN LEFT SIDE SHEET WITH CUSTOM WIDTH')),

With return arguments

ElevatedButton(
    onPressed: () async {
      final data = await SideSheet.left(
            body: IconButton(icon: Icon(Icons.close),
                      onPressed: () => Navigator.pop(context, 'Data Returns Left')),
            context: context);

      print(data);
    },
    child: Text('OPEN LEFT SIDE SHEET WITH RETURN DATA')
),

ElevatedButton(
    onPressed: () async {
      final data = await SideSheet.right(
            body: IconButton(
                      icon: Icon(Icons.close),
                      onPressed: () => Navigator.pop(context, 'Data Returns Right')),
            context: context);

      print(data);
    },
    child: Text('OPEN RIGHT SIDE SHEET WITH RETURN DATA')
),    

Close sheet in body

Navigator.pop(context);

With arguments

Navigator.pop(context, 'data return');

Buy Me A Coffee