简体   繁体   English

如何在 Flutter 上为移动设备创建一个可变形的网格 UI?

[英]How to create a transformable grid UI on Flutter for mobile?

What is the name of this UI below?下面这个 UI 的名称是什么?

How do I create one in Flutter?如何在 Flutter 中创建一个?

These are the desired characteristics:这些是所需的特性:

  • The scalability of the grid must have max and min values.网格的可扩展性必须有最大值和最小值。
  • Pinch to zoom function.双指缩放 function。
  • Elements or vector properties should be able to snap to the grid.元素或矢量属性应该能够捕捉到网格。

Is there a library that can serve this function?有图书馆可以服务这个function吗?

Thank you for your help!谢谢您的帮助!

在此处输入图像描述 在此处输入图像描述

Use the transformable package found on pub.dev .使用 pub.dev 上的可转换package See the example lib.dart file in the Github example folder .请参阅Github 示例文件夹中的示例 lib.dart 文件。

A code snippet from the pud.dev page:来自 pud.dev 页面的代码片段:

LayoutBuilder(
  builder: (context, constraints) => Transformable(
    child: Grid(),
    viewerSize: viewerSize,
    controller: TransformController(
      config: TransformConfig(
        initialTransform: Transformation(offset: startOffset),
        initialSize: childStartSize,
        innerBoundRect: innerRect,
        outerBoundRect: outerRect,
      ),
    ),
  );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM