Skip to content

Commit

Permalink
Show type on the Leave application
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s committed Mar 20, 2024
1 parent cb54f19 commit 207ee97
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 78 deletions.
3 changes: 3 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down Expand Up @@ -542,6 +543,7 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down Expand Up @@ -571,6 +573,7 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down
10 changes: 6 additions & 4 deletions ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
{
"images" : [
{
"filename" : "appstore.png",
"idiom" : "universal",
"filename" : "Frame 35309.png",
"idiom" : "iphone",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Frame 35309 (1).png",
"idiom" : "iphone",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Frame 35309 (2).png",
"idiom" : "iphone",
"scale" : "3x"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
25 changes: 17 additions & 8 deletions ios/Runner/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -13,10 +15,16 @@
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<view key="view" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFill" horizontalHuggingPriority="235" image="LaunchImage" adjustsImageSizeForAccessibilityContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
<rect key="frame" x="76.666666666666686" y="258" width="240" height="336"/>
<constraints>
<constraint firstAttribute="width" constant="240" id="Y6H-Gp-ddd"/>
<constraint firstAttribute="height" constant="336" id="gSI-rE-HwK"/>
</constraints>
<preferredSymbolConfiguration key="preferredSymbolConfiguration" scale="default"/>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand All @@ -25,13 +33,14 @@
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
<value key="contentSizeForViewInPopover" type="size" width="397" height="852"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
<point key="canvasLocation" x="80.152671755725194" y="264.08450704225356"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
<image name="LaunchImage" width="120" height="168"/>
</resources>
</document>
6 changes: 3 additions & 3 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
</array>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>FirebaseCrashlyticsCollectionEnabled</key>
<true/>
<key>GIDClientID</key>
<string>606541170752-1u2dcu9h35bn0v8949orj82ouhttb4jt.apps.googleusercontent.com</string>
<key>INIntentsSupported</key>
Expand All @@ -54,11 +56,9 @@
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<string>LaunchScreen.storyboard</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>FirebaseCrashlyticsCollectionEnabled</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
3 changes: 2 additions & 1 deletion lib/data/model/employee/employee.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/style/app_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class AppPage extends StatelessWidget {
leading == null
? null
: AppBar(
scrolledUnderElevation: 0.0,
backgroundColor: backGroundColor,
title: titleWidget ?? _title(context),
actions: actions,
Expand Down
97 changes: 36 additions & 61 deletions lib/ui/shared/events/celebrations_event_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:projectunity/data/core/utils/date_formatter.dart';
import 'package:projectunity/ui/shared/events/bloc/celebrations_bloc.dart';
import 'package:projectunity/ui/shared/events/bloc/celebrations_event.dart';
import 'package:projectunity/ui/shared/events/bloc/celebrations_state.dart';
import 'package:projectunity/ui/widget/circular_progress_indicator.dart';
import 'package:projectunity/ui/widget/error_snack_bar.dart';
import 'package:projectunity/ui/widget/user_profile_image.dart';

Expand All @@ -24,67 +23,39 @@ class EventCard extends StatefulWidget {
}

class _EventCardState extends State<EventCard> {
bool expanded = false;

@override
Widget build(BuildContext context) {
return Column(
children: [
Divider(color: context.colorScheme.outlineColor),
Material(
color: context.colorScheme.surface,
child: ExpansionTile(
onExpansionChanged: (value) {
setState(() {
expanded = !expanded;
});
BlocConsumer<CelebrationsBloc, CelebrationsState>(
builder: (context, state) {
if (state.status == Status.success) {
return Column(
children: [
EventsList(
header: "🎂 ${context.l10n.birthdays_tag} 🎂 ",
events: state.birthdays,
expanded: state.showAllBdays,
isAnniversary: false,
),
EventsList(
header: "🎊 ${context.l10n.work_anniversaries_tag} 🎊 ",
events: state.anniversaries,
expanded: state.showAllAnniversaries,
isAnniversary: true,
)
],
);
}
return const SizedBox();
},
shape: const Border(),
trailing: expanded
? const Icon(Icons.arrow_drop_up)
: const Icon(Icons.arrow_drop_down),
iconColor: context.colorScheme.textPrimary,
collapsedIconColor: context.colorScheme.primary,
collapsedTextColor: context.colorScheme.primary,
textColor: context.colorScheme.textPrimary,
title: Text("${context.l10n.event_card_title} 🎉",
style:
AppTextStyle.style20.copyWith(fontWeight: FontWeight.w600)),
children: [
BlocConsumer<CelebrationsBloc, CelebrationsState>(
builder: (context, state) {
if (state.status == Status.loading) {
return const AppCircularProgressIndicator();
} else if (state.status == Status.success) {
return Column(
children: [
EventsList(
header: "🎂 ${context.l10n.birthdays_tag} 🎂 ",
events: state.birthdays,
expanded: state.showAllBdays,
isAnniversary: false,
),
EventsList(
header:
"🎊 ${context.l10n.work_anniversaries_tag} 🎊 ",
events: state.anniversaries,
expanded: state.showAllAnniversaries,
isAnniversary: true,
)
],
);
}
return const SizedBox();
},
listenWhen: (previous, current) => current.error != null,
listener: (context, state) {
if (state.error != null) {
showSnackBar(context: context, error: state.error);
}
})
],
),
),
listenWhen: (previous, current) => current.error != null,
listener: (context, state) {
if (state.error != null) {
showSnackBar(context: context, error: state.error);
}
}),
Divider(color: context.colorScheme.outlineColor),
],
);
Expand Down Expand Up @@ -114,11 +85,15 @@ class EventsList extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
header,
style: AppTextStyle.style18.copyWith(
color: context.colorScheme.primary,
fontWeight: FontWeight.w700),
Expanded(
child: Text(
header,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: AppTextStyle.style18.copyWith(
color: context.colorScheme.primary,
fontWeight: FontWeight.w700),
),
),
Container(
padding: const EdgeInsets.all(5),
Expand Down
5 changes: 4 additions & 1 deletion lib/ui/widget/leave_application_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class LeaveApplicationCard extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LeaveStatusView(status: leaveApplication.leave.status),
LeaveStatusView(
status: leaveApplication.leave.status,
leaveType: leaveApplication.leave.type,
),
const SizedBox(
height: 10,
),
Expand Down
18 changes: 18 additions & 0 deletions lib/ui/widget/leave_card_status_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ class LeaveStatusView extends StatelessWidget {
final double verticalPadding;
final double horizontalPadding;
final LeaveStatus status;
final LeaveType? leaveType;

const LeaveStatusView(
{super.key,
required this.status,
this.leaveType,
this.verticalPadding = 4,
this.horizontalPadding = 10});

Expand All @@ -27,6 +29,22 @@ class LeaveStatusView extends StatelessWidget {
style: AppTextStyle.style16
.copyWith(color: leaveStatusColor(status, context)),
),
if (leaveType != null)
const SizedBox(
width: 8,
),
if (leaveType != null)
Container(
padding: const EdgeInsets.all(5),
decoration: BoxDecoration(
color: context.colorScheme.containerLow,
borderRadius: BorderRadius.circular(5)),
child: Text(
context.l10n
.leave_type_placeholder_text(leaveType!.value.toString())
.split(" ")[0],
style: AppTextStyle.style12),
)
],
);
}
Expand Down

0 comments on commit 207ee97

Please sign in to comment.