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

GitHub リポジトリstryder-dev/flutter_platform_widgets

flutter_platform_widgets

共通のプラットフォーム対応ウィジェットを通じて、Android用のMaterialデザインとiOS用のCupertinoデザインをターゲットにする

flutter_platform_widgets のプロジェクト画像
スター
1627
フォーク
171
最終プッシュ(UTC)
2026/01/14
プロジェクト状態
公開中

元の README

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

⚠️ Package Discontinued

Due to Flutter's decision to split out Material and Cupertino widgets into their own packages, this project is now no longer supported.

No further bug fixes or compatibility updates will be provided.

Flutter Platform Widgets

Flutter Platform Widgets

Pub GitHub

TL;DR;

A wrapper library that makes it easier to target the design language of your chosen platform using a single widget.

Bit more

For anyone that starts with building apps with Flutter it becomes clear that picking the right widget is important. This typically starts with using the Material set of widgets which is the default look and feel for Android. However when designing screens for iOS and the Cupertino design language a double up of effort is required to cater for a new set of widgets.

This project was initially an experiment which grew into a fully fledged package to support the look using the Material and Cupertino designed widgets with a single platform widget.

If you want to build a Material and Cupertino looking app with very similar functionality then this package could save you time and effort.


This package supports the Stable release as a full released version.

Beta channels might be supported when there is a pre-release version. Please check the CHANGELOG for version compatibility.

Due to Master being in rapid development this package is unable to support the Master channel. If this support is required then it is best to fork the repo and locally reference the forked version where you can make changes appropriately.


Installation

pub.dev: https://pub.dev/packages/flutter_platform_widgets/install

How it works

Instead of having to write conditional code like this...

if (Platform.isAndroid) {
  return ElevatedButton(onPressed: onPressed, child: child);
} else if (Platform.isIOS) {
  return CupertinoButton.filled(onPressed: onPressed, child: child);
}

you can use a single platform widget which will render the correct underlying widget based on the ThemeData.platform property...

return PlatformElevatedButton(onPressed: onPressed, child: child);

The heavy lifting of choosing the right widget is done for you.

You can also specify what design language you want for any supported platforms within flutter. These include:

  • Android
  • iOS
  • Web
  • Macos
  • Windows
  • Linux

Docs

View the package wiki for details of how to use and the list of available widgets

Issues and Feedback

Please create an issue to provide feedback or an issue.

License

MIT

Contributors

Special thanks for everyone that have contributed to this project over the last 5 years...

Made with contrib.rocks.

Inspired by the example given by Swav Kulinski (https://github.com/swavkulinski/flutter-platform-specific-widgets)

stryder-dev GitHub avatar
GitHub 作者

stryder-dev ↗

言語DartHTMLPythonSwiftKotlinObjective-C

カテゴリー

使用している依存関係

依存関係一覧 3 件

  • flutter{"sdk":"flutter"}
  • cupertino_icons^1.0.8
  • flutter_test開発用{"sdk":"flutter"}

ランキング

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

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

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

情報源と管理

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

GitHub Docs — About repositories ↗