flow_delegate.dart 428 B

12345678910111213141516
  1. import 'package:flutter/material.dart';
  2. // Flow 的布局delegate 上下叠加
  3. class CameraFlowDelegate extends FlowDelegate {
  4. @override
  5. void paintChildren(FlowPaintingContext context) {
  6. for (var i = 0; i < context.childCount; i++) {
  7. context.paintChild(i, transform: Matrix4.translationValues(0, 0, 0));
  8. }
  9. }
  10. @override
  11. bool shouldRepaint(FlowDelegate oldDelegate) {
  12. return oldDelegate != this;
  13. }
  14. }