Skip to content

Commit

Permalink
Setup project (#53)
Browse files Browse the repository at this point in the history
* Setup project

* Set firebase authentication for web

* Set firebase authentication for web

* Minor changes

* Remove screenshot

* Minor change

* Fix: pipeline failed to version mismatch

* Fixed format and lint

* Upgrade flutter version

* Fix flutter version

* Ignore flutter analyze tool
  • Loading branch information
cp-sneha-s authored Jan 17, 2024
1 parent 9b782a1 commit 43c5460
Show file tree
Hide file tree
Showing 127 changed files with 917 additions and 753 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- uses: subosito/flutter-action@v2
name: Set up Flutter SDK
with:
flutter-version: 3.7.7
channel: 'stable'
cache: true

Expand Down
29 changes: 22 additions & 7 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
channel: stable
revision: "9e1c857886f07d342cf106f2cd588bcd5e031bb2"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
- platform: android
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
- platform: ios
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
- platform: linux
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
- platform: macos
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
- platform: web
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
- platform: windows
create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2
base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2

# User provided section

Expand Down
11 changes: 9 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
errors:
override_on_non_overriding_member: ignore


linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
Expand All @@ -22,8 +27,10 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule


# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.canopas.canopas_unity

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
1 change: 1 addition & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extensions:
20 changes: 19 additions & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
EEE757421E9F11EC92E34695 /* [CP] Embed Pods Frameworks */,
58AF4A6981196F2916DFE346 /* [firebase_crashlytics] Crashlytics Upload Symbols */,
FA0101254B1595E95A925111 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -166,7 +167,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -300,6 +301,23 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FA0101254B1595E95A925111 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
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.
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.
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.
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.
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.
12 changes: 12 additions & 0 deletions ios/RunnerTests/RunnerTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Flutter
import UIKit
import XCTest

class RunnerTests: XCTestCase {

func testExample() {
// If you add code to the Runner application, consider adding tests here.
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
}

}
12 changes: 6 additions & 6 deletions lib/data/bloc/user_state/user_controller_state.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
class UserControllerStatus{
class UserControllerStatus {
const UserControllerStatus();
}
class UserInitialStatus extends UserControllerStatus{

class UserInitialStatus extends UserControllerStatus {
const UserInitialStatus();
}

class UserAccessRevokedStatus extends UserControllerStatus{
class UserAccessRevokedStatus extends UserControllerStatus {
const UserAccessRevokedStatus();
}

class UserErrorStatus extends UserControllerStatus{
class UserErrorStatus extends UserControllerStatus {
const UserErrorStatus();
}

class UserUpdatedStatus extends UserControllerStatus{
class UserUpdatedStatus extends UserControllerStatus {
const UserUpdatedStatus();
}

15 changes: 9 additions & 6 deletions lib/data/bloc/user_state/user_state_controller_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class UserStateControllerBloc
final SpaceChangeNotifier _spaceChangeNotifier;
StreamSubscription? _subscription;

UserStateControllerBloc(
this._employeeRepo, this._userStateNotifier, this._spaceService, this._spaceChangeNotifier)
UserStateControllerBloc(this._employeeRepo, this._userStateNotifier,
this._spaceService, this._spaceChangeNotifier)
: super(const UserInitialStatus()) {
on<CheckUserStatus>(_updateEmployee);
on<ClearDataForDisableUser>(_clearData);
Expand All @@ -30,7 +30,7 @@ class UserStateControllerBloc

log("Init user status", name: "User Status");
_spaceChangeNotifier.addListener(() async {
if(_subscription != null){
if (_subscription != null) {
await _subscription?.cancel();
log("Stream canceled", name: "User Status");
}
Expand All @@ -39,7 +39,8 @@ class UserStateControllerBloc
}
});
if (_userStateNotifier.currentSpaceId != null) {
_spaceChangeNotifier.setSpaceId(spaceId: _userStateNotifier.currentSpaceId!);
_spaceChangeNotifier.setSpaceId(
spaceId: _userStateNotifier.currentSpaceId!);
}
}

Expand Down Expand Up @@ -67,7 +68,9 @@ class UserStateControllerBloc

Future<void> _updateData(
UpdateUserData event, Emitter<UserControllerStatus> emit) async {
if (event.employee != null && event.space != null && event.employee?.status == EmployeeStatus.active) {
if (event.employee != null &&
event.space != null &&
event.employee?.status == EmployeeStatus.active) {
if (event.employee != _userStateNotifier.employee) {
await _userStateNotifier.setEmployee(member: event.employee!);
log("Employee updated", name: "User Status");
Expand Down Expand Up @@ -98,7 +101,7 @@ class UserStateControllerBloc
@override
Future<void> close() async {
_spaceChangeNotifier.removeSpaceId();
_spaceChangeNotifier.removeListener(() { });
_spaceChangeNotifier.removeListener(() {});
await _subscription?.cancel();
return super.close();
}
Expand Down
5 changes: 1 addition & 4 deletions lib/data/core/extensions/map_extension.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import '../../model/leave/leave.dart';
import 'date_time.dart';

Expand All @@ -14,9 +13,7 @@ extension MapExtensions on Map<DateTime, LeaveDayDuration> {
..add(endDate);
}
for (var date in dates) {
putIfAbsent(
date.dateOnly,
() => date.getLeaveDayDuration());
putIfAbsent(date.dateOnly, () => date.getLeaveDayDuration());
}
removeWhere((key, value) => !dates.contains(key));
return this;
Expand Down
2 changes: 1 addition & 1 deletion lib/data/core/functions/shared_function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AppFunctions {

String getNotificationDuration(
{required double total,
required LeaveDayDuration firstLeaveDayDuration}) {
required LeaveDayDuration firstLeaveDayDuration}) {
if (total <= 1) {
if (firstLeaveDayDuration == LeaveDayDuration.firstHalfLeave) {
return "First Half";
Expand Down
4 changes: 2 additions & 2 deletions lib/data/core/utils/const/app_const.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class AppConsts {
static const String appTitle = "Unity";
}
static const String appTitle = "Unity";
}
11 changes: 4 additions & 7 deletions lib/data/core/utils/const/image_constant.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
class ImageConst{
static const String loginPageVectorImage = 'assets/images/office_growth.png';
static const String googleLogoImage = 'assets/images/google_logo.png';
static const String emptyLeaveStateImage = 'assets/images/empty_state.png';
class ImageConst {
static const String loginPageVectorImage = 'assets/images/office_growth.png';
static const String googleLogoImage = 'assets/images/google_logo.png';
static const String emptyLeaveStateImage = 'assets/images/empty_state.png';
}



12 changes: 8 additions & 4 deletions lib/data/core/utils/date_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ class DateFormatter {
return _localization.date_format_yMMMd(dt);
}

String getLeaveDurationPresentation({required double totalLeaves,required LeaveDayDuration firstDayDuration}) {
if (totalLeaves < 1 && firstDayDuration == LeaveDayDuration.firstHalfLeave) {
String getLeaveDurationPresentation(
{required double totalLeaves,
required LeaveDayDuration firstDayDuration}) {
if (totalLeaves < 1 &&
firstDayDuration == LeaveDayDuration.firstHalfLeave) {
return _localization.dateFormatter_first_half_day;
} else if (totalLeaves < 1 && firstDayDuration == LeaveDayDuration.secondHalfLeave) {
} else if (totalLeaves < 1 &&
firstDayDuration == LeaveDayDuration.secondHalfLeave) {
return _localization.dateFormatter_second_half_day;
}else if (totalLeaves == 1) {
} else if (totalLeaves == 1) {
return _localization.dateFormatter_full_day;
}
return _localization.dateFormatter_placeholder_other_days(totalLeaves);
Expand Down
2 changes: 1 addition & 1 deletion lib/data/model/account/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ class Account extends Equatable {
Account.fromJson(snapshot.data()!);

@override
List<Object?> get props => [uid, email, spaces,name];
List<Object?> get props => [uid, email, spaces, name];
}
3 changes: 1 addition & 2 deletions lib/data/model/leave_application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class LeaveApplication extends Equatable {
final Employee employee;
final Leave leave;

const LeaveApplication(
{required this.employee, required this.leave });
const LeaveApplication({required this.employee, required this.leave});

@override
List<Object?> get props => [employee, leave];
Expand Down
3 changes: 1 addition & 2 deletions lib/data/model/leave_count.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ class LeaveCounts extends Equatable {
final double urgentLeaves;
final double casualLeaves;

const LeaveCounts(
{this.casualLeaves = 0.0, this.urgentLeaves = 0.0})
const LeaveCounts({this.casualLeaves = 0.0, this.urgentLeaves = 0.0})
: totalUsedLeave = urgentLeaves + casualLeaves;

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class OrgFormField extends Equatable {

@override
List<Object?> get props =>
[question, answerType, options, isRequired, type, index,id];
[question, answerType, options, isRequired, type, index, id];
}

@JsonEnum(valueField: 'value')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
Expand All @@ -18,10 +17,10 @@ class OrgFormFieldResponse extends Equatable {
Map<String, dynamic> toJson() => _$OrgFormFieldResponseToJson(this);

factory OrgFormFieldResponse.fromFireStore(
DocumentSnapshot<Map<String, dynamic>> snapshot,
SnapshotOptions? options) =>
DocumentSnapshot<Map<String, dynamic>> snapshot,
SnapshotOptions? options) =>
OrgFormFieldResponse.fromJson(snapshot.data()!);

@override
List<Object?> get props => [fieldId, answer];
}
}
6 changes: 3 additions & 3 deletions lib/data/repo/employee_repo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class EmployeeRepo {
late BehaviorSubject<List<Employee>> _employeeController;
StreamSubscription<List<Employee>>? _employeeStreamSubscription;

EmployeeRepo(this._employeeService, this._userStateNotifier, this._crashlytics) {
EmployeeRepo(
this._employeeService, this._userStateNotifier, this._crashlytics) {
_employeeController = BehaviorSubject<List<Employee>>();
_employeeStreamSubscription = _employeeService
.employees(_userStateNotifier.currentSpaceId!)
Expand All @@ -33,8 +34,7 @@ class EmployeeRepo {
Stream<List<Employee>> get employees =>
_employeeController.stream.asBroadcastStream();

List<Employee> get allEmployees =>
_employeeController.value;
List<Employee> get allEmployees => _employeeController.value;

Stream<List<Employee>> get activeEmployees =>
_employeeController.stream.asyncMap((employees) => employees
Expand Down
Loading

0 comments on commit 43c5460

Please sign in to comment.