Skip to content

Commit

Permalink
Clean up (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s authored Mar 5, 2024
1 parent b1ecad9 commit 248b659
Show file tree
Hide file tree
Showing 90 changed files with 261 additions and 314 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/android_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Set up Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: 3.7.7
channel: 'stable'
cache: true

Expand All @@ -33,7 +32,6 @@ jobs:
- name: Set up ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2 # omit if .ruby-version file exists in project, or replace with your team’s supported ruby version
bundler-cache: true

- name: Retrieve the secret and decode it to a file
Expand Down Expand Up @@ -63,7 +61,7 @@ jobs:
echo $APKSIGN_KEYSTORE_BASE64 | base64 -di > release.jks
export APKSIGN_KEYSTORE=`pwd`/release.jks
cd android
gem install bundler -v 2.4.22
gem install bundler
bundle install
echo $APP_PLAY_SERVICE_JSON > google_play_api_key.json
bundle exec fastlane supply init --track internal
Expand Down
7 changes: 3 additions & 4 deletions lib/data/provider/user_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@ enum UserState { authenticated, unauthenticated, spaceJoined, update }

@LazySingleton()
class UserStateNotifier with ChangeNotifier {

final FirebaseAuth _firebaseAuth;
final UserPreference _userPreference;
final SpaceChangeNotifier _spaceChangeNotifier;
UserState _userState = UserState.unauthenticated;


UserState get state => _userState;

UserStateNotifier(this._userPreference, this._spaceChangeNotifier,this._firebaseAuth) {
UserStateNotifier(
this._userPreference, this._spaceChangeNotifier, this._firebaseAuth) {
getUserStatus();
}

void getUserStatus() async {
if (_firebaseAuth.currentUser != null){
if (_firebaseAuth.currentUser != null) {
if (_userPreference.getAccount() == null) {
_userState = UserState.unauthenticated;
} else if (_userPreference.getSpace() != null &&
Expand Down
2 changes: 1 addition & 1 deletion lib/data/services/leave_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class LeaveService {
.where(FireStoreConst.endLeaveDate,
isLessThan: DateTime(year, month + 1).timeStampToInt)
.where(FireStoreConst.endLeaveDate,
isGreaterThanOrEqualTo: DateTime(year, month).timeStampToInt)
isGreaterThanOrEqualTo: DateTime(year, month).timeStampToInt)
.snapshots()
.asyncMap((event) => event.docs
.map((leave) {
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Future<void> main() async {
}

class MyApp extends StatelessWidget {
MyApp({Key? key}) : super(key: key);
MyApp({super.key});
final GoRouter _router = getIt<AppRouter>().router;

@override
Expand Down
3 changes: 1 addition & 2 deletions lib/style/other/app_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class AppButton extends StatelessWidget {
final Widget? child;

const AppButton(
{Key? key, this.tag, this.onTap, this.loading = false, this.child})
: super(key: key);
{super.key, this.tag, this.onTap, this.loading = false, this.child});

@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ class OrgFormFieldEntry extends StatelessWidget {
final int? maxLength;

const OrgFormFieldEntry(
{Key? key,
{super.key,
this.textInputAction,
this.validator,
this.maxLine,
this.onChanged,
this.controller,
this.maxLength,
this.hintText})
: super(key: key);
this.hintText});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/admin/home/home_screen/admin_home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import 'bloc/admin_home_event.dart';
import 'bloc/admin_home_state.dart';

class AdminHomeScreenPage extends StatelessWidget {
const AdminHomeScreenPage({Key? key}) : super(key: key);
const AdminHomeScreenPage({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -42,7 +42,7 @@ class AdminHomeScreenPage extends StatelessWidget {
}

class AdminHomeScreen extends StatefulWidget {
const AdminHomeScreen({Key? key}) : super(key: key);
const AdminHomeScreen({super.key});

@override
State<AdminHomeScreen> createState() => _AdminHomeScreenState();
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/admin/home/home_screen/widget/request_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import '../../../../widget/leave_application_card.dart';

class LeaveRequestList extends StatelessWidget {
const LeaveRequestList({
Key? key,
super.key,
required this.map,
}) : super(key: key);
});

final Map<DateTime, List<LeaveApplication>> map;

Expand Down
4 changes: 2 additions & 2 deletions lib/ui/admin/home/invite_member/invite_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'bloc/invite_member_event.dart';
import 'bloc/invite_member_state.dart';

class InviteMemberPage extends StatelessWidget {
const InviteMemberPage({Key? key}) : super(key: key);
const InviteMemberPage({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -28,7 +28,7 @@ class InviteMemberPage extends StatelessWidget {
}

class SearchMemberScreen extends StatefulWidget {
const SearchMemberScreen({Key? key}) : super(key: key);
const SearchMemberScreen({super.key});

@override
State<SearchMemberScreen> createState() => _SearchMemberScreenState();
Expand Down
6 changes: 2 additions & 4 deletions lib/ui/admin/leaves/details/admin_leave_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ import 'bloc/admin_leave_details_state.dart';
class AdminLeaveDetailsPage extends StatelessWidget {
final LeaveApplication leaveApplication;

const AdminLeaveDetailsPage({Key? key, required this.leaveApplication})
: super(key: key);
const AdminLeaveDetailsPage({super.key, required this.leaveApplication});

@override
Widget build(BuildContext context) {
Expand All @@ -48,8 +47,7 @@ class AdminLeaveApplicationDetailScreen extends StatefulWidget {
final LeaveApplication leaveApplication;

const AdminLeaveApplicationDetailScreen(
{Key? key, required this.leaveApplication})
: super(key: key);
{super.key, required this.leaveApplication});

@override
State<AdminLeaveApplicationDetailScreen> createState() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class AdminLeaveDetailsActionButton extends StatelessWidget {
final LeaveApplication leaveApplication;

const AdminLeaveDetailsActionButton({
Key? key,
super.key,
required this.leaveApplication,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import '../../../../../data/model/leave/leave.dart';
class AdminLeaveRequestDetailsDateContent extends StatelessWidget {
final Leave leave;

const AdminLeaveRequestDetailsDateContent({Key? key, required this.leave})
: super(key: key);
const AdminLeaveRequestDetailsDateContent({super.key, required this.leave});

@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../bloc/admin_leave_details_bloc.dart';
import '../bloc/admin_leave_details_event.dart';

class ApproveRejectionMessage extends StatelessWidget {
const ApproveRejectionMessage({Key? key}) : super(key: key);
const ApproveRejectionMessage({super.key});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/admin/leaves/leave_screen/admin_leaves_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'bloc /admin_leave_event.dart';
import 'bloc /admin_leaves_bloc.dart';

class AdminLeavesPage extends StatelessWidget {
const AdminLeavesPage({Key? key}) : super(key: key);
const AdminLeavesPage({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -33,7 +33,7 @@ class AdminLeavesPage extends StatelessWidget {
}

class AdminLeavesScreen extends StatefulWidget {
const AdminLeavesScreen({Key? key}) : super(key: key);
const AdminLeavesScreen({super.key});

@override
State<AdminLeavesScreen> createState() => _AdminLeavesScreenState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import '../bloc /admin_leaves_bloc.dart';
import '../bloc /admin_leaves_state.dart';

class AdminLeavesFilter extends StatefulWidget {
const AdminLeavesFilter({Key? key}) : super(key: key);
const AdminLeavesFilter({super.key});

@override
State<AdminLeavesFilter> createState() => _AdminLeavesFilterState();
Expand Down Expand Up @@ -141,8 +141,7 @@ class SearchEmployeeShowAllMemberLeaveButton extends StatelessWidget {
final bool employeeIsSelected;

const SearchEmployeeShowAllMemberLeaveButton(
{Key? key, required this.employeeIsSelected})
: super(key: key);
{super.key, required this.employeeIsSelected});

@override
Widget build(BuildContext context) {
Expand Down
5 changes: 2 additions & 3 deletions lib/ui/admin/members/detail/employee_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import 'widget/profile_detail.dart';
class EmployeeDetailPage extends StatelessWidget {
final String id;

const EmployeeDetailPage({Key? key, required this.id}) : super(key: key);
const EmployeeDetailPage({super.key, required this.id});

@override
Widget build(BuildContext context) {
Expand All @@ -36,8 +36,7 @@ class EmployeeDetailPage extends StatelessWidget {
class EmployeeDetailScreen extends StatefulWidget {
final String employeeId;

const EmployeeDetailScreen({Key? key, required this.employeeId})
: super(key: key);
const EmployeeDetailScreen({super.key, required this.employeeId});

@override
State<EmployeeDetailScreen> createState() => _EmployeeDetailScreenState();
Expand Down
5 changes: 2 additions & 3 deletions lib/ui/admin/members/detail/widget/profile_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../../../../../data/model/employee/employee.dart';
import '../../../../widget/user_profile_image.dart';

class ProfileCard extends StatelessWidget {
const ProfileCard({Key? key, required this.employee}) : super(key: key);
const ProfileCard({super.key, required this.employee});

final Employee employee;

Expand Down Expand Up @@ -69,8 +69,7 @@ class ProfileCard extends StatelessWidget {
}

class TextColumn extends StatelessWidget {
const TextColumn({Key? key, required this.title, required this.subtitle})
: super(key: key);
const TextColumn({super.key, required this.title, required this.subtitle});

final String title;
final String? subtitle;
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/admin/members/detail/widget/profile_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class ProfileDetail extends StatelessWidget {
final Employee employee;

const ProfileDetail({
Key? key,
super.key,
required this.employee,
}) : super(key: key);
});

@override
Widget build(BuildContext context) {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/admin/members/detail/widget/time_off_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import '../../../../../app_router.dart';

class TimeOffCard extends StatelessWidget {
const TimeOffCard({
Key? key,
super.key,
required this.percentage,
required this.usedLeaves,
required this.employee,
}) : super(key: key);
});
final Employee employee;
final double percentage;
final LeaveCounts usedLeaves;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class AdminEmployeeDetailsLeavesPage extends StatelessWidget {
final String employeeId;

const AdminEmployeeDetailsLeavesPage(
{Key? key, required this.employeeName, required this.employeeId})
: super(key: key);
{super.key, required this.employeeName, required this.employeeId});

@override
Widget build(BuildContext context) {
Expand All @@ -29,8 +28,7 @@ class AdminEmployeeDetailsLeavesPage extends StatelessWidget {
class AdminEmployeeDetailsLeavesScreen extends StatefulWidget {
final String employeeName;

const AdminEmployeeDetailsLeavesScreen({Key? key, required this.employeeName})
: super(key: key);
const AdminEmployeeDetailsLeavesScreen({super.key, required this.employeeName});

@override
State<AdminEmployeeDetailsLeavesScreen> createState() =>
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/admin/members/details_leaves/widget/leave_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import '../bloc/admin_employee_details_leave_state.dart';
class EmployeeLeaveList extends StatefulWidget {
final String employeeName;

const EmployeeLeaveList({Key? key, required this.employeeName})
: super(key: key);
const EmployeeLeaveList({super.key, required this.employeeName});

@override
State<EmployeeLeaveList> createState() => _EmployeeLeaveListState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import 'bloc/admin_edit_employee_state.dart';
class AdminEditEmployeeDetailsPage extends StatelessWidget {
final Employee employee;

const AdminEditEmployeeDetailsPage({Key? key, required this.employee})
: super(key: key);
const AdminEditEmployeeDetailsPage({super.key, required this.employee});

@override
Widget build(BuildContext context) {
Expand All @@ -34,8 +33,7 @@ class AdminEditEmployeeDetailsPage extends StatelessWidget {
class AdminEditEmployeeDetailsView extends StatefulWidget {
final Employee employee;

const AdminEditEmployeeDetailsView({Key? key, required this.employee})
: super(key: key);
const AdminEditEmployeeDetailsView({super.key, required this.employee});

@override
State<AdminEditEmployeeDetailsView> createState() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ class AdminEditEmployeeDetailsForm extends StatelessWidget {
final TextEditingController employeeIDFieldController;

const AdminEditEmployeeDetailsForm(
{Key? key,
{super.key,
required this.profileImageUrl,
required this.employeeId,
required this.nameFieldController,
required this.emailFieldController,
required this.designationFieldController,
required this.levelFieldController,
required this.employeeIDFieldController})
: super(key: key);
required this.employeeIDFieldController});

@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class ToggleButton extends StatelessWidget {
final Role role;
final Function(Role role) onRoleChange;

const ToggleButton({Key? key, required this.onRoleChange, required this.role})
: super(key: key);
const ToggleButton({super.key, required this.onRoleChange, required this.role});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -65,7 +64,7 @@ class ToggleButton extends StatelessWidget {
),
),
)
.toList()

],
),
),
Expand Down
3 changes: 1 addition & 2 deletions lib/ui/admin/members/list/inivitation_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import '../../../../data/model/invitation/invitation.dart';
class InvitedMemberCard extends StatelessWidget {
final Invitation invitation;

const InvitedMemberCard({Key? key, required this.invitation})
: super(key: key);
const InvitedMemberCard({super.key, required this.invitation});

@override
Widget build(BuildContext context) {
Expand Down
Loading

0 comments on commit 248b659

Please sign in to comment.