Skip to content

Commit

Permalink
Lint errors rectified
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavkonidena committed Dec 11, 2023
1 parent 0ae8f69 commit f2bfba0
Show file tree
Hide file tree
Showing 27 changed files with 210 additions and 186 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ migrate_working_dir/
*.iws
.idea/
test.dart
.github/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/routes/router_config.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:book_my_spot_frontend/src/screens/error/404_screen.dart';
import 'package:book_my_spot_frontend/src/screens/error/error_screen.dart';
import 'package:book_my_spot_frontend/src/screens/amenityHead/amenity_eventteams.dart';
import 'package:book_my_spot_frontend/src/screens/amenityHead/amenityhead_home.dart';
import 'package:book_my_spot_frontend/src/screens/baseUser/teams/chat/chat_screen.dart';
Expand Down Expand Up @@ -290,7 +290,7 @@ final router = GoRouter(
GoRoute(
path: "/grpcreate/:fallBack",
pageBuilder: (context, state) {
final fallBack = '/' + state.pathParameters["fallBack"]!;
final fallBack = '/${state.pathParameters["fallBack"]!}';
return CustomTransitionPage(
key: state.pageKey,
transitionDuration: const Duration(milliseconds: 750),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screens/amenityHead/amenity_event.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:book_my_spot_frontend/src/screens/amenityHead/amenityhead_home.dart';
import 'package:book_my_spot_frontend/src/services/storageManager.dart';
import 'package:book_my_spot_frontend/src/services/storage_manager.dart';
import 'package:book_my_spot_frontend/src/utils/api/amenity_api.dart';
import 'package:book_my_spot_frontend/src/utils/errors/amenity/amenity_exception.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screens/amenityHead/amenity_profile.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:book_my_spot_frontend/src/services/storageManager.dart';
import 'package:book_my_spot_frontend/src/services/storage_manager.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screens/amenityHead/amenityhead_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:book_my_spot_frontend/src/screens/amenityHead/amenity_event.dart
import 'package:book_my_spot_frontend/src/screens/amenityHead/events_list.dart';
import 'package:book_my_spot_frontend/src/screens/amenityHead/amenity_profile.dart';
import 'package:book_my_spot_frontend/src/screens/loading/loading_widget.dart';
import 'package:book_my_spot_frontend/src/services/storageManager.dart';
import 'package:book_my_spot_frontend/src/services/storage_manager.dart';
import 'package:book_my_spot_frontend/src/state/amenityhead/amenityhead_state.dart';
import 'package:book_my_spot_frontend/src/utils/api/amenity_api.dart';
import 'package:flutter/material.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/screens/baseUser/home/bottom_nav.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:book_my_spot_frontend/src/screens/baseUser/home/custompainter_bottomnav.dart';
import 'package:book_my_spot_frontend/src/state/navbar/navbar_state.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screens/baseUser/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:flutter/material.dart';
import '../../../services/storageManager.dart';
import '../../../services/storage_manager.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class HomeScreen extends ConsumerStatefulWidget {
Expand Down
27 changes: 17 additions & 10 deletions lib/src/screens/baseUser/newReservation/event_booking.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// ignore_for_file: unused_result

import 'package:book_my_spot_frontend/src/screens/baseUser/newReservation/make_reservation.dart';
import 'package:book_my_spot_frontend/src/services/providers.dart';
import 'package:book_my_spot_frontend/src/services/storageManager.dart';
import 'package:book_my_spot_frontend/src/services/storage_manager.dart';
import 'package:book_my_spot_frontend/src/state/navbar/navbar_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand Down Expand Up @@ -57,7 +59,7 @@ class EventBookingPage extends ConsumerWidget {
const EdgeInsets.only(left: 16.0, right: 16),
child: ListTile(
onTap: () async {
var post_data = {
var postData = {
"id": StorageManager.getToken().toString(),
"team_id": data[index]["id"].toString(),
"name": data[index]["name"].toString(),
Expand All @@ -66,26 +68,31 @@ class EventBookingPage extends ConsumerWidget {
.toString(),
};
var response = await http.post(
Uri.parse(using + "event/register"),
body: post_data);
Uri.parse("${using}event/register"),
body: postData);
if (response.statusCode == 500) {
SnackBar snackBar = const SnackBar(
content: Text("You are not an admin!"));
ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
if (context.mounted) {
ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
}
} else {
SnackBar snackBar = SnackBar(
content: Text(
"Registration for Team ${data[index]["name"]} succesfull"));
ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
if (context.mounted) {
ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
}

ref.refresh(currentIndexProvider);
ref.refresh(finalTeamsProvider);
ref.refresh(eventsProvider);
context.go("/");
Future.microtask(() => context.go("/"));
}

print(post_data);
debugPrint(postData.toString());
},
tileColor:
const Color.fromRGBO(217, 217, 217, 0.3),
Expand Down
38 changes: 20 additions & 18 deletions lib/src/screens/baseUser/newReservation/group_booking.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// ignore_for_file: unused_result

import 'dart:convert';
import 'package:book_my_spot_frontend/src/screens/baseUser/newReservation/check_slots.dart';
import 'package:book_my_spot_frontend/src/screens/baseUser/newReservation/confirm_booking.dart';
import 'package:book_my_spot_frontend/src/screens/baseUser/newReservation/group_creation.dart';
import 'package:book_my_spot_frontend/src/services/storageManager.dart';
import 'package:book_my_spot_frontend/src/services/storage_manager.dart';
import 'package:book_my_spot_frontend/src/state/bookings/booking_state.dart';
import 'package:book_my_spot_frontend/src/state/navbar/navbar_state.dart';
import 'package:flutter/material.dart';
Expand All @@ -20,10 +22,10 @@ class GroupBookingFinalPage extends ConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final grp_name = ref.watch(groupNameProvider);
final groupName = ref.watch(groupNameProvider);
final date = ref.watch(selectedDateProvider);
final data = ref.watch(slotsProviderAmenity);
var initial_post_data = {
var initialPostData = {
"date": "${date.year}-${date.month}-${date.day}",
"amenity_id": data[0]["amenity_id"].toString(),
"start_time": data[ref.read(indexProvider)]["start_time"].toString(),
Expand Down Expand Up @@ -59,30 +61,30 @@ class GroupBookingFinalPage extends ConsumerWidget {
i < ref.read(groupselectedProvider.notifier).state.length;
i++) {
var id = ref.read(groupselectedProvider)[i]["id"];
print(id);
debugPrint(id);
grpMembers.add(id);
}
print(grpMembers);
debugPrint(grpMembers.toString());
grpMembers.add(StorageManager.getToken().toString());
var grp_data = {
"name": grp_name,
var groupData = {
"name": groupName,
"id": jsonEncode(grpMembers).toString(),
};
print(grp_data);
var grp_response = await http
.post(Uri.parse(using + "group/add"), body: grp_data);
var grp_id = jsonDecode(grp_response.body.toString());
print(data);
initial_post_data["group_id"] = grp_id.toString();
debugPrint(groupData.toString());
var groupResponse = await http
.post(Uri.parse("${using}group/add"), body: groupData);
var grpId = jsonDecode(groupResponse.body.toString());
debugPrint(data.toString());
initialPostData["group_id"] = grpId.toString();
var response = await http.post(
Uri.parse(using + "booking/group/bookSlot"),
body: initial_post_data);
Uri.parse("${using}booking/group/bookSlot"),
body: initialPostData);
if (response.statusCode == 200) {
ref.refresh(groupNameProvider);
ref.refresh(groupselectedProvider);
ref.refresh(userBookingsProvider);
ref.refresh(currentIndexProvider);
context.go("/");
Future.microtask(() => context.go("/"));
}
},
child: const Padding(
Expand All @@ -102,12 +104,12 @@ class GroupBookingFinalPage extends ConsumerWidget {
children: [
TextField(
decoration:
InputDecoration(label: Center(child: Text("Enter group name"))),
const InputDecoration(label: Center(child: Text("Enter group name"))),
onChanged: (value) {
ref.read(groupNameProvider.notifier).state = value;
},
),
SizedBox(
const SizedBox(
height: 30,
),
],
Expand Down
Loading

0 comments on commit f2bfba0

Please sign in to comment.