From 514d3cb3141e3b1e8c9b6513b125efe2bbca967f Mon Sep 17 00:00:00 2001 From: Miller Adulu Date: Tue, 5 Nov 2024 15:34:32 +0300 Subject: [PATCH] Fix formatting --- lib/features/feed/ui/feed_screen.dart | 3 +- .../home/widgets/organizers_card.dart | 2 +- lib/features/home/widgets/search_bar.dart | 1 - lib/features/home/widgets/sponsors_card.dart | 36 +++++++++++-------- .../cubit/bookmark_session_cubit.dart | 5 ++- .../cubit/fetch_grouped_sessions_cubit.dart | 4 +-- lib/features/sessions/ui/sessions_screen.dart | 7 +--- lib/features/splash/splash_screen.dart | 3 -- 8 files changed, 30 insertions(+), 31 deletions(-) diff --git a/lib/features/feed/ui/feed_screen.dart b/lib/features/feed/ui/feed_screen.dart index 8f66ec0..a2e0bcd 100644 --- a/lib/features/feed/ui/feed_screen.dart +++ b/lib/features/feed/ui/feed_screen.dart @@ -81,7 +81,8 @@ class _FeedScreenState extends State { height: 100, width: double.infinity, child: Center( - child: CircularProgressIndicator()), + child: CircularProgressIndicator(), + ), ), errorWidget: (_, __, ___) => const SizedBox( height: 100, diff --git a/lib/features/home/widgets/organizers_card.dart b/lib/features/home/widgets/organizers_card.dart index 251b0de..0335db3 100644 --- a/lib/features/home/widgets/organizers_card.dart +++ b/lib/features/home/widgets/organizers_card.dart @@ -56,7 +56,7 @@ class _OrganizersCardState extends State { scrollDirection: Axis.horizontal, itemBuilder: (context, index) => Container( height: size.height * .2, - padding: EdgeInsets.symmetric(horizontal: 8.w), + padding: EdgeInsets.symmetric(horizontal: 8.w), decoration: BoxDecoration( color: isLightMode ? colorScheme.secondaryContainer diff --git a/lib/features/home/widgets/search_bar.dart b/lib/features/home/widgets/search_bar.dart index 467e640..c15a827 100644 --- a/lib/features/home/widgets/search_bar.dart +++ b/lib/features/home/widgets/search_bar.dart @@ -81,7 +81,6 @@ class _SearchBarWidgetState extends State { decoration: InputDecoration( hintText: l10n.searchHint, hintStyle: TextStyle(color: colorScheme.onSurfaceVariant), - border: InputBorder.none, ), onChanged: _onSearchChanged, diff --git a/lib/features/home/widgets/sponsors_card.dart b/lib/features/home/widgets/sponsors_card.dart index 1b5fc6d..97aa2f9 100644 --- a/lib/features/home/widgets/sponsors_card.dart +++ b/lib/features/home/widgets/sponsors_card.dart @@ -58,15 +58,19 @@ class _SponsorsCardState extends State { return Column( children: [ Container( - padding: EdgeInsets.symmetric(horizontal: 8.w), + padding: EdgeInsets.symmetric(horizontal: 8.w), decoration: BoxDecoration( - color: isLightMode ? colorScheme.secondaryContainer : Colors.white, - borderRadius: BorderRadius.circular(10), - border: Border.all( - color:isLightMode ? Colors.transparent : colorScheme.primary, - width: 2, + color: isLightMode + ? colorScheme.secondaryContainer + : Colors.white, + borderRadius: BorderRadius.circular(10), + border: Border.all( + color: isLightMode + ? Colors.transparent + : colorScheme.primary, + width: 2, + ), ), - ), child: ResolvedImage( imageUrl: sponsors .firstWhere( @@ -86,13 +90,17 @@ class _SponsorsCardState extends State { itemBuilder: (context, index) => Container( padding: EdgeInsets.symmetric(horizontal: 8.w), decoration: BoxDecoration( - color: isLightMode ? colorScheme.secondaryContainer : Colors.white, - borderRadius: BorderRadius.circular(10), - border: Border.all( - color: isLightMode ? Colors.transparent : colorScheme.primary, - width: 2, - ), - ), + color: isLightMode + ? colorScheme.secondaryContainer + : Colors.white, + borderRadius: BorderRadius.circular(10), + border: Border.all( + color: isLightMode + ? Colors.transparent + : colorScheme.primary, + width: 2, + ), + ), child: SizedBox( width: size.width / 4, child: ResolvedImage( diff --git a/lib/features/sessions/cubit/bookmark_session_cubit.dart b/lib/features/sessions/cubit/bookmark_session_cubit.dart index 7cc7f0b..61363a1 100644 --- a/lib/features/sessions/cubit/bookmark_session_cubit.dart +++ b/lib/features/sessions/cubit/bookmark_session_cubit.dart @@ -66,10 +66,9 @@ class BookmarkSessionCubit extends Cubit { status: bookmarkStatus, ), ); - } on Failure catch(e) { + } on Failure catch (e) { emit(BookmarkSessionState.error(e.message)); - } - catch (e) { + } catch (e) { emit(BookmarkSessionState.error(e.toString())); } } diff --git a/lib/features/sessions/cubit/fetch_grouped_sessions_cubit.dart b/lib/features/sessions/cubit/fetch_grouped_sessions_cubit.dart index 718907c..216d550 100644 --- a/lib/features/sessions/cubit/fetch_grouped_sessions_cubit.dart +++ b/lib/features/sessions/cubit/fetch_grouped_sessions_cubit.dart @@ -45,12 +45,12 @@ class FetchGroupedSessionsCubit extends Cubit { ); emit(FetchGroupedSessionsState.loaded(groupedSessions: groupedEntries)); - // await _networkFetch(); + await _networkFetch(); return; } if (!hasSessions || forceRefresh) { - // await _networkFetch(); + await _networkFetch(); final localSessions = await _dBRepository.fetchSessions( sessionLevel: sessionLevel, sessionType: sessionType, diff --git a/lib/features/sessions/ui/sessions_screen.dart b/lib/features/sessions/ui/sessions_screen.dart index a9436e9..63444ee 100644 --- a/lib/features/sessions/ui/sessions_screen.dart +++ b/lib/features/sessions/ui/sessions_screen.dart @@ -2,19 +2,14 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fluttercon/common/data/enums/bookmark_status.dart'; -import 'package:fluttercon/common/repository/hive_repository.dart'; import 'package:fluttercon/common/utils/misc.dart'; -import 'package:fluttercon/common/utils/router.dart'; import 'package:fluttercon/common/widgets/app_bar/app_bar.dart'; -import 'package:fluttercon/core/di/injectable.dart'; import 'package:fluttercon/core/theme/theme_colors.dart'; import 'package:fluttercon/features/sessions/cubit/fetch_grouped_sessions_cubit.dart'; import 'package:fluttercon/features/sessions/ui/widgets/day_sessions_view.dart'; import 'package:fluttercon/features/sessions/ui/widgets/day_tab_view.dart'; import 'package:fluttercon/l10n/l10n.dart'; -import 'package:go_router/go_router.dart'; import 'package:intl/intl.dart'; -import 'package:logger/logger.dart'; class SessionsScreen extends StatefulWidget { const SessionsScreen({super.key}); @@ -174,7 +169,7 @@ class _SessionsScreenState extends State ], body: groupedSessions.isNotEmpty ? TabBarView( - physics: NeverScrollableScrollPhysics(), + physics: const NeverScrollableScrollPhysics(), children: groupedSessions.values .map( (dailySessions) => DaySessionsView( diff --git a/lib/features/splash/splash_screen.dart b/lib/features/splash/splash_screen.dart index 91b7c92..c97d640 100644 --- a/lib/features/splash/splash_screen.dart +++ b/lib/features/splash/splash_screen.dart @@ -1,11 +1,8 @@ import 'package:flutter/material.dart'; -import 'package:fluttercon/common/repository/hive_repository.dart'; import 'package:fluttercon/common/utils/constants/app_assets.dart'; import 'package:fluttercon/common/utils/misc.dart'; import 'package:fluttercon/common/utils/router.dart'; -import 'package:fluttercon/core/di/injectable.dart'; import 'package:go_router/go_router.dart'; -import 'package:logger/logger.dart'; class SplashScreen extends StatefulWidget { const SplashScreen({super.key});