diff --git a/lib/bootstrap.dart b/lib/bootstrap.dart index 349f0f8..d3ff503 100644 --- a/lib/bootstrap.dart +++ b/lib/bootstrap.dart @@ -43,7 +43,7 @@ class AppBlocObserver extends BlocObserver { } Future bootstrap(FutureOr Function() builder) async { - await runZonedGuarded(() async { + try { Bloc.observer = const AppBlocObserver(); await Firebase.initializeApp( @@ -86,6 +86,7 @@ Future bootstrap(FutureOr Function() builder) async { create: (_) => LogOutCubit( authRepository: getIt(), hiveRepository: getIt(), + dbRepository: getIt(), ), ), BlocProvider( @@ -129,6 +130,7 @@ Future bootstrap(FutureOr Function() builder) async { apiRepository: getIt(), dBRepository: getIt(), notificationService: getIt(), + hiveRepository: getIt(), ), ), BlocProvider( @@ -156,7 +158,7 @@ Future bootstrap(FutureOr Function() builder) async { child: await builder(), ), ); - }, (error, stackTrace) { + } catch (error, stackTrace) { if (kDebugMode) { log(error.toString(), stackTrace: stackTrace); } else { @@ -169,5 +171,5 @@ Future bootstrap(FutureOr Function() builder) async { return true; }; } - }); + } } diff --git a/lib/common/data/enums/organiser_type.dart b/lib/common/data/enums/organiser_type.dart new file mode 100644 index 0000000..794e1d9 --- /dev/null +++ b/lib/common/data/enums/organiser_type.dart @@ -0,0 +1,8 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +enum OrganiserType { + @JsonValue('individual') + individual, + @JsonValue('company') + company; +} diff --git a/lib/common/data/enums/sponsor_type.dart b/lib/common/data/enums/sponsor_type.dart index 967163f..8a049a8 100644 --- a/lib/common/data/enums/sponsor_type.dart +++ b/lib/common/data/enums/sponsor_type.dart @@ -1,21 +1,16 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + enum SponsorType { + @JsonValue('platinum') platinum, + @JsonValue('swag') swag, + @JsonValue('startup') startup, - venue; - - static SponsorType fromValue(String value) { - switch (value) { - case 'platinum': - return SponsorType.platinum; - case 'swag': - return SponsorType.swag; - case 'startup': - return SponsorType.startup; - case 'venue': - return SponsorType.venue; - default: - throw Exception('Unknown sponsor type: $value'); - } - } + @JsonValue('venue') + venue, + @JsonValue('bronze') + bronze, + @JsonValue('gold') + gold; } diff --git a/lib/common/data/models/individual_organiser.dart b/lib/common/data/models/individual_organiser.dart deleted file mode 100644 index 8be0be0..0000000 --- a/lib/common/data/models/individual_organiser.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'individual_organiser.freezed.dart'; -part 'individual_organiser.g.dart'; - -@freezed -class IndividualOrganiser with _$IndividualOrganiser { - factory IndividualOrganiser( - String name, - String tagline, - String link, - String type, - String bio, - String designation, - String photo, - @JsonKey(name: 'twitter_handle') String twitterHandle, - ) = _IndividualOrganiser; - - factory IndividualOrganiser.fromJson(Map json) => - _$IndividualOrganiserFromJson(json); -} - -@freezed -class IndividualOrganiserResponse with _$IndividualOrganiserResponse { - const factory IndividualOrganiserResponse({ - required List data, - }) = _IndividualOrganiserResponse; - - factory IndividualOrganiserResponse.fromJson(Map json) => - _$IndividualOrganiserResponseFromJson(json); -} diff --git a/lib/common/data/models/local/local_organiser.dart b/lib/common/data/models/local/local_organiser.dart index 9e49512..581e192 100644 --- a/lib/common/data/models/local/local_organiser.dart +++ b/lib/common/data/models/local/local_organiser.dart @@ -5,14 +5,22 @@ part 'local_organiser.g.dart'; @collection class LocalOrganiser { LocalOrganiser({ - required this.serverId, required this.logo, required this.name, + required this.type, + required this.tagline, + required this.bio, + required this.designation, }); Id id = Isar.autoIncrement; - @Index(unique: true, replace: true) - late int serverId; + late String logo; + @Index(unique: true, replace: true) late String name; + late String type; + @Enumerated(EnumType.name) + late String tagline; + late String bio; + late String designation; } diff --git a/lib/common/data/models/local/local_sponsor.dart b/lib/common/data/models/local/local_sponsor.dart index ac86ae9..c3b80ee 100644 --- a/lib/common/data/models/local/local_sponsor.dart +++ b/lib/common/data/models/local/local_sponsor.dart @@ -1,3 +1,4 @@ +import 'package:fluttercon/common/data/enums/sponsor_type.dart'; import 'package:isar/isar.dart'; part 'local_sponsor.g.dart'; @@ -18,7 +19,8 @@ class LocalSponsor { late String name; late String tagline; late String link; - late String sponsorType; + @Enumerated(EnumType.name) + late SponsorType sponsorType; late String logo; late String createdAt; } diff --git a/lib/common/data/models/organisers.dart b/lib/common/data/models/organisers.dart index b4f9da8..03c46b5 100644 --- a/lib/common/data/models/organisers.dart +++ b/lib/common/data/models/organisers.dart @@ -6,9 +6,12 @@ part 'organisers.freezed.dart'; @freezed class Organiser with _$Organiser { factory Organiser({ - required int id, - required String logo, + @JsonKey(name: 'photo') required String logo, required String name, + @JsonEnum() required String type, + required String tagline, + required String bio, + required String designation, }) = _Organiser; factory Organiser.fromJson(Map json) => diff --git a/lib/common/data/models/sponsor.dart b/lib/common/data/models/sponsor.dart index bf37fbc..54635ea 100644 --- a/lib/common/data/models/sponsor.dart +++ b/lib/common/data/models/sponsor.dart @@ -1,3 +1,4 @@ +import 'package:fluttercon/common/data/enums/sponsor_type.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'sponsor.freezed.dart'; @@ -9,7 +10,7 @@ class Sponsor with _$Sponsor { String name, String tagline, String link, - @JsonKey(name: 'sponsor_type') String sponsorType, + @JsonEnum() @JsonKey(name: 'sponsor_type') SponsorType sponsorType, String logo, @JsonKey(name: 'created_at') String createdAt, ) = _Sponsor; diff --git a/lib/common/repository/api_repository.dart b/lib/common/repository/api_repository.dart index 24dd3ab..a76acec 100644 --- a/lib/common/repository/api_repository.dart +++ b/lib/common/repository/api_repository.dart @@ -1,6 +1,5 @@ import 'package:fluttercon/common/data/models/feed.dart'; import 'package:fluttercon/common/data/models/feedback_dto.dart'; -import 'package:fluttercon/common/data/models/individual_organiser.dart'; import 'package:fluttercon/common/data/models/models.dart'; import 'package:fluttercon/common/data/models/sponsor.dart'; import 'package:fluttercon/common/utils/env/flavor_config.dart'; @@ -12,6 +11,7 @@ class ApiRepository { final _networkUtil = NetworkUtil(); final _eventSlug = FlutterConConfig.instance!.values.eventSlug; + final _organiserSlug = FlutterConConfig.instance!.values.organiserSlug; Future> fetchSpeakers({ int perPage = 100, @@ -79,7 +79,7 @@ class ApiRepository { }) async { try { final response = await _networkUtil.getReq( - '/organizers', + '/organizers/$_organiserSlug/team', queryParameters: {'per_page': perPage, 'page': page}, ); @@ -105,26 +105,6 @@ class ApiRepository { } } - Future> fetchIndividualOrganisers({ - int perPage = 20, - int page = 1, - }) async { - try { - final response = await _networkUtil.getReq( - '/organizers/droidcon-ke-645/team', - queryParameters: { - 'per_page': perPage, - 'page': page, - 'type': 'individual', - }, - ); - - return IndividualOrganiserResponse.fromJson(response).data; - } catch (e) { - rethrow; - } - } - Future bookmarkSession(int sessionId) async { try { final response = await _networkUtil.postReq( diff --git a/lib/common/repository/auth_repository.dart b/lib/common/repository/auth_repository.dart index af7535b..82f503d 100644 --- a/lib/common/repository/auth_repository.dart +++ b/lib/common/repository/auth_repository.dart @@ -86,7 +86,6 @@ class AuthRepository { Future logOut() async { try { await _googleSignIn.signOut(); - await _networkUtil.postReq('/logout'); } catch (e) { rethrow; } diff --git a/lib/common/repository/db_repository.dart b/lib/common/repository/db_repository.dart index b56c71d..4b5dc70 100644 --- a/lib/common/repository/db_repository.dart +++ b/lib/common/repository/db_repository.dart @@ -1,6 +1,6 @@ import 'package:fluttercon/common/data/enums/bookmark_status.dart'; +import 'package:fluttercon/common/data/enums/organiser_type.dart'; import 'package:fluttercon/common/data/models/feed.dart'; -import 'package:fluttercon/common/data/models/individual_organiser.dart'; import 'package:fluttercon/common/data/models/local/local_feed.dart'; import 'package:fluttercon/common/data/models/local/local_individual_organiser.dart'; import 'package:fluttercon/common/data/models/local/local_organiser.dart'; @@ -105,47 +105,29 @@ class DBRepository { localOrganisers.add( LocalOrganiser( name: organiser.name, - serverId: organiser.id, logo: organiser.logo, - ), - ); - } - - await localDB.localOrganisers.putAll(localOrganisers); - }); - } - - Future> fetchOrganisers() async { - return localDB.localOrganisers.where().findAll(); - } - - Future persistIndividualOrganisers({ - required List organisers, - }) async { - await localDB.writeTxn(() async { - final localIndividualOrganisers = []; - - for (final organiser in organisers) { - localIndividualOrganisers.add( - LocalIndividualOrganiser( - name: organiser.name, tagline: organiser.tagline, - link: organiser.link, type: organiser.type, bio: organiser.bio, designation: organiser.designation, - photo: organiser.photo, - twitterHandle: organiser.twitterHandle, ), ); } - await localDB.localIndividualOrganisers.putAll(localIndividualOrganisers); + await localDB.localOrganisers.putAll(localOrganisers); }); } - Future> fetchIndividualOrganisers() async { - return localDB.localIndividualOrganisers.where().findAll(); + Future> fetchOrganisers({ + required OrganiserType type, + }) async { + return localDB.localOrganisers + .where() + .filter() + .typeEqualTo(type.name) + .not() + .nameContains('Nairobi Gophers') + .findAll(); } Future persistSponsors({ diff --git a/lib/common/utils/env/flavor_config.dart b/lib/common/utils/env/flavor_config.dart index 06c5aae..245c646 100644 --- a/lib/common/utils/env/flavor_config.dart +++ b/lib/common/utils/env/flavor_config.dart @@ -4,12 +4,14 @@ class FlutterConValues { required this.baseDomain, required this.hiveBox, required this.eventSlug, + required this.organiserSlug, }); final String urlScheme; final String baseDomain; final String hiveBox; final String eventSlug; + final String organiserSlug; String get baseUrl => '$urlScheme://$baseDomain'; } diff --git a/lib/common/utils/network.dart b/lib/common/utils/network.dart index 8c5dbd5..f162c09 100644 --- a/lib/common/utils/network.dart +++ b/lib/common/utils/network.dart @@ -50,6 +50,7 @@ class NetworkUtil { PrettyDioLogger( requestHeader: true, requestBody: true, + responseBody: false, ), ); } diff --git a/lib/common/widgets/app_bar/feedback_button.dart b/lib/common/widgets/app_bar/feedback_button.dart index 47b517b..2157a85 100644 --- a/lib/common/widgets/app_bar/feedback_button.dart +++ b/lib/common/widgets/app_bar/feedback_button.dart @@ -1,8 +1,10 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.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/bottom_nav/app_nav_icon.dart'; +import 'package:fluttercon/core/di/injectable.dart'; import 'package:fluttercon/core/theme/theme_colors.dart'; import 'package:fluttercon/l10n/l10n.dart'; import 'package:go_router/go_router.dart'; @@ -18,8 +20,15 @@ class FeedbackButton extends StatelessWidget { return selectedIndex == 0 ? const SizedBox() : InkWell( - onTap: () => - GoRouter.of(context).push(FlutterConRouter.feedbackRoute), + onTap: () { + final profile = getIt().retrieveUser(); + if (profile == null) { + GoRouter.of(context).goNamed(FlutterConRouter.signInRoute); + return; + } + + GoRouter.of(context).push(FlutterConRouter.feedbackRoute); + }, child: Container( height: 30, width: 127, diff --git a/lib/common/widgets/app_bar/logout_dialog.dart b/lib/common/widgets/app_bar/logout_dialog.dart index 8ffa343..9574c78 100644 --- a/lib/common/widgets/app_bar/logout_dialog.dart +++ b/lib/common/widgets/app_bar/logout_dialog.dart @@ -29,7 +29,7 @@ class _LogOutDialogState extends State { loaded: () { GoRouter.of(context) ..pop() - ..go(FlutterConRouter.signInRoute); + ..go(FlutterConRouter.decisionRoute); }, orElse: () {}, ); diff --git a/lib/common/widgets/app_bar/user_profile_icon.dart b/lib/common/widgets/app_bar/user_profile_icon.dart index 7a23191..cf67c78 100644 --- a/lib/common/widgets/app_bar/user_profile_icon.dart +++ b/lib/common/widgets/app_bar/user_profile_icon.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:fluttercon/common/repository/hive_repository.dart'; import 'package:fluttercon/common/utils/env/flavor_config.dart'; import 'package:fluttercon/common/utils/misc.dart'; +import 'package:fluttercon/common/utils/router.dart'; import 'package:fluttercon/common/widgets/app_bar/logout_dialog.dart'; import 'package:fluttercon/core/di/injectable.dart'; import 'package:fluttercon/core/theme/theme_colors.dart'; @@ -26,6 +27,12 @@ class _UserProfileIconState extends State { final l10n = context.l10n; return InkWell( onTap: () { + final profile = getIt().retrieveUser(); + if (profile == null) { + GoRouter.of(context).goNamed(FlutterConRouter.signInRoute); + return; + } + WoltModalSheet.show( context: context, barrierDismissible: true, diff --git a/lib/common/widgets/resolved_image.dart b/lib/common/widgets/resolved_image.dart index 635eaf4..3f13113 100644 --- a/lib/common/widgets/resolved_image.dart +++ b/lib/common/widgets/resolved_image.dart @@ -1,6 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:logger/logger.dart'; class ResolvedImage extends StatelessWidget { const ResolvedImage({ @@ -13,11 +14,13 @@ class ResolvedImage extends StatelessWidget { @override Widget build(BuildContext context) { final size = MediaQuery.sizeOf(context); + Logger().d('ResolvedImage: $imageUrl'); return imageUrl.contains('.svg') ? SvgPicture.network(imageUrl) : CachedNetworkImage( imageUrl: imageUrl, height: size.height * .15, + width: size.width * .3, placeholder: (_, __) => const SizedBox( height: 150, width: double.infinity, diff --git a/lib/features/about/cubit/fetch_individual_organisers_cubit.dart b/lib/features/about/cubit/fetch_individual_organisers_cubit.dart index 79a976b..2ec3348 100644 --- a/lib/features/about/cubit/fetch_individual_organisers_cubit.dart +++ b/lib/features/about/cubit/fetch_individual_organisers_cubit.dart @@ -1,5 +1,6 @@ import 'package:bloc/bloc.dart'; -import 'package:fluttercon/common/data/models/local/local_individual_organiser.dart'; +import 'package:fluttercon/common/data/enums/organiser_type.dart'; +import 'package:fluttercon/common/data/models/local/local_organiser.dart'; import 'package:fluttercon/common/data/models/models.dart'; import 'package:fluttercon/common/repository/api_repository.dart'; import 'package:fluttercon/common/repository/db_repository.dart'; @@ -27,8 +28,9 @@ class FetchIndividualOrganisersCubit emit(const FetchIndividualOrganisersState.loading()); try { - final localIndividualOrganisers = - await _dBRepository.fetchIndividualOrganisers(); + final localIndividualOrganisers = await _dBRepository.fetchOrganisers( + type: OrganiserType.individual, + ); if (localIndividualOrganisers.isNotEmpty && !forceRefresh) { emit( @@ -42,8 +44,9 @@ class FetchIndividualOrganisersCubit if (localIndividualOrganisers.isEmpty || forceRefresh) { await _networkFetch(); - final localIndividualOrganisers = - await _dBRepository.fetchIndividualOrganisers(); + final localIndividualOrganisers = await _dBRepository.fetchOrganisers( + type: OrganiserType.individual, + ); emit( FetchIndividualOrganisersState.loaded( individualOrganisers: localIndividualOrganisers, @@ -59,9 +62,8 @@ class FetchIndividualOrganisersCubit } Future _networkFetch() async { - final individualOrganisers = - await _apiRepository.fetchIndividualOrganisers(); - await _dBRepository.persistIndividualOrganisers( + final individualOrganisers = await _apiRepository.fetchOrganisers(); + await _dBRepository.persistOrganisers( organisers: individualOrganisers, ); } diff --git a/lib/features/about/cubit/fetch_individual_organisers_state.dart b/lib/features/about/cubit/fetch_individual_organisers_state.dart index 7170de7..a1fe5ac 100644 --- a/lib/features/about/cubit/fetch_individual_organisers_state.dart +++ b/lib/features/about/cubit/fetch_individual_organisers_state.dart @@ -5,7 +5,7 @@ class FetchIndividualOrganisersState with _$FetchIndividualOrganisersState { const factory FetchIndividualOrganisersState.initial() = _Initial; const factory FetchIndividualOrganisersState.loading() = _Loading; const factory FetchIndividualOrganisersState.loaded({ - required List individualOrganisers, + required List individualOrganisers, }) = _Loaded; const factory FetchIndividualOrganisersState.error(String message) = _Error; } diff --git a/lib/features/about/ui/organising_team.dart b/lib/features/about/ui/organising_team.dart index 2dab493..caa9482 100644 --- a/lib/features/about/ui/organising_team.dart +++ b/lib/features/about/ui/organising_team.dart @@ -35,7 +35,7 @@ class _OrganisingTeamViewState extends State { mainAxisExtent: size.width > 600 ? 200 : 140, ), itemBuilder: (context, index) => PersonnelWidget( - imageUrl: individualOrganisers[index].photo, + imageUrl: individualOrganisers[index].logo, name: individualOrganisers[index].name, designation: individualOrganisers[index].designation, onTap: () => GoRouter.of(context).push( diff --git a/lib/features/auth/cubit/log_out_cubit.dart b/lib/features/auth/cubit/log_out_cubit.dart index 7302d59..3ebf7ff 100644 --- a/lib/features/auth/cubit/log_out_cubit.dart +++ b/lib/features/auth/cubit/log_out_cubit.dart @@ -1,5 +1,6 @@ import 'package:bloc/bloc.dart'; import 'package:fluttercon/common/repository/auth_repository.dart'; +import 'package:fluttercon/common/repository/db_repository.dart'; import 'package:fluttercon/common/repository/hive_repository.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; @@ -10,19 +11,23 @@ class LogOutCubit extends Cubit { LogOutCubit({ required AuthRepository authRepository, required HiveRepository hiveRepository, + required DBRepository dbRepository, }) : super(const LogOutState.initial()) { _hiveRepository = hiveRepository; _authRepository = authRepository; + _dbRepository = dbRepository; } late AuthRepository _authRepository; late HiveRepository _hiveRepository; + late DBRepository _dbRepository; Future logOut() async { emit(const LogOutState.loading()); try { - _hiveRepository.clearPrefs(); + await _dbRepository.clearAllTables(); await _authRepository.logOut(); + _hiveRepository.clearPrefs(); emit(const LogOutState.loaded()); } catch (e) { emit(const LogOutState.loaded()); diff --git a/lib/features/feed/ui/feed_screen.dart b/lib/features/feed/ui/feed_screen.dart index c515442..a2e0bcd 100644 --- a/lib/features/feed/ui/feed_screen.dart +++ b/lib/features/feed/ui/feed_screen.dart @@ -40,114 +40,127 @@ class _FeedScreenState extends State { context.read().fetchFeeds(forceRefresh: true), child: BlocBuilder( builder: (context, state) => state.maybeWhen( - loaded: (fetchedFeeds) => ListView.separated( - itemCount: fetchedFeeds.length, - itemBuilder: (context, index) { - final feed = fetchedFeeds[index]; - return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 16, - ), - child: Column( - children: [ - AutoSizeText( - feed.body, - style: TextStyle( - fontSize: 16, - color: colorScheme.onSurface, - ), + loaded: (fetchedFeeds) => fetchedFeeds.isEmpty + ? Center( + child: Text( + l10n.noPosts, + style: TextStyle( + color: colorScheme.onSurface, + fontSize: 20, ), - const SizedBox(height: 16), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), + ), + ) + : ListView.separated( + itemCount: fetchedFeeds.length, + itemBuilder: (context, index) { + final feed = fetchedFeeds[index]; + return Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 16, ), - child: CachedNetworkImage( - fit: BoxFit.cover, - imageUrl: feed.image, - width: double.infinity, - placeholder: (_, __) => const SizedBox( - height: 100, - width: double.infinity, - child: Center(child: CircularProgressIndicator()), - ), - errorWidget: (_, __, ___) => const SizedBox( - height: 100, - width: double.infinity, - child: Icon( - Icons.error, - color: Colors.red, + child: Column( + children: [ + AutoSizeText( + feed.body, + style: TextStyle( + fontSize: 16, + color: colorScheme.onSurface, + ), ), - ), - ), - ), - const SizedBox(height: 16), - Row( - children: [ - GestureDetector( - onTap: () { - WoltModalSheet.show( - context: context, - showDragHandle: false, - modalTypeBuilder: (_) => - WoltModalType.bottomSheet(), - pageListBuilder: (bottomSheetContext) => [ - SliverWoltModalSheetPage( - useSafeArea: true, - hasTopBarLayer: false, - backgroundColor: isLightMode - ? ThemeColors.lightGrayBackgroundColor - : Colors.black, - mainContentSliversBuilder: (context) => - [ - ShareSheet(feed: feed), - ], + const SizedBox(height: 16), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + ), + child: CachedNetworkImage( + fit: BoxFit.cover, + imageUrl: feed.image, + width: double.infinity, + placeholder: (_, __) => const SizedBox( + height: 100, + width: double.infinity, + child: Center( + child: CircularProgressIndicator(), ), - ], - ); - }, - child: Row( - mainAxisSize: MainAxisSize.min, + ), + errorWidget: (_, __, ___) => const SizedBox( + height: 100, + width: double.infinity, + child: Icon( + Icons.error, + color: Colors.red, + ), + ), + ), + ), + const SizedBox(height: 16), + Row( children: [ - AutoSizeText( - l10n.share, - style: TextStyle( - color: colorScheme.primary, - fontWeight: FontWeight.bold, - fontSize: 16, + GestureDetector( + onTap: () { + WoltModalSheet.show( + context: context, + showDragHandle: false, + modalTypeBuilder: (_) => + WoltModalType.bottomSheet(), + pageListBuilder: (bottomSheetContext) => [ + SliverWoltModalSheetPage( + useSafeArea: true, + hasTopBarLayer: false, + backgroundColor: isLightMode + ? ThemeColors + .lightGrayBackgroundColor + : Colors.black, + mainContentSliversBuilder: + (context) => [ + ShareSheet(feed: feed), + ], + ), + ], + ); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + AutoSizeText( + l10n.share, + style: TextStyle( + color: colorScheme.primary, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + const SizedBox(width: 8), + SvgPicture.asset( + AppAssets.iconShare, + colorFilter: ColorFilter.mode( + colorScheme.primary, + BlendMode.srcIn, + ), + height: 32, + ), + ], ), ), - const SizedBox(width: 8), - SvgPicture.asset( - AppAssets.iconShare, - colorFilter: ColorFilter.mode( - colorScheme.primary, - BlendMode.srcIn, + const Spacer(), + AutoSizeText( + timeago.format(feed.createdAt), + style: TextStyle( + color: colorScheme.onSurface, ), - height: 32, ), ], ), - ), - const Spacer(), - AutoSizeText( - timeago.format(feed.createdAt), - style: TextStyle( - color: colorScheme.onSurface, - ), - ), - ], - ), - ], + ], + ), + ); + }, + separatorBuilder: (context, index) => const Padding( + padding: EdgeInsets.symmetric(vertical: 16), + child: Divider(color: Color.fromARGB(50, 112, 112, 112)), + ), ), - ); - }, - separatorBuilder: (context, index) => const Padding( - padding: EdgeInsets.symmetric(vertical: 16), - child: Divider(color: Color.fromARGB(50, 112, 112, 112)), - ), - ), error: (message) => AutoSizeText( message, style: Theme.of(context).textTheme.titleMedium?.copyWith( diff --git a/lib/features/home/cubit/fetch_organisers_cubit.dart b/lib/features/home/cubit/fetch_organisers_cubit.dart index 3af94a1..6ebcde9 100644 --- a/lib/features/home/cubit/fetch_organisers_cubit.dart +++ b/lib/features/home/cubit/fetch_organisers_cubit.dart @@ -1,4 +1,5 @@ import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:fluttercon/common/data/enums/organiser_type.dart'; import 'package:fluttercon/common/data/models/local/local_organiser.dart'; import 'package:fluttercon/common/data/models/models.dart'; import 'package:fluttercon/common/repository/api_repository.dart'; @@ -21,11 +22,13 @@ class FetchOrganisersCubit extends Cubit { late DBRepository _dBRepository; Future fetchOrganisers({ - bool forceRefresh = false, + bool forceRefresh = true, }) async { emit(const FetchOrganisersState.loading()); try { - final localOrganisers = await _dBRepository.fetchOrganisers(); + final localOrganisers = await _dBRepository.fetchOrganisers( + type: OrganiserType.company, + ); if (localOrganisers.isNotEmpty && !forceRefresh) { emit(FetchOrganisersState.loaded(organisers: localOrganisers)); await _networkFetch(); @@ -34,7 +37,9 @@ class FetchOrganisersCubit extends Cubit { if (localOrganisers.isEmpty || forceRefresh) { await _networkFetch(); - final localOrganisers = await _dBRepository.fetchOrganisers(); + final localOrganisers = await _dBRepository.fetchOrganisers( + type: OrganiserType.company, + ); emit(FetchOrganisersState.loaded(organisers: localOrganisers)); return; } diff --git a/lib/features/home/widgets/organizers_card.dart b/lib/features/home/widgets/organizers_card.dart index 50f9b41..0335db3 100644 --- a/lib/features/home/widgets/organizers_card.dart +++ b/lib/features/home/widgets/organizers_card.dart @@ -5,6 +5,7 @@ import 'package:fluttercon/common/utils/misc.dart'; import 'package:fluttercon/common/widgets/resolved_image.dart'; import 'package:fluttercon/features/home/cubit/fetch_organisers_cubit.dart'; import 'package:fluttercon/l10n/l10n.dart'; +import 'package:sizer/sizer.dart'; class OrganizersCard extends StatefulWidget { const OrganizersCard({super.key}); @@ -23,7 +24,7 @@ class _OrganizersCardState extends State { @override Widget build(BuildContext context) { - final (_, colorScheme) = Misc.getTheme(context); + final (isLightMode, colorScheme) = Misc.getTheme(context); final size = MediaQuery.sizeOf(context); final l10n = context.l10n; @@ -49,15 +50,30 @@ class _OrganizersCardState extends State { const Spacer(), BlocBuilder( builder: (context, state) => state.maybeWhen( - loaded: (organisers) => Wrap( - spacing: 10, - children: [ - for (final organiser in organisers) - SizedBox( - width: size.width / 4, - child: ResolvedImage(imageUrl: organiser.logo), + loaded: (organisers) => SizedBox( + height: size.height * .2, + child: ListView.separated( + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) => Container( + height: size.height * .2, + 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, + ), ), - ], + child: ResolvedImage(imageUrl: organisers[index].logo), + ), + separatorBuilder: (_, __) => SizedBox(width: 4.w), + itemCount: organisers.length, + ), ), error: (message) => AutoSizeText( message, diff --git a/lib/features/home/widgets/search_bar.dart b/lib/features/home/widgets/search_bar.dart index 3172067..c15a827 100644 --- a/lib/features/home/widgets/search_bar.dart +++ b/lib/features/home/widgets/search_bar.dart @@ -77,6 +77,7 @@ class _SearchBarWidgetState extends State { Expanded( child: TextField( controller: _searchController, + style: TextStyle(color: colorScheme.onSurface), decoration: InputDecoration( hintText: l10n.searchHint, hintStyle: TextStyle(color: colorScheme.onSurfaceVariant), diff --git a/lib/features/home/widgets/sponsors_card.dart b/lib/features/home/widgets/sponsors_card.dart index f51619d..97aa2f9 100644 --- a/lib/features/home/widgets/sponsors_card.dart +++ b/lib/features/home/widgets/sponsors_card.dart @@ -6,6 +6,7 @@ import 'package:fluttercon/common/utils/misc.dart'; import 'package:fluttercon/common/widgets/resolved_image.dart'; import 'package:fluttercon/features/home/cubit/fetch_sponsors_cubit.dart'; import 'package:fluttercon/l10n/l10n.dart'; +import 'package:sizer/sizer.dart'; class SponsorsCard extends StatefulWidget { const SponsorsCard({super.key}); @@ -25,7 +26,7 @@ class _SponsorsCardState extends State { Widget build(BuildContext context) { final size = MediaQuery.sizeOf(context); final l10n = context.l10n; - final (_, colorScheme) = Misc.getTheme(context); + final (isLightMode, colorScheme) = Misc.getTheme(context); return Container( width: double.infinity, @@ -51,22 +52,33 @@ class _SponsorsCardState extends State { loaded: (sponsors) { final nonPlatinumSponsors = sponsors .where( - (sponsor) => - SponsorType.fromValue(sponsor.sponsorType) != - SponsorType.platinum, + (sponsor) => sponsor.sponsorType != SponsorType.gold, ) .toList(); return Column( - crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - ResolvedImage( - imageUrl: sponsors - .firstWhere( - (sponsor) => - SponsorType.fromValue(sponsor.sponsorType) == - SponsorType.platinum, - ) - .logo, + 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, + ), + ), + child: ResolvedImage( + imageUrl: sponsors + .firstWhere( + (sponsor) => + sponsor.sponsorType == SponsorType.gold, + ) + .logo, + ), ), const SizedBox(height: 16), SizedBox( @@ -75,10 +87,25 @@ class _SponsorsCardState extends State { shrinkWrap: true, scrollDirection: Axis.horizontal, itemCount: nonPlatinumSponsors.length, - itemBuilder: (context, index) => SizedBox( - width: size.width / 4, - child: ResolvedImage( - imageUrl: nonPlatinumSponsors[index].logo, + 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, + ), + ), + child: SizedBox( + width: size.width / 4, + child: ResolvedImage( + imageUrl: nonPlatinumSponsors[index].logo, + ), ), ), ), diff --git a/lib/features/sessions/cubit/bookmark_session_cubit.dart b/lib/features/sessions/cubit/bookmark_session_cubit.dart index 5d16bfe..61363a1 100644 --- a/lib/features/sessions/cubit/bookmark_session_cubit.dart +++ b/lib/features/sessions/cubit/bookmark_session_cubit.dart @@ -1,7 +1,9 @@ import 'package:bloc/bloc.dart'; import 'package:fluttercon/common/data/enums/bookmark_status.dart'; +import 'package:fluttercon/common/data/models/models.dart'; import 'package:fluttercon/common/repository/api_repository.dart'; import 'package:fluttercon/common/repository/db_repository.dart'; +import 'package:fluttercon/common/repository/hive_repository.dart'; import 'package:fluttercon/common/utils/notification_service.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; @@ -13,15 +15,18 @@ class BookmarkSessionCubit extends Cubit { required ApiRepository apiRepository, required DBRepository dBRepository, required NotificationService notificationService, + required HiveRepository hiveRepository, }) : super(const BookmarkSessionState.initial()) { _apiRepository = apiRepository; _dBRepository = dBRepository; _notificationService = notificationService; + _hiveRepository = hiveRepository; } late ApiRepository _apiRepository; late DBRepository _dBRepository; late NotificationService _notificationService; + late HiveRepository _hiveRepository; Future bookmarkSession({ required int sessionId, @@ -29,6 +34,16 @@ class BookmarkSessionCubit extends Cubit { }) async { try { emit(BookmarkSessionState.loading(index: index)); + + final accessToken = _hiveRepository.retrieveToken(); + + if (accessToken == null) { + emit( + const BookmarkSessionState.error('Please login to bookmark sessions'), + ); + return; + } + final message = await _apiRepository.bookmarkSession(sessionId); final bookmarkStatus = BookmarkStatus.fromString(message); @@ -51,6 +66,8 @@ class BookmarkSessionCubit extends Cubit { status: bookmarkStatus, ), ); + } on Failure catch (e) { + emit(BookmarkSessionState.error(e.message)); } catch (e) { emit(BookmarkSessionState.error(e.toString())); } diff --git a/lib/features/sessions/ui/session_details/session_details.dart b/lib/features/sessions/ui/session_details/session_details.dart index c048c9c..b150c83 100644 --- a/lib/features/sessions/ui/session_details/session_details.dart +++ b/lib/features/sessions/ui/session_details/session_details.dart @@ -93,6 +93,12 @@ class SessionDetailsPage extends StatelessWidget { ), ); }, + error: (error) => + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: AutoSizeText(error.message), + ), + ), ); }, builder: (context, state) { diff --git a/lib/features/sessions/ui/sessions_screen.dart b/lib/features/sessions/ui/sessions_screen.dart index 953ef46..63444ee 100644 --- a/lib/features/sessions/ui/sessions_screen.dart +++ b/lib/features/sessions/ui/sessions_screen.dart @@ -22,7 +22,6 @@ class _SessionsScreenState extends State with SingleTickerProviderStateMixin { int _viewIndex = 0; int _currentTab = 0; - int _availableTabs = 3; bool _isBookmarked = false; @@ -49,34 +48,24 @@ class _SessionsScreenState extends State _viewIndex = 1; }), ), - body: DefaultTabController( - length: _availableTabs, - child: SafeArea( - child: NestedScrollView( - headerSliverBuilder: (context, innerBoxIsScrolled) => [ - SliverToBoxAdapter( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Flexible( - flex: 8, - child: BlocConsumer( - listener: (context, state) { - state.mapOrNull( - loaded: (loaded) { - setState(() { - _availableTabs = loaded.groupedSessions.length; - }); - }, - ); - }, - builder: (context, state) => state.maybeWhen( - orElse: () => const Padding( - padding: EdgeInsets.symmetric(horizontal: 16), - child: CircularProgressIndicator(), - ), - loaded: (groupedSessions) => TabBar( + body: BlocBuilder( + builder: (context, state) => state.maybeWhen( + orElse: () => const Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: CircularProgressIndicator(), + ), + loaded: (groupedSessions) => DefaultTabController( + length: groupedSessions.length, + child: SafeArea( + child: NestedScrollView( + headerSliverBuilder: (context, innerBoxIsScrolled) => [ + SliverToBoxAdapter( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 8, + child: TabBar( onTap: (value) => setState(() { _currentTab = value; }), @@ -105,93 +94,100 @@ class _SessionsScreenState extends State ], ), ), - ), - ), - Flexible( - flex: 2, - child: Padding( - padding: const EdgeInsets.only(right: 16), - child: Column( - children: [ - Switch( - value: _isBookmarked, - onChanged: (newValue) { - setState(() { - _isBookmarked = newValue; - }); + Flexible( + flex: 2, + child: Padding( + padding: const EdgeInsets.only(right: 16), + child: Column( + children: [ + Switch( + value: _isBookmarked, + onChanged: (newValue) { + setState(() { + _isBookmarked = newValue; + }); - if (_isBookmarked) { - context - .read() - .fetchGroupedSessions( - bookmarkStatus: - BookmarkStatus.bookmarked, - ); - } + if (_isBookmarked) { + context + .read() + .fetchGroupedSessions( + bookmarkStatus: + BookmarkStatus.bookmarked, + ); + } - if (!_isBookmarked) { - context - .read() - .fetchGroupedSessions(); - } - }, - trackOutlineWidth: WidgetStateProperty.all(1), - trackColor: WidgetStateProperty.all(Colors.black), - activeTrackColor: ThemeColors.orangeColor, - activeColor: ThemeColors.orangeColor, - thumbColor: WidgetStateProperty.all(Colors.white), - thumbIcon: WidgetStateProperty.all( - const Icon(Icons.star_border_rounded), - ), - ), - AutoSizeText( - l10n.mySessions, - style: const TextStyle( - fontSize: 10, - color: Colors.grey, - ), + if (!_isBookmarked) { + context + .read() + .fetchGroupedSessions(); + } + }, + trackOutlineWidth: WidgetStateProperty.all(1), + trackColor: + WidgetStateProperty.all(Colors.black), + activeTrackColor: ThemeColors.orangeColor, + activeColor: ThemeColors.orangeColor, + thumbColor: + WidgetStateProperty.all(Colors.white), + thumbIcon: WidgetStateProperty.all( + const Icon(Icons.star_border_rounded), + ), + ), + AutoSizeText( + l10n.mySessions, + style: const TextStyle( + fontSize: 10, + color: Colors.grey, + ), + ), + ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - const SliverToBoxAdapter( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 16), - child: Divider(color: Colors.grey), - ), - ), - SliverToBoxAdapter( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: AutoSizeText( - _isBookmarked ? l10n.mySessions : l10n.allSessions, - style: TextStyle( - fontWeight: FontWeight.bold, - color: colorScheme.primary, - fontSize: 24, + ), + const SliverToBoxAdapter( + child: Padding( + padding: EdgeInsets.symmetric(vertical: 16), + child: Divider(color: Colors.grey), ), ), - ), - ), - ], - body: BlocBuilder( - builder: (context, state) => state.maybeWhen( - orElse: () => const Center(child: CircularProgressIndicator()), - loaded: (groupedSessions) => TabBarView( - children: groupedSessions.values - .map( - (dailySessions) => DaySessionsView( - sessions: dailySessions, - isCompactView: _viewIndex == 0, + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: AutoSizeText( + _isBookmarked ? l10n.mySessions : l10n.allSessions, + style: TextStyle( + fontWeight: FontWeight.bold, + color: colorScheme.primary, + fontSize: 24, ), + ), + ), + ), + ], + body: groupedSessions.isNotEmpty + ? TabBarView( + physics: const NeverScrollableScrollPhysics(), + children: groupedSessions.values + .map( + (dailySessions) => DaySessionsView( + sessions: dailySessions, + isCompactView: _viewIndex == 0, + ), + ) + .toList(), ) - .toList(), - ), + : Center( + child: Text( + l10n.noSessions, + style: TextStyle( + color: colorScheme.onSurface, + fontSize: 20, + ), + ), + ), ), ), ), diff --git a/lib/features/sessions/ui/widgets/compact_view_card.dart b/lib/features/sessions/ui/widgets/compact_view_card.dart index 5eee961..d66916d 100644 --- a/lib/features/sessions/ui/widgets/compact_view_card.dart +++ b/lib/features/sessions/ui/widgets/compact_view_card.dart @@ -128,6 +128,11 @@ class CompactViewCard extends StatelessWidget { ), ); }, + error: (error) => ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: AutoSizeText(error.message), + ), + ), ); }, builder: (context, state) { diff --git a/lib/features/splash/splash_screen.dart b/lib/features/splash/splash_screen.dart index ea97692..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}); @@ -26,20 +23,11 @@ class _SplashScreenState extends State { @override void initState() { - final accessToken = getIt().retrieveToken(); - Logger().d(accessToken); - - if (accessToken == null) { - _redirectToPage( - context, - FlutterConRouter.signInRoute, - ); - } else { - _redirectToPage( - context, - FlutterConRouter.dashboardRoute, - ); - } + // Go directly to the landing page + _redirectToPage( + context, + FlutterConRouter.dashboardRoute, + ); super.initState(); } diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index aca3acb..96869b9 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -134,5 +134,9 @@ "logoutLoading": "logging out...", "@logoutLoading": {}, "confirmLogout": "yes, log out", - "@confirmLogout": {} + "@confirmLogout": {}, + "noSessions": "No sessions found", + "@noSessions": {}, + "noPosts": "No posts found", + "@noPosts": {} } \ No newline at end of file diff --git a/lib/main_development.dart b/lib/main_development.dart index 79c8cd7..235f969 100644 --- a/lib/main_development.dart +++ b/lib/main_development.dart @@ -18,6 +18,7 @@ Future main() async { urlScheme: 'https', hiveBox: 'fluttercon-dev', eventSlug: 'flutterconke24-252', + organiserSlug: 'flutterconke-571', ), ); diff --git a/lib/main_production.dart b/lib/main_production.dart index c922b79..89206c3 100644 --- a/lib/main_production.dart +++ b/lib/main_production.dart @@ -18,6 +18,7 @@ Future main() async { urlScheme: 'https', hiveBox: 'fluttercon-prod', eventSlug: 'flutterconke24-252', + organiserSlug: 'flutterconke-571', ), ); diff --git a/lib/main_staging.dart b/lib/main_staging.dart index 91a18c5..a6e6aa5 100644 --- a/lib/main_staging.dart +++ b/lib/main_staging.dart @@ -18,6 +18,7 @@ Future main() async { urlScheme: 'https', hiveBox: 'fluttercon-stg', eventSlug: 'flutterconke24-252', + organiserSlug: 'flutterconke-571', ), ); diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..bf26a26 --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,34 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import awesome_notifications +import firebase_analytics +import firebase_auth +import firebase_core +import firebase_crashlytics +import firebase_remote_config +import google_sign_in_ios +import isar_flutter_libs +import path_provider_foundation +import share_plus +import sqflite_darwin +import url_launcher_macos + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + AwesomeNotificationsPlugin.register(with: registry.registrar(forPlugin: "AwesomeNotificationsPlugin")) + FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin")) + FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) + FLTFirebaseRemoteConfigPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseRemoteConfigPlugin")) + FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) + IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) +} diff --git a/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig new file mode 100644 index 0000000..667dc90 --- /dev/null +++ b/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -0,0 +1,11 @@ +// This is a generated file; do not edit or check into version control. +FLUTTER_ROOT=/Users/adulu/development/flutter +FLUTTER_APPLICATION_PATH=/Users/adulu/Work/FlutterOrg/FlutterCon/flutterconKEApp +COCOAPODS_PARALLEL_CODE_SIGN=true +FLUTTER_BUILD_DIR=build +FLUTTER_BUILD_NAME=1.18.00 +FLUTTER_BUILD_NUMBER=11800 +DART_OBFUSCATION=false +TRACK_WIDGET_CREATION=true +TREE_SHAKE_ICONS=false +PACKAGE_CONFIG=.dart_tool/package_config.json diff --git a/macos/Flutter/ephemeral/flutter_export_environment.sh b/macos/Flutter/ephemeral/flutter_export_environment.sh new file mode 100755 index 0000000..56814a4 --- /dev/null +++ b/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/adulu/development/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/adulu/Work/FlutterOrg/FlutterCon/flutterconKEApp" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.18.00" +export "FLUTTER_BUILD_NUMBER=11800" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..c795730 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/pubspec.lock b/pubspec.lock index 18a87e2..7405ee2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -511,10 +511,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + sha256: "2ca230f2ef6e31151769f4a03ec806b94f0554ff02ea1a40bb0d531ac150f035" url: "https://pub.dev" source: hosted - version: "2.0.10+1" + version: "2.0.12" flutter_test: dependency: "direct dev" description: flutter @@ -553,10 +553,10 @@ packages: dependency: "direct main" description: name: get_it - sha256: "35c253f83f9e03cbac65ffa159510e41ae15f49b37291ab8c522d7a0b6f330cd" + sha256: c49895c1ecb0ee2a0ec568d39de882e2c299ba26355aa6744ab1001f98cebd15 url: "https://pub.dev" source: hosted - version: "8.0.1" + version: "8.0.2" glob: dependency: transitive description: @@ -921,10 +921,10 @@ packages: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index cbeb1ce..ac496d2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: fluttercon description: "A new Flutter project." publish_to: 'none' -version: 1.18.00+11800 +version: 1.18.01+11801 environment: sdk: ">=3.5.0 <4.0.0" @@ -27,9 +27,9 @@ dependencies: flutter_bloc: ^8.1.5 flutter_localizations: sdk: flutter - flutter_svg: ^2.0.10+1 + flutter_svg: ^2.0.11 freezed_annotation: ^2.4.4 - get_it: ^8.0.1 + get_it: ^8.0.2 go_router: ^14.3.0 google_fonts: ^6.2.1 google_sign_in: ^6.2.1 @@ -41,7 +41,7 @@ dependencies: isar_flutter_libs: ^3.1.0+1 json_annotation: ^4.9.0 logger: ^2.4.0 - path_provider: ^2.1.4 + path_provider: ^2.1.5 pretty_dio_logger: ^1.4.0 share_plus: ^10.1.1 sizer: ^3.0.4