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

套件詳情v0.0.2

golden_layout

一個基於 http://golden-layout.com/ 的 Flutter 內部視窗庫

近 30 天下載
21
喜歡數
36
Pub 分數
40

安裝套件

flutter pub add golden_layout

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Golden Layout 是一個 Flutter 套件,將 Golden Layout 庫強大的視窗管理功能帶入 Flutter 應用程式。它讓開發者能夠建立複雜、可調整大小且可拖曳的 UI 排版,支援多個面板、巢狀排列與動態內容。專為內部應用介面設計,非常適合需要自訂工作區的工具,例如儀表板、IDE 或資料視覺化平台。此套件能與 Flutter 的元件系統無縫整合,同時維持效能與回應速度。

適用情境

  • 儀表板介面
  • 類IDE的開發環境
  • 資料視覺化工具
  • 多面板報表應用
  • 可自訂的使用者工作區

主要特色

  • 可調整大小且可拖曳的面板
  • 巢狀佈局支援
  • 動態面板排列
  • 對多種內容類型的支援
  • 與 Flutter 小部件的整合

適合對象

  • 開發複雜 UI 的開發者
  • 需要靈活工作區佈局的應用程式
  • 需要多面板介面的工具
  • 類桌面 Flutter 應用程式
  • 以UI為主的內部工具

使用建議

  • 未針對行動優先設計進行最佳化
  • 可用文件有限
  • 可能需要自訂樣式以滿足進階使用案例需求
  • 最適合桌面或平板情境
  • 狀態管理中的潛在複雜性

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Buy Me A Coffee Donate golden_layout

golden_layout

A Flutter inspired package from http://golden-layout.com/

Demo: https://rodydavis.github.io/golden_layout/

screenshot

Example

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Golden Layout'),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  final _controller = WindowController();
  int _count = 0;

  @override
  void initState() {
    final _group = WindowGroup();
    _group.addTab(_getTab(_count++));
    (_controller.base as WindowColumn).children.add(_group);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
        actions: [
          IconButton(
            tooltip: 'Add Window',
            icon: Icon(Icons.restore),
            onPressed: () {
              if (mounted)
                setState(() {
                  _controller.base =
                      WindowColumn([WindowGroup()..addTab(_getTab(_count++))]);
                });
            },
          ),
          IconButton(
            tooltip: 'Add Group',
            icon: Icon(Icons.list),
            onPressed: () {
              if (mounted)
                setState(() {
                  final _group = WindowGroup();
                  _group.addTab(_getTab(_count++));
                  (_controller.base as WindowColumn).children.add(_group);
                });
            },
          ),
          IconButton(
            tooltip: 'Add Row',
            icon: Icon(Icons.category),
            onPressed: () {
              if (mounted)
                setState(() {
                  final _group1 = WindowGroup()..addTab(_getTab(_count++));
                  final _group2 = WindowGroup()..addTab(_getTab(_count++));
                  (_controller.base as WindowColumn)
                      .children
                      .add(WindowRow([_group1, _group2]));
                });
            },
          ),
        ],
      ),
      body: GoldenLayout(
        controller: _controller,
      ),
    );
  }

  WindowTab _getTab(int count) {
    return WindowTab(
        title: 'Window $count',
        child: Container(color: Colors.red[100 * count]));
  }
}

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。