Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import 'package:flutter/material.dart';
class CircleIndicator {
static Widget show() {
return Center(
child: new SizedBox(
height: 50.0,
width: 50.0,
child: new CircularProgressIndicator(
value: null,
strokeWidth: 7.0,
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.keyword),
body: FutureBuilder(
future: _fetchSearchKeyword(widget.keyword),
(BuildContext context, AsyncSnapshot<Autogenerated> snapshot) {
if (snapshot.hasError) {
print("snapshot.error: ${snapshot.error.toString()}");
return Container();
if (snapshot.hasData == false) {
final items =;
return ListView.builder(
physics: ClampingScrollPhysics(),
scrollDirection: Axis.vertical,
itemCount: items.length,
itemBuilder: (context, index) {
final item = items[index];
final contentValue = new ContentValue(
areaCode: item.areacode,
contentId: item.contentid,
contentTypeId: item.contenttypeid,
title: item.title,
imageUrl: item.firstimage);
final image = Utils.isNullOrEmpty(item.firstimage)
? ImageUtil.noImageWidget()
:, fit: BoxFit.cover);
return _buildFeaturedItem(context, contentValue, () {
print("keyword: ${widget.keyword}, title: ${item.title}");
builder: (context) => ContentTypeDetail(
contentValue: contentValue,
imageWidget: image,
}, title: item.title, image: image, subTitle: "");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.