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

wp_pivot_flutter 封面
插件详情v1.0.0

wp_pivot_flutter

在 Flutter 中实现的 Windows Phone 风格的 Pivot 标签栏

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
21
喜欢数
12
Pub 分数
135

安装插件

flutter pub add wp_pivot_flutter

插件介绍

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

wp_pivot_flutter 是一个 Flutter 包,实现了类似 Windows Phone 的 pivot 标签栏,提供一种流畅的滑动界面,用于在多个标签页之间导航。该组件设计现代,灵感源自微软 Windows Phone 用户界面,提供平滑的过渡效果和直观的导航体验。该包支持所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,非常适合需要独特标签页体验的跨平台应用。它可轻松集成到 Flutter 应用中,设置简单,并提供多种可自定义的样式选项。

适合场景

  • 跨平台移动和桌面应用
  • 受Windows Phone启发的用户界面设计
  • 基于滑动的标签页导航
  • 仪表板中的内容组织
  • 通过视觉反馈提升用户参与度

主要特点

  • Windows Phone 风格的旋转动画
  • 平滑的水平滑动
  • 可自定义的标签指示器
  • 对多个平台的支持
  • 内置过渡动画
  • 与现有 Flutter 项目的轻松集成

适合对象

  • 寻求独特用户界面组件的开发人员
  • 需要直观的标签导航的应用程序
  • 追求复古现代风格的设计师
  • 针对多个操作系统的项目
  • 希望在各种设备上实现一致用户体验的团队

使用建议

  • 限制为枢轴式标签布局
  • 可能需要额外的样式来处理复杂用例
  • 最适合具有3-5个标签页的应用程序
  • 不太适合高度动态或嵌套的导航
  • 性能在旧设备上可能有所不同

原始 README

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

Starware

wp_pivot_flutter

All Contributors

A Flutter package inspired from Windows Phone Style Pivot Tabs Pivots in action

2026 Update: This project is evolving beyond the Pivot control into a systematic, research-driven recreation of the Windows Phone UI in Flutter. The first published Pivot study uses the WP8.1 emulator; Lumia 1020 validation remains pending. See docs/ROADMAP.md for the vision and methodology, and the research site at chinmaykabi.com/wp_pivot_flutter for the study, project status, and source material.

Requirements

Version 2.3.0 requires Flutter 3.22.0+ and Dart 3.4.0+. See the changelog for release details and pub.dev for registry availability. A merged version is not automatically published. The repository's example app uses Flutter 3.44+ for its current Android toolchain; the package library itself retains the 3.22 minimum.

Full Pivot: native layout and motion

WpPivotView owns both the headers and page content. It follows measurements from Microsoft's real Pivot control running on the WP8.1 emulator: cyclic headers, drag tracking, release-time selection, and separate outgoing/incoming content animations. See the evidence study for recordings, methodology and known limits. Emulator evidence is not labeled as Lumia evidence.

MaterialApp(
  theme: ThemeData(fontFamily: wpPivotFontFamily),
  home: WpPivotView(
    title: 'MY APPLICATION',
    tabTitles: const ['first', 'second', 'third'],
    children: const [
      Center(child: Text('First page')),
      Center(child: Text('Second page')),
      Center(child: Text('Third page')),
    ],
  ),
)

An optional PivotController drives selection; dispose controllers you create. onChanged reports committed selections. Pages keep their state while hidden. Arrow keys navigate, headers support keyboard focus and semantic selection, and the system reduced-animation setting removes the spatial transitions. wrap: false disables cycling at the ends. Give the view a bounded width and height.

Geometry scales from a 480-unit reference viewport. Header and title font families, weights, colors, and PivotMotion parameters can be customized. The package bundles unmodified Selawik 1.01 under the SIL Open Font License; no proprietary Segoe font files are redistributed. Selawik is a fallback, not an identical copy of Segoe WP. Source and hashes are in assets/fonts/SOURCE.json.

Migrating the example

Replace the WpPivot app bar plus external PageView with one WpPivotView, move the page widgets into children, and remove the two-controller synchronization. The full view reproduces native content phases that a stock PageView does not. The existing WpPivot header-only API and PivotController remain available.

Current fidelity limits

