Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging changes pertaining to new ui, railway concession, notes #113

Merged
merged 46 commits into from
Apr 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5ee21cd
Scrolling Fixed
KalpeshJangir23 Aug 18, 2023
edae941
Merge pull request #110 from devout-coder/main
devout-coder Aug 24, 2023
68b93d6
Merge branch 'main' of https://github.com/KalpeshJangir23/Mobile-AppK…
KalpeshJangir23 Aug 25, 2023
e02abfd
profile ko pull kiya hai
KalpeshJangir23 Aug 25, 2023
c7888e3
minorbugs
KalpeshJangir23 Aug 25, 2023
5d7769f
changed release version
devout-coder Oct 8, 2023
c95f3ce
Merge https://github.com/KalpeshJangir23/Mobile-AppKalpesh
devout-coder Dec 10, 2023
e58e5e9
Merge pull request #2 from KalpeshJangir23/Railwayconcession
devout-coder Dec 10, 2023
a1069da
Merge branch 'main' of https://github.com/devout-coder/Mobile-App
devout-coder Dec 10, 2023
7d7fb35
created new model for concession details
devout-coder Dec 10, 2023
32f4a15
business logic for concession request
devout-coder Dec 12, 2023
d2946bd
added searchable dropdown
devout-coder Dec 14, 2023
2a4fc98
fixed UI
devout-coder Dec 14, 2023
f043354
conditional data according to concession status
devout-coder Dec 14, 2023
83c630b
set up all basic things
devout-coder Jan 12, 2024
a2c3443
all profile changes
devout-coder Jan 14, 2024
bbbbf90
Merge branch 'new_ui' into concession
devout-coder Jan 15, 2024
2e22e7c
railway concession new UI ready
devout-coder Jan 21, 2024
6487df4
fixed concession bugs
devout-coder Feb 18, 2024
55c5404
added teacher login
devout-coder Jan 22, 2024
c23621c
teacher login bug fixes
devout-coder Feb 7, 2024
2534594
started building UI of notes page
devout-coder Feb 10, 2024
a73fbde
logic and almost entire UI of notes page
devout-coder Feb 21, 2024
91d3703
integrated home screen and timetable
devout-coder Feb 22, 2024
2be45c7
fixed notification
devout-coder Feb 22, 2024
dee477d
ui fixes
devout-coder Feb 23, 2024
aa90133
integrated old dept and committee page
devout-coder Feb 23, 2024
66947af
added attendance page
devout-coder Feb 23, 2024
43bf33a
fixed notes bugs: scroll issue and re download
devout-coder Feb 25, 2024
67af2b6
notes filter, attachments CRUD(untested)
devout-coder Feb 27, 2024
6796cb0
Drawer UI done
KalpeshJangir23 Feb 25, 2024
466ac58
update UI farhan
farhank9821 Feb 28, 2024
cacba38
merge and made ui change
farhank9821 Feb 28, 2024
7f659a8
minor UI changes
farhank9821 Feb 28, 2024
a4a66a4
minor ui changes
farhank9821 Feb 28, 2024
e50aedb
added back navigations in notes & departements screen
farhank9821 Feb 28, 2024
d3f3d2d
minor ui changes
farhank9821 Feb 29, 2024
92f9a26
profile, notes pxiel overflowing ui solved
farhank9821 Feb 29, 2024
199c36e
super minor UI fixes
devout-coder Feb 28, 2024
539aa13
search works, fixed profile+notes bug that caused data to disappear on
devout-coder Feb 28, 2024
988a7df
minor ui changes
farhank9821 Feb 28, 2024
b285dec
super minor UI fixes
devout-coder Feb 28, 2024
03ab80e
diff home screen tabs for student and teacher, fixed attachments upload
devout-coder Feb 29, 2024
7378222
reduced concession's loading time
devout-coder Mar 3, 2024
489d625
stored subjects in collection
devout-coder Mar 9, 2024
b875b21
UI enhancements: notes and profile screen
devout-coder Mar 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
diff home screen tabs for student and teacher, fixed attachments upload
bugs
devout-coder committed Feb 29, 2024
commit 03ab80e6dad070a41906f5b242ea056f28820e73
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ class _TSECAppState extends ConsumerState<TSECApp> {
name: "home",
path: "/home",
builder: (context, state) => HomeScreen(
currentBottomNavPage: 0,
currentBottomNavPage: "home",
changeCurrentBottomNavPage: () {},
),
),
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class AttendanceScreen extends StatelessWidget {
AttendanceScreen({super.key});
class ERPScreen extends StatelessWidget {
ERPScreen({super.key});

WebViewController controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
161 changes: 109 additions & 52 deletions lib/new_ui/screens/home_screen/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:tsec_app/models/user_model/user_model.dart';
import 'package:tsec_app/new_ui/screens/attendance_screen/attendance_screen.dart';
import 'package:tsec_app/new_ui/screens/erp_screen/erp_screen.dart';
import 'package:tsec_app/new_ui/screens/home_screen/widgets/home_widget.dart';
import 'package:tsec_app/new_ui/screens/railway_screen/railway_screen.dart';
import 'package:tsec_app/new_ui/screens/timetable_screen/timetable_screen.dart';
@@ -10,7 +10,7 @@ import 'package:tsec_app/new_ui/screens/profile_screen/profile_screen.dart';
import 'package:tsec_app/provider/railway_concession_provider.dart';

class HomeScreen extends ConsumerStatefulWidget {
int currentBottomNavPage;
String currentBottomNavPage;
Function changeCurrentBottomNavPage;
HomeScreen(
{required this.currentBottomNavPage,
@@ -22,31 +22,66 @@ class HomeScreen extends ConsumerStatefulWidget {
}

class _HomeScreenState extends ConsumerState<HomeScreen> {
late int currentPage;
List<Widget> widgets = <Widget>[
HomeWidget(),
AttendanceScreen(),
const TimeTable(),
const RailwayConcessionScreen(),
ProfilePage(
justLoggedIn: false,
),
];

late String currentPage;
// List<Widget> widgets = <Widget>[
// HomeWidget(),
// ERPScreen(),
// const TimeTable(),
// const RailwayConcessionScreen(),
// ProfilePage(
// justLoggedIn: false,
// ),
// ];
late Map<String, Widget> widgetMap;
@override
void initState() {
currentPage = widget.currentBottomNavPage;
UserModel? user = ref.read(userModelProvider);
if (user != null && user.isStudent) {
widgetMap = {
"home": HomeWidget(
changeCurrentPage: (page) {
setState(() {
widget.changeCurrentBottomNavPage(page);
});
},
),
"attendance": ERPScreen(),
"timetable": const TimeTable(),
"concession": const RailwayConcessionScreen(),
"profile": ProfilePage(
justLoggedIn: false,
)
};
} else {
widgetMap = {
"home": HomeWidget(
changeCurrentPage: (page) {
setState(() {
widget.changeCurrentBottomNavPage(page);
});
},
),
"attendance": ERPScreen(),
"profile": ProfilePage(
justLoggedIn: false,
)
};
}
super.initState();
}

@override
Widget build(BuildContext context) {
UserModel? data = ref.watch(userModelProvider);

UserModel? user = ref.watch(userModelProvider);
currentPage = widget.currentBottomNavPage;
// debugPrint(currentPage.toString());
// debugPrint(widgetMap.keys.toList()[currentPage].toString());
// debugPrint(widgetMap.values.toList().toString());
// debugPrint(widgetMap[currentPage].toString());
bool concessionOpen = ref.watch(railwayConcessionOpenProvider);
return Scaffold(
resizeToAvoidBottomInset: true,
bottomNavigationBar: data != null && !concessionOpen
bottomNavigationBar: user != null && !concessionOpen
? BottomNavigationBar(
backgroundColor: Colors.transparent,
type: BottomNavigationBarType.fixed,
@@ -55,48 +90,70 @@ class _HomeScreenState extends ConsumerState<HomeScreen> {
showUnselectedLabels: false,
unselectedItemColor: Colors.white,
selectedItemColor: Colors.white,
items: const [
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
activeIcon: Icon(Icons.home),
icon: Icon(Icons.home_outlined),
label: "Home",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.people_outline),
activeIcon: Icon(Icons.people_rounded),
label: "Library",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
activeIcon: Icon(Icons.calendar_today),
icon: Icon(Icons.calendar_today_outlined),
label: "Time Table",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.directions_railway_outlined),
activeIcon: Icon(Icons.directions_railway_filled),
label: "Railway",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.person_outline),
activeIcon: Icon(Icons.person),
label: "Profile",
),
],
currentIndex: widget.currentBottomNavPage,
items: user.isStudent
? [
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
activeIcon: Icon(Icons.home),
icon: Icon(Icons.home_outlined),
label: "Home",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.people_outline),
activeIcon: Icon(Icons.people_rounded),
label: "Library",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
activeIcon: Icon(Icons.calendar_today),
icon: Icon(Icons.calendar_today_outlined),
label: "Time Table",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.directions_railway_outlined),
activeIcon: Icon(Icons.directions_railway_filled),
label: "Railway",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.person_outline),
activeIcon: Icon(Icons.person),
label: "Profile",
),
]
: [
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
activeIcon: Icon(Icons.home),
icon: Icon(Icons.home_outlined),
label: "Home",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.people_outline),
activeIcon: Icon(Icons.people_rounded),
label: "Library",
),
BottomNavigationBarItem(
backgroundColor: Colors.transparent,
icon: Icon(Icons.person_outline),
activeIcon: Icon(Icons.person),
label: "Profile",
),
],
currentIndex: widgetMap.keys.toList().indexOf(currentPage),
onTap: (index) {
// setState(() {
// selectedPage = index;
// });
widget.changeCurrentBottomNavPage(index);
widget
.changeCurrentBottomNavPage(widgetMap.keys.toList()[index]);
},
)
: null,
body: widgets[widget.currentBottomNavPage],
body: widgetMap[currentPage],
);
}
}
12 changes: 9 additions & 3 deletions lib/new_ui/screens/home_screen/widgets/home_widget.dart
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@ import 'package:tsec_app/provider/event_provider.dart';
import 'package:url_launcher/url_launcher_string.dart';

class HomeWidget extends ConsumerStatefulWidget {
const HomeWidget({Key? key}) : super(key: key);
Function(String page) changeCurrentPage;
HomeWidget({Key? key, required this.changeCurrentPage}) : super(key: key);

@override
ConsumerState<ConsumerStatefulWidget> createState() => _HomeWidgetState();
@@ -59,6 +60,7 @@ class _HomeWidgetState extends ConsumerState<HomeWidget> {
var _theme = Theme.of(context);
UserModel? data = ref.watch(userModelProvider);
fetchEventDetails();
// debugPrint("right here");
return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),
@@ -93,12 +95,16 @@ class _HomeWidgetState extends ConsumerState<HomeWidget> {
ContainerIconWithName(
text: "Railway",
icon: Icons.directions_railway_outlined,
onPressed: () {},
onPressed: () {
widget.changeCurrentPage("concession");
},
),
ContainerIconWithName(
text: "Notes",
icon: Icons.menu_book_rounded,
onPressed: () {},
onPressed: () {
GoRouter.of(context).push('/notes');
},
)
],
),
Loading