Get top and recent images from Midjouney showcase https://www.midjourney.com/showcase/recent/
class RecentImages extends StatelessWidget {
const RecentImages({super.key});
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: MidJourneyApi().fetchRecent(),
builder: (context, snapshot) {
if (snapshot.hasData) {
final images = snapshot.data as List<String>;
return GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
),
itemCount: images.length,
itemBuilder: (context, index) {
return Card(child: Image.network(images[index]));
},
);
} else {
return const Center(
child: CircularProgressIndicator(),
);
}
},
);
}
}
Same thing for top images