搜索插件、代码仓与 APP 分类

插件详情v0.1.0

platform_ui

平台特定的 Widget 和 UI 工具包

近 30 天下载
18
喜欢数
41
Pub 分数
40

安装插件

flutter pub add platform_ui

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Platform UI 是一个 Flutter/Dart 包,提供平台特定的组件和 UI 工具包,旨在为 iOS、Android 及其他平台提供类似原生的体验。它提供了自适应组件,能够根据目标平台自动调整其外观和行为,确保与平台规范保持一致。该包通过抽象平台差异来简化跨平台开发,同时保持视觉保真度。通过 `flutter pub add platform_ui` 进行最少配置,开发者即可提升 UI 响应性和用户体验,而无需编写平台特定代码。

适合场景

  • 使用原生外观和感觉构建跨平台应用
  • 为 iOS 和 Android 创建自适应 UI
  • 简化平台特定小部件的实现
  • 增强跨设备的UI一致性
  • 减少平台感知组件的样板代码

主要特点

  • 适用于不同平台的自动适应小部件
  • 最小配置要求
  • 支持 iOS 和 Android 设计指南
  • 可扩展的部件架构
  • 内置主题以保持平台一致性

适合对象

  • 跨平台 Flutter 开发人员
  • 优先考虑原生用户体验的团队
  • 针对多个操作系统的应用
  • 寻求减少平台特定代码的开发者
  • 需要在各种设备上保持一致的用户界面的项目

使用建议

  • 仅限iOS和Android(未提及桌面端/网页端支持)
  • 依赖外部依赖项以实现完整功能
  • 可能需要额外的自定义以满足复杂的UI需求
  • 不适用于需要高度定制化非原生设计的应用程序
  • 性能影响方面没有明确的文档

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Platform UI

by @KRTirtho

Flutter platform specific UI widgets

It mimics the native UI widgets (android, iOS, macOS, linux and windows) as much as possible in Flutter & has a wide collection of platform specific widgets. The names and APIs are similar to Flutter's Material UI widgets to make the Flutter developer feel at home. It's utilizes:

Feature Highlights

  • Simple and customizable platform specific UI widgets
  • Supports all major platforms (android, iOS, macOS, linux and windows)
  • Exposes the internal API to build widgets on top of it
  • Changeable default TargetPlatform for overriding platform design in another platform (it's crazy but cool)
  • Wide collection of platform specific widgets
  • Widget APIs are similar to Flutter's Material UI widgets
  • Dark Mode support

Install

Run following in a terminal:

$ flutter pub add platform_ui fluent_ui macos_ui libadwaita adwaita

Preview

https://krtirtho.github.io/platform_ui/

Usage

Import the package:

import 'package:platform_ui/platform_ui.dart';

Example

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return PlatformApp(
      title: 'Platform UI',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return PlatformScaffold(
      appBar: PlatformAppBar(
        title: Text('Platform UI'),
      ),
      body: Center(
        child: PlatformText(
          'Hello World',
          style: TextStyle(fontSize: 30),
        ),
      ),
    );
  }
}

Documentation

Screenshots

Desktop (Linux → Macos → Windows)

Desktop

Mobile (Android → iOS)

Mobile

Support

If you like this project, please consider supporting it by:

  • Starring and sharing the project
  • Following @KrTirtho on Twitter
  • Buying us a coffee ☕️

License

MIT

所属分类

依赖

依赖清单 8 项

源码仓库

使用此插件的项目

暂无相关数据。