Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

automatic keepalive flutter tabs

Future<...> _loadingDeals;

@override
void initState() {
  _loadingDeals = loadDeals(); // only create the future once.
  super.initState();
}

@override
Widget build(BuildContext context) {
  super.build(context); // because we use the keep alive mixin.
  return new FutureBuilder(future: _loadingDeals, /* ... */);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #automatic #keepalive #flutter #tabs
ADD COMMENT
Topic
Name
2+2 =