Advertisement
JoshuaLin

Untitled

Jun 24th, 2021
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.79 KB | None | 0 0
  1. FutureBuilder<List<House>>(
  2.           future: fetchHouseList(),
  3.           builder: (context, snapshot) {
  4.             if (snapshot.connectionState == ConnectionState.waiting) {
  5.               return CircularProgressIndicator();
  6.             }
  7.  
  8.             if (snapshot.hasError) {
  9.               return Icon(Icons.error);
  10.             }
  11.  
  12.             final houses = snapshot.data;
  13.  
  14.             return Stack(
  15.               children: houses
  16.                   .map(
  17.                     (house) => Positioned(
  18.                       left: house.x,
  19.                       top: house.y,
  20.                       child: ContextMenuRegion(
  21.                         ...
  22.                       ),
  23.                     ),
  24.                   )
  25.                   .toList(),
  26.             );
  27.           },
  28.         )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement