diff --git a/lib/screens/screen/chart/chart_view.dart b/lib/screens/screen/chart/chart_view.dart index dc0de46..0f8fe7d 100644 --- a/lib/screens/screen/chart/chart_view.dart +++ b/lib/screens/screen/chart/chart_view.dart @@ -31,43 +31,49 @@ class _ChartScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - body: CustomScrollView( - slivers: [ - customDiscoverBar(context), //AppBar - SliverList( - delegate: SliverChildListDelegate([ - FutureBuilder( - future: _chartData, - builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { - return const Center( - child: CircularProgressIndicator(), - ); - } else if (snapshot.hasData) { - final List>? melon = snapshot.data; - return ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: melon?.length, - itemBuilder: (context, index) { - return ChartListTile( - title: melon![index]['title']!, - subtitle: melon[index]['label']!, - imgUrl: melon[index]['img']!, - ); - }, - ); - } else { - return Center( - child: Text( - 'Error: ${snapshot.error}', - style: Default_Theme.primaryTextStyle, - ), - ); - } - }), - ])) - ], + body: FutureBuilder( + future: _chartData, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + return const Center( + child: SizedBox( + height: 50, + width: 50, + child: CircularProgressIndicator( + color: Default_Theme.accentColor2, + )), + ); + } else if (snapshot.hasError) { + return Center( + child: Text( + "Error: ${snapshot.error}", + style: Default_Theme.secondoryTextStyleMedium, + ), + ); + } else { + final List>? melon = snapshot.data; + return CustomScrollView( + slivers: [ + customDiscoverBar(context), //AppBar + SliverList( + delegate: SliverChildListDelegate([ + ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: melon?.length, + itemBuilder: (context, index) { + return ChartListTile( + title: melon![index]['title']!, + subtitle: melon[index]['label']!, + imgUrl: melon[index]['img']!, + ); + }, + ), + ])) + ], + ); + } + }, ), backgroundColor: Default_Theme.themeColor, );