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

auto_size_widget 封面
套件詳情v0.0.4

auto_size_widget

一個可以透過拖曳元件角落來調整子元件大小的 Flutter 小部件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
153
喜歡數
38
Pub 分數
130

安裝套件

flutter pub add auto_size_widget

套件介紹

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

auto_size_widget 套件提供了一個 Flutter 小部件,可透過拖曳角落來動態調整其子組件的大小,進而實現直觀的版面調整。此套件專為需要在應用程式中手動調整元件的互動式介面設計。支援多個平台,包括 Android、iOS、Web、macOS、Windows 與 Linux,適用於跨平台開發。可與現有的 Flutter 版面無縫整合,並透過直接操作提升使用者體驗。

適用情境

  • 互動式使用者介面設計
  • 動態佈局調整
  • 使用者驅動的元件調整大小
  • 跨平台響應式介面
  • 原型化互動式佈局
  • 即時UI自定義

主要特色

  • 角落拖曳調整大小功能
  • 跨平台相容性
  • 與 Flutter 小部件的輕鬆整合
  • 支援所有主要平台
  • 所需的設定最少
  • 響應式版面行為

適合對象

  • UI設計師原型設計互動佈局
  • 開發可自訂儀表板的開發者
  • 需要手動調整小部件大小的應用
  • 跨平台應用程式與動態 UI
  • 帶有互動元素的教育或創意工具

使用建議

  • 可能與其他手勢檢測器衝突
  • 複雜子組件帶來的效能影響
  • 在嵌套版面中需要謹慎處理
  • 不適用於靜態或只讀UI
  • 僅限單子節點調整大小,無需額外邏輯
  • 觸控手勢可能存在的可存取性挑戰

原始 README

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

Auto Size Widget

A Flutter widget that can resize the child widget by dragging the widget corner.

Installation

  1. Add the latest version of the package to your pubspec.yaml (and run 'dart pub get'):
dependencies:
    auto_size_widget: ^0.0.3
  1. Import the package and use it in your Flutter app.
import 'package:auto_size_widget/auto_size_widget.dart';

Example

  1. To resize both the height and the width of the widget

initialWidth and initialHeight should be different from maxWidth and maxHeight respectively.

AutoSizeWidget(
  initialWidth: 120,
  initialHeight: 120,
  maxWidth: 320,
  maxHeight: 320,
  boxDecoration: BoxDecoration(
    border: Border.all(width: 1, color: Colors.grey),
    borderRadius: BorderRadius.circular(5)),
  child: Image.network(
    'https://docs.flutter.dev/assets/images/dash/early-dash-sketches2.jpg',
    fit: BoxFit.fill,
  ),
),
  1. To resize the height of the widget

initialWidth and maxWidth should be same to ensure that the width does not change on resize.

AutoSizeWidget(
  initialWidth: 250,
  initialHeight: 120,
  maxWidth: 250,
  maxHeight: 280,
  boxDecoration: BoxDecoration(
    border: Border.all(width: 1, color: Colors.grey),
    borderRadius: BorderRadius.circular(5),
  ),
  child: const SelectableText(
    "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
  ),
),           
  1. To resize the width of the widget

initialHeight and maxHeight should be same to ensure that the height does not change on resize.

AutoSizeWidget(
  initialWidth: 150,
  initialHeight: 200,
  maxWidth: 300,
  maxHeight: 200,
  boxDecoration: BoxDecoration(
    border: Border.all(width: 1, color: Colors.grey),
    borderRadius: BorderRadius.circular(5)),
  child: TextFormField(
    keyboardType: TextInputType.multiline,
    maxLines: 3 * 120,
    textAlign: TextAlign.start,
    decoration: const InputDecoration(
      focusedBorder: InputBorder.none,
      contentPadding:
        EdgeInsets.symmetric(vertical: 11, horizontal: 15),
      hintText: "Enter text here"
    ),
  ),
),                  

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。