From 5430112aadc861157706d78f53abf92885f979d6 Mon Sep 17 00:00:00 2001 From: Sneha Canopas Date: Tue, 3 Dec 2024 11:26:30 +0530 Subject: [PATCH] Fix pipeline --- lib/main.dart | 12 +-- .../apply_leave/widget/picker_card.dart | 78 +++++++++---------- lib/ui/widget/date_time_picker.dart | 11 ++- .../network/network_connection_bloc_test.dart | 6 +- 4 files changed, 53 insertions(+), 54 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index b07794b6..ea115aea 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -31,13 +31,13 @@ Future main() async { return ErrorScreen(error: error); }; -if(!kIsWeb){ - if(kDebugMode){ - await getIt().setCrashlyticsCollectionEnabled(false); - }else{ - await getIt().setCrashlyticsCollectionEnabled(true); + if (!kIsWeb) { + if (kDebugMode) { + await getIt().setCrashlyticsCollectionEnabled(false); + } else { + await getIt().setCrashlyticsCollectionEnabled(true); + } } -} PlatformDispatcher.instance.onError = (error, stack) { getIt().recordError(error, stack, fatal: true); diff --git a/lib/ui/user/leaves/apply_leave/widget/picker_card.dart b/lib/ui/user/leaves/apply_leave/widget/picker_card.dart index 7a273417..6199d433 100644 --- a/lib/ui/user/leaves/apply_leave/widget/picker_card.dart +++ b/lib/ui/user/leaves/apply_leave/widget/picker_card.dart @@ -28,47 +28,45 @@ class DatePickerCard extends StatelessWidget { decoration: BoxDecoration( border: Border( bottom: BorderSide(color: context.colorScheme.containerHigh))), - child: Builder( - builder: (context) { - return InkWell( - borderRadius: BorderRadius.circular(12), - onTap: onPress, - child: Padding( - padding: const EdgeInsets.all(12), - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - SvgPicture.asset( - Assets.images.icCalendar, - colorFilter: ColorFilter.mode( - context.colorScheme.textSecondary, BlendMode.srcIn), - ), - const SizedBox( - width: 10, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: AppTextStyle.style14 - .copyWith(color: context.colorScheme.textSecondary), - ), - const SizedBox( - height: 5, - ), - Text(localization.date_format_yMMMd(date), - style: AppTextStyle.style18.copyWith( - color: context.colorScheme.textPrimary, - textBaseline: TextBaseline.alphabetic)), - ], - ), - ], - ), + child: Builder(builder: (context) { + return InkWell( + borderRadius: BorderRadius.circular(12), + onTap: onPress, + child: Padding( + padding: const EdgeInsets.all(12), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + SvgPicture.asset( + Assets.images.icCalendar, + colorFilter: ColorFilter.mode( + context.colorScheme.textSecondary, BlendMode.srcIn), + ), + const SizedBox( + width: 10, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: AppTextStyle.style14 + .copyWith(color: context.colorScheme.textSecondary), + ), + const SizedBox( + height: 5, + ), + Text(localization.date_format_yMMMd(date), + style: AppTextStyle.style18.copyWith( + color: context.colorScheme.textPrimary, + textBaseline: TextBaseline.alphabetic)), + ], + ), + ], ), - ); - } - ), + ), + ); + }), )); } } diff --git a/lib/ui/widget/date_time_picker.dart b/lib/ui/widget/date_time_picker.dart index e7b9703e..5aed4965 100644 --- a/lib/ui/widget/date_time_picker.dart +++ b/lib/ui/widget/date_time_picker.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:projectunity/data/core/extensions/context_extension.dart'; import 'package:projectunity/data/core/extensions/date_time.dart'; -import 'package:projectunity/ui/admin/forms/create_form/create_form.dart'; Future pickDate( {required BuildContext context, required DateTime initialDate}) async { @@ -17,10 +16,10 @@ Future pickDate( Future pickTime( {required BuildContext context, required TimeOfDay initialTime}) async { - TimeOfDay? time = - await showTimePicker( - context: context, initialTime: initialTime, - barrierColor: context.colorScheme.surface, - ); + TimeOfDay? time = await showTimePicker( + context: context, + initialTime: initialTime, + barrierColor: context.colorScheme.surface, + ); return time; } diff --git a/test/unit_test/bloc/network/network_connection_bloc_test.dart b/test/unit_test/bloc/network/network_connection_bloc_test.dart index 8a896488..4dc1819c 100644 --- a/test/unit_test/bloc/network/network_connection_bloc_test.dart +++ b/test/unit_test/bloc/network/network_connection_bloc_test.dart @@ -39,8 +39,10 @@ void main() { test( 'Emits NetworkConnectionFailureState if device is not connected to mobile or wifi', () { - when(connectivity.onConnectivityChanged).thenAnswer( - (_) => Stream.fromIterable([[ConnectivityResult.ethernet]])); + when(connectivity.onConnectivityChanged) + .thenAnswer((_) => Stream.fromIterable([ + [ConnectivityResult.ethernet] + ])); networkConnectionBloc.add(NetworkConnectionObserveEvent()); expectLater( networkConnectionBloc.stream, emits(NetworkConnectionFailureState()));