パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリMelbourneDeveloper/navigation_drawer_menu

ナビゲーションドロワー メニュー

Flutter Material Design ナビゲーションドロワー メニュー

ナビゲーションドロワー メニュー のプロジェクト画像
スター
8
フォーク
2
最終プッシュ(UTC)
2022/07/28
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

navigation_drawer_menu

Flutter Material Design Navigation Drawer Menu

Navigation drawer is a common UI pattern for adaptive menus. The Material Design documentation formalizes the behavior of the menu but this pattern is not peculiar to Material Design. The pattern includes a basic Hamburger menu but isn't limited to small screens. The menu pattern suits all screen sizes. On larger width screens you see the icon and text, smaller screens will display icons only, and on phones, the menu will disappear during normal use and slide in with the hamburger icon.

Hamburger Menu

Beta

This widget is in beta and the public interface is likely to change

Example

The example aims to implement the Navigation Drawer pattern documented above. This is a work in progress and conformance to the behavior in the Material Design documentation is the long term aim. Pull requests to fix behavior are welcome. The example works on all form factors: desktop and tablet (landscape, portrait), phone, and web. Try resizing the width of the window to see how the behavior changes. Most of the behavior exists in the example. the aim is to create a new widget which will replace Scaffold and allow you to spin up new apps with this functionality very quickly.

Note: if you're just looking for a simple drawer menu that doesn't adapt to the screen, check out this.

Hamburger Menu

Hamburger Menu

Hamburger Menu

Run the Example
  • Open the root folder in Visual Studio Code
  • Open a terminal window
  • Add platforms by running these commands in the root folder (not example folder)
  • Click Run -> Start Debugging
flutter create example --platforms=windows,macos,linux

flutter create --platforms=web

flutter create --platforms=android

NavigationDrawerMenu

This is a widget that basically functions like a ListView. However, it exists to remove some of the boilerplate code necessary for constructing the menu, and allows you to put arbitrary sized spacers and headings inside the menu. The example uses this set of definitions. If you don't want to use this widget, you can use ListView instead.

final Map<Key, MenuItemContent> menuItems = {
  alarmValueKey: MenuItemContent(
      menuItem: MenuItemDefinition("Alarm", alarmValueKey,
          iconData: Icons.access_alarm)),
  todoValueKey: MenuItemContent(
      menuItem: MenuItemDefinition("Todo", todoValueKey,
          iconData: Icons.ad_units_rounded)),
  photoValueKey: MenuItemContent(
      menuItem: MenuItemDefinition("Photo", photoValueKey,
          iconData: Icons.add_a_photo_outlined))
};
Christian Findlay GitHub avatar
GitHub 作者

Christian Findlay ↗

Building frameworks, tools and apps with AI in Melbourne, Australia

Melbourne, Australia公式サイト ↗
言語Dart

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 6 件

  • flutter{"sdk":"flutter"}
  • material^1.0.0+2
  • dart_code_metrics開発用^4.16.0
  • lints開発用^1.0.1
  • pedantic開発用^1.11.1
  • test開発用—

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

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

GitHub Docs — About repositories ↗