The native font and rasterizer differ from Flutter's. Capture timing is too coarse to establish physical display latency; flick parameters remain provisional beyond the recorded inputs. The regression suite replays 21 native core, 21 confirmation and nine header/title input traces, including successful flicks, cancellations, reversal, wrapping and ignored gestures during transitions. Header and title swipes share the content gesture surface. A separate release-web runtime probe measures real engine frame timing, not physical display latency or Lumia performance. Independent hardware validation and broader gesture sampling remain separate work.

Launcher UI primitives

The experimental wp_components.dart entrypoint now contains the reusable UI layer needed to compose a Windows Phone-style launcher without putting launcher policy into this package:

  • WpPhoneTheme, WpTile, and WpTileGrid provide the palette, touch tilt, controlled edit affordances, and explicit four-column layout.
  • WpAppListView, WpAppListHeader, WpAppListRow, and WpAlphabetGrid reproduce the measured list and jump-grid geometry while leaving app data, sorting, and selection destinations with the caller.
  • WpSplitSurfaceView provides the two-surface commit/cancel drag between Start and the app list.
  • WpStaggeredSceneTransition applies a caller-driven perspective entry/exit to one item. The caller supplies scene ordering and transform origin and still decides when navigation happens.
import 'package:wp_pivot_flutter/wp_components.dart';

WpPhoneTheme(
  data: const WpPhoneThemeData.dark(),
  child: WpSplitSurfaceView(
    first: WpTileGrid(placements: tilePlacements),
    second: WpAppListView(children: appListSlots),
  ),
)

Run flutter run -t lib/launcher_components.dart from example/ for a complete composition using placeholder content. The package deliberately does not request the Android home role, enumerate installed packages, launch intents, persist pins, order apps, or schedule live data.

At the 480 x 800 evidence viewport, held-out comparisons found zero edge error for 11 tile surfaces, 10 app-list slots, and 28 alphabet cells. Four held-out lateral commit/cancel replays in both directions ended on the correct page with zero final/separation error; presentation-registered tracking p95 ranged from 3.4 to 22.5 px within the 36 px host-capture uncertainty bound. Raw host timing error is retained separately because emulator timestamps do not identify guest presentation. The staggered scene pose is evidence-informed and visually inspected, but exact native timing and transformed polygons are not claimed. See the component contract and runtime report.

Legacy header-only example

Selection state is managed by a PivotController - pass your own to drive the pivot from the outside, or let the widget create one internally.

import 'package:wp_pivot_flutter/wp_pivot_flutter.dart';

final PivotController pivotController = PivotController(length: 4);
final PageController pageController = PageController();

@override
void initState() {
  super.initState();
  // Keep the PageView in sync with the pivot.
  pivotController.addListener(() {
    pageController.animateToPage(
      pivotController.index,
      duration: const Duration(milliseconds: 600),
      curve: Curves.fastLinearToSlowEaseIn,
    );
  });
}

@override
Widget build(BuildContext context) {
  return Scaffold(
    backgroundColor: Colors.black,
    appBar: WpPivot(
      controller: pivotController,
      backgroundColor: Colors.black,
      fontSize: 42,
      fontWeight: FontWeight.w400,
      selectedTabColor: Colors.white,
      unselectedTabColor: Colors.white38,
      tabTitles: [
        "Tab 1",
        "Tab 2",
        "Tab 3",
        "Tab 4",
      ],
      title: "Title",
      titleColor: Colors.white,
      titleFontSize: 14,
      titleFontWeight: FontWeight.bold,
    ),
    body: PageView(
      controller: pageController,
      onPageChanged: (index) => pivotController.animateTo(index),
      children: const [ /* pages */ ],
    ),
  );
}

Experimental component gallery

Application Bar, Panorama, ToggleSwitch, Slider, ProgressBar, TiltEffect, and the launcher UI primitives are available through the separate package:wp_pivot_flutter/wp_components.dart import. From example/, run flutter run -d chrome -t lib/components.dart to try them together. They are experimental. The three micro controls have repeated WP8.1 emulator measurements and held-out comparisons; the earlier component batch remains pilot evidence. See the component studies for evidence, known differences, and the reusable capture/replay workflow. Emulator results do not establish Lumia hardware fidelity. The existing Pivot API is unchanged.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Chinmay Kabi

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Starware

wp_pivot_flutter is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。