搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫renoinn/scrollable_panel

可滾動面板

renoinn/scrollable_panel open-source repository details.

可滾動面板 專案封面
星標
4
分支
0
最近推送(UTC)
2021年3月12日
專案狀態
未封存

原始 README

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

scrollable_panel

pub package

drag to expand and then can scroll contents. similar "Nearby spots" panel on google map app.

https://pub.dev/packages/scrollable_panel

Panel Properties

Properties Data Type Description
builder ScrollableWidgetBuilder builder for inner panel view. ScrollableWidgetBuilder type define in draggable_scrollable_sheet.dart. provide PanelScrollController that extends ScrollController.
controller PanelController control panel from some interaction like button.
defaultPanelState PanelState set default panel state. (default value PanelState.open)
defaultPanelSize double set default panel height factor (default value 0.25)
minPanelSize double set minimum panel height factor. (default value 0)
maxPanelSize double set maximum panel height factor. (default value 1.0)
onOpen VoidCallback if non-null, this callback is called when panel state become open
onClose VoidCallback if non-null, this callback is called when panel state become close
onExpand VoidCallback if non-null, this callback is called when panel state become expand

PanelController actions

Action Data Type Description
open void open panel. panel animate to defaultPanelSize.
expand void expand panel. panel animate to maxPanelSize.
close void close panel. panel animate to minPanelSize.
animateTo double animate panel to value height.

Usage

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  PanelController _panelController = PanelController();
  
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('scrollable panel'),
      ),
      body: Stack(
        children: <Widget>[
          InkWell(
            onTap: () {
              _panelController.toDefault();
            },
            child: _FirstView(),
          ),
          ScrollablePanel(
            controller: _panelController,
            builder: (context, controller) {
              return SingleChildScrollView(
                controller: controller,
                child: _SecondView(),
              );
            },
          ),
        ],
      ),
    );
  }
}

TODO

  • ~write README.md and dartdoc~
  • ~null-safety support~
  • ~write test code~
  • add List<double> anchor property to use multi snapping point.
tooi GitHub avatar
GitHub 作者

tooi ↗

語言DartRubySwiftKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • pedantic開發依賴^1.11.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