staggered_reorderable 0.0.14 copy "staggered_reorderable: ^0.0.14" to clipboard
staggered_reorderable: ^0.0.14 copied to clipboard

可拖拽的不规则瀑布流排序

example/lib/main.dart

import 'dart:math';
import 'package:flutter/material.dart';
import 'package:staggered_reorderable/staggered_reorderable.dart';

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

class MyAPP extends StatelessWidget {
  MyAPP({super.key});

  final crossList = List.generate(20, (_) => Random().nextInt(2) + 1);
  final mainList = List.generate(20, (_) => Random().nextInt(2) + 1);

  Widget _body() {
    List<ReorderableItem> children = [];
    for (int i = 0; i < 20; i++) {
      children.add(ReorderableItem(
        trackingNumber: i,
        id: '$i',
        crossAxisCellCount: crossList[i],
        mainAxisCellCount: mainList[i],
        child: Center(child: Text('$i')),
      ));
    }
    return StaggeredReorderableView.customer(children: children, columnNum: 4);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Example'),
        ),
        body: SizedBox(
          width: double.infinity,
          height: double.infinity,
          child: _body(),
        ),
      ),
    );
  }
}
15
likes
150
points
421
downloads

Publisher

unverified uploader

Weekly Downloads

可拖拽的不规则瀑布流排序

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on staggered_reorderable