herlaad_lijsten.dart 1.2 KB

123456789101112131415161718192021222324252627282930
  1. // Automatic FlutterFlow imports
  2. import '/backend/schema/structs/index.dart';
  3. import '/flutter_flow/flutter_flow_theme.dart';
  4. import '/flutter_flow/flutter_flow_util.dart';
  5. import 'index.dart'; // Imports other custom actions
  6. import '/flutter_flow/custom_functions.dart'; // Imports custom functions
  7. import 'package:flutter/material.dart';
  8. // Begin custom action code
  9. // DO NOT REMOVE OR MODIFY THE CODE ABOVE!
  10. // Set your action name, define your arguments and return parameter,
  11. // and then add the boilerplate code using the `</>` button on the right!
  12. //
  13. import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
  14. Future herlaadLijsten() async {
  15. await WidgetsBinding.instance.endOfFrame;
  16. await Future.delayed(const Duration(milliseconds: 50));
  17. final controllers = <dynamic>[];
  18. final tegaan = <Element>[];
  19. final root = WidgetsBinding.instance.rootElement;
  20. if (root != null) tegaan.add(root);
  21. while (tegaan.isNotEmpty) {
  22. final element = tegaan.removeLast();
  23. final w = element.widget;
  24. if (w is PagedMasonryGridView) controllers.add(w.pagingController);
  25. element.visitChildren(tegaan.add);
  26. }
  27. for (final controller in controllers) controller.refresh();
  28. }