@@ -303,79 +303,37 @@ class _HomeScreenState extends ConsumerState<HomeScreen> {
303303 }
304304
305305 Widget _buildBody (BuildContext context, AppLocalizations localizations) {
306- final seriesAsync = ref.watch (seriesListFutureProvider);
307- final fontSize = getLocalizedFontSize (AppTextSize .title);
308-
309306 return Expanded (
310307 child: RefreshIndicator (
311308 onRefresh: _onRefresh,
312- child: seriesAsync.when (
313- data: (seriesEither) {
314- return seriesEither.fold (
315- (failure) => _buildScrollableMessage (
316- ErrorStateWidget (error: failure, onRetry: _refetchSeries),
317- ),
318- (seriesList) {
319- if (seriesList.isEmpty) {
320- return _buildScrollableMessage (
321- Padding (
322- padding: const EdgeInsets .all (
323- HomeScreenConstants .emptyStatePadding,
324- ),
325- child: Text (
326- localizations.no_feature_content,
327- style: TextStyle (fontSize: fontSize),
328- textAlign: TextAlign .center,
329- ),
330- ),
331- );
332- }
333-
334- return CustomScrollView (
335- physics: const AlwaysScrollableScrollPhysics (),
336- slivers: [
337- SliverToBoxAdapter (
338- child: Column (
339- mainAxisSize: MainAxisSize .min,
340- children: [
341- const SizedBox (
342- height: HomeScreenConstants .cardSpacing,
343- ),
344- _buildVerseOfDaySection (),
345- const SizedBox (
346- height: HomeScreenConstants .cardSpacing,
347- ),
348- HomeShortcutsRow (
349- onTimerTap: () => _openGatedFeature ('/home/timers' ),
350- onMalaTap: () => _openGatedFeature ('/mala' ),
351- ),
352- const SizedBox (
353- height: HomeScreenConstants .cardSpacing,
354- ),
355- _buildMyPracticesSection (),
356- const SizedBox (
357- height: HomeScreenConstants .cardSpacing,
358- ),
359- FeaturedPlanSection (
360- onSeriesTap: (series) {
361- _log.info ('Featured series tapped: ${series .id }' );
362- _navigateToSeries (series);
363- },
364- ),
365- ],
366- ),
367- ),
368- const SliverToBoxAdapter (child: HomeSharePrompt ()),
369- ],
370- );
371- },
372- );
373- },
374- loading: () => const SizedBox .shrink (),
375- error:
376- (error, stackTrace) => _buildScrollableMessage (
377- ErrorStateWidget (error: error, onRetry: _refetchSeries),
309+ child: CustomScrollView (
310+ physics: const AlwaysScrollableScrollPhysics (),
311+ slivers: [
312+ SliverToBoxAdapter (
313+ child: Column (
314+ mainAxisSize: MainAxisSize .min,
315+ children: [
316+ const SizedBox (height: HomeScreenConstants .cardSpacing),
317+ _buildVerseOfDaySection (),
318+ const SizedBox (height: HomeScreenConstants .cardSpacing),
319+ HomeShortcutsRow (
320+ onTimerTap: () => _openGatedFeature ('/home/timers' ),
321+ onMalaTap: () => _openGatedFeature ('/mala' ),
322+ ),
323+ const SizedBox (height: HomeScreenConstants .cardSpacing),
324+ _buildMyPracticesSection (),
325+ const SizedBox (height: HomeScreenConstants .cardSpacing),
326+ FeaturedPlanSection (
327+ onSeriesTap: (series) {
328+ _log.info ('Featured series tapped: ${series .id }' );
329+ _navigateToSeries (series);
330+ },
331+ ),
332+ ],
378333 ),
334+ ),
335+ const SliverToBoxAdapter (child: HomeSharePrompt ()),
336+ ],
379337 ),
380338 ),
381339 );
0 commit comments