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

8 user authentication #14

Merged
merged 11 commits into from
Nov 19, 2023
Merged

8 user authentication #14

merged 11 commits into from
Nov 19, 2023

Conversation

carlobortolan
Copy link
Member

@carlobortolan carlobortolan commented Nov 18, 2023

Implemented user authentication using basic auth and TUM SSO and state management using riverpod and rxdart.

NOTE: This branch was mainly used to implement the authentication process for the app and the current views are therefore only a placeholder.

How SAML2.0, the SSO implementation used by TUM, works in general can also be read here.

To further understand how gocast's TUM-SSO authentication works:

tum-saml-2 0

@carlobortolan carlobortolan added the enhancement New feature or request label Nov 18, 2023
@carlobortolan carlobortolan self-assigned this Nov 18, 2023
@carlobortolan carlobortolan linked an issue Nov 18, 2023 that may be closed by this pull request
3 tasks
This was referenced Nov 18, 2023
@carlobortolan carlobortolan requested a review from a team November 18, 2023 12:14
@carlobortolan carlobortolan removed the request for review from GravityDarkLab November 18, 2023 17:55
lib/views/login_view.dart Outdated Show resolved Hide resolved
lib/views/login_view.dart Outdated Show resolved Hide resolved
lib/views/login_view.dart Outdated Show resolved Hide resolved
lib/views/login_view.dart Outdated Show resolved Hide resolved
lib/views/login_view.dart Outdated Show resolved Hide resolved
lib/base/networking/apis/auth_handler.dart Outdated Show resolved Hide resolved
lib/base/networking/apis/auth_handler.dart Outdated Show resolved Hide resolved
lib/base/networking/apis/auth_handler.dart Outdated Show resolved Hide resolved
lib/base/networking/apis/auth_handler.dart Outdated Show resolved Hide resolved
GravityDarkLab
GravityDarkLab previously approved these changes Nov 18, 2023
lib/base/networking/apis/auth_handler.dart Outdated Show resolved Hide resolved
lib/base/networking/apis/auth_handler.dart Show resolved Hide resolved
lib/model/user_model.dart Outdated Show resolved Hide resolved
lib/viewModels/user_viewmodel.dart Outdated Show resolved Hide resolved
@carlobortolan carlobortolan merged commit 280e0c7 into dev Nov 19, 2023
1 check passed
@carlobortolan carlobortolan deleted the 8-user-authentication branch November 19, 2023 12:10
@carlobortolan carlobortolan mentioned this pull request Nov 28, 2023
Merged
carlobortolan added a commit that referenced this pull request Dec 3, 2023
* 8 user authentication (#14)

* Update README.md and dependencies

* Add basic app structure and assets

* Implement first models, viewmodels and api calls needed for user auth

* Implement TUM-SSO authentication and update README.md and

* Clean up auth_handler.dart and update routes

* Update userState and userViewModel to use riverpod and rxdart

* Refactor code to improve readability

* Remove unused import

* Clean up code, refactor models, update error-handling

* 31 initial UI views (#53)

* Basic tum login functionality, not yet done internal account

* pushin android and yaml files also

* Added some more views,course overview and setting

* Added mycourses and public courses views,also solved navigation bug

* added bottom bar functionality with solving navigation using route=false

* removed views folder

* changed names of notification file

* Solved navigation bug from notification screen

* Added some photos,cleared login screen and add same on 1 screen and fixed bottom nav bar

* Added reusable widgets,constants,corrrected name for bookmark

* changed bookmarks text to pinned

* added login functionality

* solved login bug

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 32 implement custom errors (#55)

* Rename View->views and ViewModel -> view_model

* Run `dart fix --apply && dart format ./lib`

* Implement error handling for http requests&responses

* 54 set up grpc client (#59)

* Rename `lib/model` -> `lib/models` and `networking/apis` -> `networking/api`

* Update error handling to work with gRPC codes

* Setup proto dir structure

* Implement grpc_handler.dart

* Add (de-)serialization from/to proto

* Implement `fetchUser()` gRPC method in `user_handler.dart` and update `user_viewmodel.dart`

* Add doc

* Fix args & linting in model_generator.dart

* Update dependencies

* Update README.md

* Update `routes.dart` to automatically configure root url

* Update doc

* Add `setup_grpc.sh`

* Tmp (#69)

Update workflow with right bundle id

Co-authored-by: Jakob Körber <56073945+jakobkoerber@users.noreply.github.com>

* Update beta release workflow

* 34 clean code base (#83)

* Add config directory for better structure

* Refactor ModelGenerator

* Add Logging in handlers

* Add Logging in handlers

* Add secure storage for the token

* removed Bootstrap

* Add secure storage for the token

* Update `main.dart` to use `StreamBuilder` instead of `StreamProvider`

* Refactor  UserViewModel

* Replace old models with proto models

* Fix linting

* Improve code structure

* Add Theme

* Refactor 'internal_login_screen.dart'

* Refactor

* Refactor: Remove unused TextEditingController instances in WelcomeScreen

- Eliminated declarations of usernameController and passwordController in WelcomeScreen as they were not used.
- Ensured clean and optimized code by removing unnecessary Riverpod provider references.
- Improved overall code readability and maintainability.

* Optimize CourseOverview to Prevent Unnecessary Re-renders

- Resolved issue causing re-renders of AppBar and BottomNavigationBar on tab changes.
- Implemented Column layout to display 'My Courses' and 'Public Courses' sections together, ensuring consistent visibility.
- Added spacing between course sections for better visual clarity and user experience.
- Enhanced layout performance and overall responsiveness of the CourseOverview screen.

* Add code documentation for course_overview and course_section

* Refactor Course Sections for Reusability and Clarity

- Introduced CourseContentScreen to centralize the display logic of course sections.
- Refactored PinnedCourses and DownloadsScreen to use CourseContentScreen, enhancing code reusability.
- Added in-code documentation for clarity and future maintainability.

* Fix INT64 type

* Fix Linting

* Fix colors on TabBar not changing correctly

* Added list view builder in course_view

* changed list view to list view builder in course_view and addressed some trailing commas issue

* added material design switch in setting

* deleteing course outline

* Added base_view for app bar and bottom navigatoe

* Added base_view in course_Screen

* added onViewAll functionality

* no re rendering when click on same page

* Improve the usage of the user Model view.
- Added loading state when clicked on login
    - `handleSSOLogin()`
    - `handleSSOLogin()`
    - Added `BehaviorSubject<bool> isLoading = BehaviorSubject.seeded(false);`

* Refactor `course_card_view.dart` and added documentation for `base_view.dart`, `course_card_view.dart`, `course_overview_view.dart`

* Refactor `ssoAuth` and added documentation

* Refactor `SettingsScreen` and added documentation to `internal_login_view` and `welcome_screen_view`

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Rename `routes.dart` to `app_config.dart` and moved to the `config` package

* **Refactored** `UserViewModel` and Login Handling**: Moved login logic and `TextEditingController`s into `UserViewModel`

* ## Refactor: Integrate StateNotifier in UserViewModel
- Refactored `UserViewModel` to extend `StateNotifier<UserState>`.
- Eliminated separate `isLoading` BehaviorSubject in `UserViewModel`. All state changes, including loading states, are now handled directly through the unified `UserState` managed by the notifier.

* ## Refactor: Courses views to have `List<VideoCard>` or `List<VideoCard>

* ## Refactor: Courses views to have to make better use of `List.builder` and added a temporary `CourseModel` in course_model.dart that will be replaced once API courses retrieving works.

---------

Co-authored-by: carlobortolan <carlobortolan@gmail.com>
Co-authored-by: ge59dil <anish.goyal@tum.de>

* Add redirect after "Continue Without" (#87)

---------

Co-authored-by: Anishyou <123313052+Anishyou@users.noreply.github.com>
Co-authored-by: ge59dil <anish.goyal@tum.de>
Co-authored-by: Jakob Körber <56073945+jakobkoerber@users.noreply.github.com>
Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>
carlobortolan added a commit that referenced this pull request Dec 4, 2023
Dev (#67)

* 8 user authentication (#14)

* Update README.md and dependencies

* Add basic app structure and assets

* Implement first models, viewmodels and api calls needed for user auth

* Implement TUM-SSO authentication and update README.md and

* Clean up auth_handler.dart and update routes

* Update userState and userViewModel to use riverpod and rxdart

* Refactor code to improve readability

* Remove unused import

* Clean up code, refactor models, update error-handling

* 31 initial UI views (#53)

* Basic tum login functionality, not yet done internal account

* pushin android and yaml files also

* Added some more views,course overview and setting

* Added mycourses and public courses views,also solved navigation bug

* added bottom bar functionality with solving navigation using route=false

* removed views folder

* changed names of notification file

* Solved navigation bug from notification screen

* Added some photos,cleared login screen and add same on 1 screen and fixed bottom nav bar

* Added reusable widgets,constants,corrrected name for bookmark

* changed bookmarks text to pinned

* added login functionality

* solved login bug

---------



* 32 implement custom errors (#55)

* Rename View->views and ViewModel -> view_model

* Run `dart fix --apply && dart format ./lib`

* Implement error handling for http requests&responses

* 54 set up grpc client (#59)

* Rename `lib/model` -> `lib/models` and `networking/apis` -> `networking/api`

* Update error handling to work with gRPC codes

* Setup proto dir structure

* Implement grpc_handler.dart

* Add (de-)serialization from/to proto

* Implement `fetchUser()` gRPC method in `user_handler.dart` and update `user_viewmodel.dart`

* Add doc

* Fix args & linting in model_generator.dart

* Update dependencies

* Update README.md

* Update `routes.dart` to automatically configure root url

* Update doc

* Add `setup_grpc.sh`

* Tmp (#69)

Update workflow with right bundle id



* Update beta release workflow

* 34 clean code base (#83)

* Add config directory for better structure

* Refactor ModelGenerator

* Add Logging in handlers

* Add Logging in handlers

* Add secure storage for the token

* removed Bootstrap

* Add secure storage for the token

* Update `main.dart` to use `StreamBuilder` instead of `StreamProvider`

* Refactor  UserViewModel

* Replace old models with proto models

* Fix linting

* Improve code structure

* Add Theme

* Refactor 'internal_login_screen.dart'

* Refactor

* Refactor: Remove unused TextEditingController instances in WelcomeScreen

- Eliminated declarations of usernameController and passwordController in WelcomeScreen as they were not used.
- Ensured clean and optimized code by removing unnecessary Riverpod provider references.
- Improved overall code readability and maintainability.

* Optimize CourseOverview to Prevent Unnecessary Re-renders

- Resolved issue causing re-renders of AppBar and BottomNavigationBar on tab changes.
- Implemented Column layout to display 'My Courses' and 'Public Courses' sections together, ensuring consistent visibility.
- Added spacing between course sections for better visual clarity and user experience.
- Enhanced layout performance and overall responsiveness of the CourseOverview screen.

* Add code documentation for course_overview and course_section

* Refactor Course Sections for Reusability and Clarity

- Introduced CourseContentScreen to centralize the display logic of course sections.
- Refactored PinnedCourses and DownloadsScreen to use CourseContentScreen, enhancing code reusability.
- Added in-code documentation for clarity and future maintainability.

* Fix INT64 type

* Fix Linting

* Fix colors on TabBar not changing correctly

* Added list view builder in course_view

* changed list view to list view builder in course_view and addressed some trailing commas issue

* added material design switch in setting

* deleteing course outline

* Added base_view for app bar and bottom navigatoe

* Added base_view in course_Screen

* added onViewAll functionality

* no re rendering when click on same page

* Improve the usage of the user Model view.
- Added loading state when clicked on login
    - `handleSSOLogin()`
    - `handleSSOLogin()`
    - Added `BehaviorSubject<bool> isLoading = BehaviorSubject.seeded(false);`

* Refactor `course_card_view.dart` and added documentation for `base_view.dart`, `course_card_view.dart`, `course_overview_view.dart`

* Refactor `ssoAuth` and added documentation

* Refactor `SettingsScreen` and added documentation to `internal_login_view` and `welcome_screen_view`

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Rename `routes.dart` to `app_config.dart` and moved to the `config` package

* **Refactored** `UserViewModel` and Login Handling**: Moved login logic and `TextEditingController`s into `UserViewModel`

* ## Refactor: Integrate StateNotifier in UserViewModel
- Refactored `UserViewModel` to extend `StateNotifier<UserState>`.
- Eliminated separate `isLoading` BehaviorSubject in `UserViewModel`. All state changes, including loading states, are now handled directly through the unified `UserState` managed by the notifier.

* ## Refactor: Courses views to have `List<VideoCard>` or `List<VideoCard>

* ## Refactor: Courses views to have to make better use of `List.builder` and added a temporary `CourseModel` in course_model.dart that will be replaced once API courses retrieving works.

---------




* Add redirect after "Continue Without" (#87)

---------

Co-authored-by: Anishyou <123313052+Anishyou@users.noreply.github.com>
Co-authored-by: ge59dil <anish.goyal@tum.de>
Co-authored-by: Jakob Körber <56073945+jakobkoerber@users.noreply.github.com>
Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>
carlobortolan added a commit that referenced this pull request Jan 30, 2024
* 8 user authentication (#14)

* Update README.md and dependencies

* Add basic app structure and assets

* Implement first models, viewmodels and api calls needed for user auth

* Implement TUM-SSO authentication and update README.md and

* Clean up auth_handler.dart and update routes

* Update userState and userViewModel to use riverpod and rxdart

* Refactor code to improve readability

* Remove unused import

* Clean up code, refactor models, update error-handling

* 31 initial UI views (#53)

* Basic tum login functionality, not yet done internal account

* pushin android and yaml files also

* Added some more views,course overview and setting

* Added mycourses and public courses views,also solved navigation bug

* added bottom bar functionality with solving navigation using route=false

* removed views folder

* changed names of notification file

* Solved navigation bug from notification screen

* Added some photos,cleared login screen and add same on 1 screen and fixed bottom nav bar

* Added reusable widgets,constants,corrrected name for bookmark

* changed bookmarks text to pinned

* added login functionality

* solved login bug

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 32 implement custom errors (#55)

* Rename View->views and ViewModel -> view_model

* Run `dart fix --apply && dart format ./lib`

* Implement error handling for http requests&responses

* 54 set up grpc client (#59)

* Rename `lib/model` -> `lib/models` and `networking/apis` -> `networking/api`

* Update error handling to work with gRPC codes

* Setup proto dir structure

* Implement grpc_handler.dart

* Add (de-)serialization from/to proto

* Implement `fetchUser()` gRPC method in `user_handler.dart` and update `user_viewmodel.dart`

* Add doc

* Fix args & linting in model_generator.dart

* Update dependencies

* Update README.md

* Update `routes.dart` to automatically configure root url

* Update doc

* Add `setup_grpc.sh`

* Tmp (#69)

Update workflow with right bundle id

Co-authored-by: Jakob Körber <56073945+jakobkoerber@users.noreply.github.com>

* Update beta release workflow

* 34 clean code base (#83)

* Add config directory for better structure

* Refactor ModelGenerator

* Add Logging in handlers

* Add Logging in handlers

* Add secure storage for the token

* removed Bootstrap

* Add secure storage for the token

* Update `main.dart` to use `StreamBuilder` instead of `StreamProvider`

* Refactor  UserViewModel

* Replace old models with proto models

* Fix linting

* Improve code structure

* Add Theme

* Refactor 'internal_login_screen.dart'

* Refactor

* Refactor: Remove unused TextEditingController instances in WelcomeScreen

- Eliminated declarations of usernameController and passwordController in WelcomeScreen as they were not used.
- Ensured clean and optimized code by removing unnecessary Riverpod provider references.
- Improved overall code readability and maintainability.

* Optimize CourseOverview to Prevent Unnecessary Re-renders

- Resolved issue causing re-renders of AppBar and BottomNavigationBar on tab changes.
- Implemented Column layout to display 'My Courses' and 'Public Courses' sections together, ensuring consistent visibility.
- Added spacing between course sections for better visual clarity and user experience.
- Enhanced layout performance and overall responsiveness of the CourseOverview screen.

* Add code documentation for course_overview and course_section

* Refactor Course Sections for Reusability and Clarity

- Introduced CourseContentScreen to centralize the display logic of course sections.
- Refactored PinnedCourses and DownloadsScreen to use CourseContentScreen, enhancing code reusability.
- Added in-code documentation for clarity and future maintainability.

* Fix INT64 type

* Fix Linting

* Fix colors on TabBar not changing correctly

* Added list view builder in course_view

* changed list view to list view builder in course_view and addressed some trailing commas issue

* added material design switch in setting

* deleteing course outline

* Added base_view for app bar and bottom navigatoe

* Added base_view in course_Screen

* added onViewAll functionality

* no re rendering when click on same page

* Improve the usage of the user Model view.
- Added loading state when clicked on login
    - `handleSSOLogin()`
    - `handleSSOLogin()`
    - Added `BehaviorSubject<bool> isLoading = BehaviorSubject.seeded(false);`

* Refactor `course_card_view.dart` and added documentation for `base_view.dart`, `course_card_view.dart`, `course_overview_view.dart`

* Refactor `ssoAuth` and added documentation

* Refactor `SettingsScreen` and added documentation to `internal_login_view` and `welcome_screen_view`

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Rename `routes.dart` to `app_config.dart` and moved to the `config` package

* **Refactored** `UserViewModel` and Login Handling**: Moved login logic and `TextEditingController`s into `UserViewModel`

* ## Refactor: Integrate StateNotifier in UserViewModel
- Refactored `UserViewModel` to extend `StateNotifier<UserState>`.
- Eliminated separate `isLoading` BehaviorSubject in `UserViewModel`. All state changes, including loading states, are now handled directly through the unified `UserState` managed by the notifier.

* ## Refactor: Courses views to have `List<VideoCard>` or `List<VideoCard>

* ## Refactor: Courses views to have to make better use of `List.builder` and added a temporary `CourseModel` in course_model.dart that will be replaced once API courses retrieving works.

---------

Co-authored-by: carlobortolan <carlobortolan@gmail.com>
Co-authored-by: ge59dil <anish.goyal@tum.de>

* Add redirect after "Continue Without" (#87)

* Tmp (#88)

Dev (#67)

* 8 user authentication (#14)

* Update README.md and dependencies

* Add basic app structure and assets

* Implement first models, viewmodels and api calls needed for user auth

* Implement TUM-SSO authentication and update README.md and

* Clean up auth_handler.dart and update routes

* Update userState and userViewModel to use riverpod and rxdart

* Refactor code to improve readability

* Remove unused import

* Clean up code, refactor models, update error-handling

* 31 initial UI views (#53)

* Basic tum login functionality, not yet done internal account

* pushin android and yaml files also

* Added some more views,course overview and setting

* Added mycourses and public courses views,also solved navigation bug

* added bottom bar functionality with solving navigation using route=false

* removed views folder

* changed names of notification file

* Solved navigation bug from notification screen

* Added some photos,cleared login screen and add same on 1 screen and fixed bottom nav bar

* Added reusable widgets,constants,corrrected name for bookmark

* changed bookmarks text to pinned

* added login functionality

* solved login bug

---------



* 32 implement custom errors (#55)

* Rename View->views and ViewModel -> view_model

* Run `dart fix --apply && dart format ./lib`

* Implement error handling for http requests&responses

* 54 set up grpc client (#59)

* Rename `lib/model` -> `lib/models` and `networking/apis` -> `networking/api`

* Update error handling to work with gRPC codes

* Setup proto dir structure

* Implement grpc_handler.dart

* Add (de-)serialization from/to proto

* Implement `fetchUser()` gRPC method in `user_handler.dart` and update `user_viewmodel.dart`

* Add doc

* Fix args & linting in model_generator.dart

* Update dependencies

* Update README.md

* Update `routes.dart` to automatically configure root url

* Update doc

* Add `setup_grpc.sh`

* Tmp (#69)

Update workflow with right bundle id



* Update beta release workflow

* 34 clean code base (#83)

* Add config directory for better structure

* Refactor ModelGenerator

* Add Logging in handlers

* Add Logging in handlers

* Add secure storage for the token

* removed Bootstrap

* Add secure storage for the token

* Update `main.dart` to use `StreamBuilder` instead of `StreamProvider`

* Refactor  UserViewModel

* Replace old models with proto models

* Fix linting

* Improve code structure

* Add Theme

* Refactor 'internal_login_screen.dart'

* Refactor

* Refactor: Remove unused TextEditingController instances in WelcomeScreen

- Eliminated declarations of usernameController and passwordController in WelcomeScreen as they were not used.
- Ensured clean and optimized code by removing unnecessary Riverpod provider references.
- Improved overall code readability and maintainability.

* Optimize CourseOverview to Prevent Unnecessary Re-renders

- Resolved issue causing re-renders of AppBar and BottomNavigationBar on tab changes.
- Implemented Column layout to display 'My Courses' and 'Public Courses' sections together, ensuring consistent visibility.
- Added spacing between course sections for better visual clarity and user experience.
- Enhanced layout performance and overall responsiveness of the CourseOverview screen.

* Add code documentation for course_overview and course_section

* Refactor Course Sections for Reusability and Clarity

- Introduced CourseContentScreen to centralize the display logic of course sections.
- Refactored PinnedCourses and DownloadsScreen to use CourseContentScreen, enhancing code reusability.
- Added in-code documentation for clarity and future maintainability.

* Fix INT64 type

* Fix Linting

* Fix colors on TabBar not changing correctly

* Added list view builder in course_view

* changed list view to list view builder in course_view and addressed some trailing commas issue

* added material design switch in setting

* deleteing course outline

* Added base_view for app bar and bottom navigatoe

* Added base_view in course_Screen

* added onViewAll functionality

* no re rendering when click on same page

* Improve the usage of the user Model view.
- Added loading state when clicked on login
    - `handleSSOLogin()`
    - `handleSSOLogin()`
    - Added `BehaviorSubject<bool> isLoading = BehaviorSubject.seeded(false);`

* Refactor `course_card_view.dart` and added documentation for `base_view.dart`, `course_card_view.dart`, `course_overview_view.dart`

* Refactor `ssoAuth` and added documentation

* Refactor `SettingsScreen` and added documentation to `internal_login_view` and `welcome_screen_view`

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Fix in `ssoAuth` when ` Navigator.pushNamed(context, '/home');` called to set the loading state of login to false.

* Rename `routes.dart` to `app_config.dart` and moved to the `config` package

* **Refactored** `UserViewModel` and Login Handling**: Moved login logic and `TextEditingController`s into `UserViewModel`

* ## Refactor: Integrate StateNotifier in UserViewModel
- Refactored `UserViewModel` to extend `StateNotifier<UserState>`.
- Eliminated separate `isLoading` BehaviorSubject in `UserViewModel`. All state changes, including loading states, are now handled directly through the unified `UserState` managed by the notifier.

* ## Refactor: Courses views to have `List<VideoCard>` or `List<VideoCard>

* ## Refactor: Courses views to have to make better use of `List.builder` and added a temporary `CourseModel` in course_model.dart that will be replaced once API courses retrieving works.

---------




* Add redirect after "Continue Without" (#87)

---------

Co-authored-by: Anishyou <123313052+Anishyou@users.noreply.github.com>
Co-authored-by: ge59dil <anish.goyal@tum.de>
Co-authored-by: Jakob Körber <56073945+jakobkoerber@users.noreply.github.com>
Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>

* 46 fetch courses  (#104)

* Add gRPC calls to fetch courses

* Update `user_state_model.dart` and `UserViewModel.dart`

* Rename `UserViewModel.dart` -> `user_view_model.dart`

* Fix imports

* Update views to call endpoints

* Update views to handle fetching of courses

* ##Fix: fix Riverpod state management in `UserViewModel`.
- fix data fetching in `MyCourses` and `PublicCourses`.
- Improve navigation handling using Riverpod and `GlobalKey`.
- centralized `providers.dart`

* finished settings_screen_view

* Added updated logo

* Added logo on welcome_Screen

* fixed video_Card, added video_view

* deleting chat_view cuz not ready

* Add `courseHandler` and fix `fetchPublicCourses` to use the new api

* Add `reloadOnScroll` in base course_screen.dart and made the course_screen.dart a grid view

* added video player and many more functionalitites

* removed private

* Added live now, changed view all, changes course model

* warning resolved

* solved continue without

* fix course_cardview

* Update protofile and README

* Add `BooKMarkHandler`and `PinnedHandler` and updated `UserHandler` and `CourseHandler`

* Fetch `userCourses` and `publicCourses` in Overview screen and updated the state management to lavrage riverpod immutable states in `UserStateModel`

* Fetch `userCourses` and `publicCourses` in Overview screen and updated the state management to lavrage riverpod immutable states in `UserStateModel`

* Fix token cleanup in `logout()`

* Enhance UI for CourseOverview with Dynamic Resizing and Styling

* Enhance UI for CourseOverview with Dynamic Resizing and Styling

---------

Co-authored-by: carlobortolan <carlobortolan@gmail.com>
Co-authored-by: ge59dil <anish.goyal@tum.de>

* 107 fix error reload (#108)

* Update protofiles and run `dart fix --apply && dart format ./lib`

* Fix AppError reloading bug and removed redundant code from `user_view_model.dart`

* 112 fix landscape potrait bug (#115)

* added potrait only mode in main()

* solved potrait for mobile only

* solved main() file

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 116 fix teamid and bundel when running xcode (#117)

* Fix `DEVELOPMENT_TEAM` in Xcode

* Add `project.pbxproj` to `.gitignore`

* fix `padding` for buttons, `internal link` UI (#118)

* 122-fix-padding-on-downloads-view (#123)

Adjust padding size of video card and title on Downloads view

* 97 add pin/unpin functionality to pinned view (#127)

* Adjust card view and padding on Pinned Courses

* Add pin/unpin functionality to Pinned Courses View

* Replace course details with a Course object

* Remove reload button on Pinned Courses View

* Fix Pinned Courses file names and directory structure

* 103 add-streaminghandler-and-settingshandler (#128)

* Add `stream_handler.dart`

* Remove optional values from fetch methods

* fix linting

* 109 move-token-removal-to-the-tokenhandler (#132)

Move `deleteToken('jwt')` to 'TokenHandler'

* 131 resolve-reloading-issue-on-pinned-courses-view (#133)

* Fix Reloading Issue on Pinned Courses View

* Fix bug courses disappear when reloading the page

* Remove dead code on pinned course view

* Remove unnecessary code from pinned course list

* 124 create-a-search-and-filter-button (#147)

* Add custom search navigation bar components with filter and back icons

* Remove unused library on Pinned Courses Base View

* 75 implement a video view UI  (#144)

* Remove `TouchIndicator` from app

* Add `MockData` for development purposes

* Add `OrientationManager` To manage orientations

* Extend `UserState` with `downloadedCourses`

* Remove `OrientationManager`

* Add `VideoPlayerControllerManager`, `VideoSourceType`, `VidePlayerPage`

* Rename `mockData` to `mock_data`

* Fix `WelcomeScreen` layout when in portrait mode

* Add `ChatView` sample, for videoPage usage

* Fix linting

* Add `StreamState` and `StreamViewModel` for proper stream and video handling

* Fix VideoOrientation in Fullscreen

* Fix `CustomSearchTopNavBar` UI

* Style notifications screen (#135)

* Style notifications screen

* Create notification_handler

for BannerAlerts and FeatureNotifications

* Add featureNotification to user_state_model

TODO: still bannerAlert

* Add bannerAlerts to user_state_model

* Add default notification views

* Fix linting, correct comments

* Add trailing commas to api_v2

according to previous linting error

* Remove unused inport

to fix linting

* Update protofiles, run `dart fix --apply && dart format`  and clean up imports

* Run `dart fix --apply && dart format ./lib`

* Update model_generator fields and fix fetching of notifications

* Fix formatting

* Update mock_data with newest proto messages

---------

Co-authored-by: carlobortolan <carlobortolan@gmail.com>
Co-authored-by: Carlo Bortolan <106114526+carlobortolan@users.noreply.github.com>

* 106 - Removing the back-arrow in course_overview_screen (#154)

solved the back arrow bug

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 105 fix navigation system problems (#156)

* solving navigation

* corrected the navigation re rendering issue

* solved the navigation and added indexed stack

* solved the issue

* removed unecessary comments

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 157 bug-header-is-missing-on-pinned-courses (#158)

Fix bug in custom search nav bar on Pinned Courses View

* 160-fix-info-text-on-pinned-courses (#165)

* Fix alignment info text on when the pinned course is empty

* Fix padding Pinned Course Card on pinned course view

* 145-Bug-Internal-login-infinite-loop-for-loading (#166)

added a timeout so it does not take so long

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 136 implement course view (#164)

* place Holder for the course view and handler

* correct course detail view (no thumbnail), id = 1

* handler for the thumbnails stream or vod

* searchbar and return bottom

* title set as the name of the course

* use stream view model instead of user state model

* fallback image updated

* streams fetched according to the courseId

* streams fetched according to the courseId

* taking the comments out

* fixing pubspec change

* fixing padding, and new nav bar, deleting useless classes

* fix back button bug, fix import statements,  documentation

* 168-[Bug]-Fix-expanded-exception (#169)

Remove Expanded from Navigation Tab

to eliminate exception

* #102-Improve-My-courses-and-public-courses-view-UI (#161)

* Style course card

- update live tag
- display tum id instead of slug
- remove blue background
- correct corners
- display most of course title

* Add null check for color

* Re-correct course screen title

Back to the original 'gocast'

---------

Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>

* 126-fetch-lecture-streams (#155)

* Fetch stream in PinnedView

* Code cleanup after merges

* linting fixes

* fetching lectures in course details view

* fix pinned_card title display

* Added `fetchProgress`, `putProgress`, and `markAsWatched` methods to `StreamHandler`

* fix video fetching to fetch exactly the clicked video

* Add `CompletionListener` and `ProgressListener` to update video state

* Moved `determineSourceType`

* handle case progress isn´t in the DB

* Add switching betwwen `playlistUrl`, `playlistUrlCAM` and `playlistUrlPRES`

* fix linting

* small loading time optimisation

* small loading time optimisation

* Fix ChewieController disposal issue and enhance state management

* Add check to display only available Playlists

* Add `Split view Icon`

* 146-dark-mode-in-settings (#173)

* some more changes for dark mode, added _loadtheme preference

* added more theme instead of basic hardcoded color

* solved linting, amde some more modifications for dark mode

* added theme for back arrow in custom search top navbar

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 167 unify cards (#175)

* break down cards into function, create unified one

* create inheritance between cards to avoid repetition

* avoid repetition in header

* renaming bigCard, renaming course_card.dart, moving the cards to the right folder

* rename to base_card

* 48-fetch-users-settings (#176)

* Add Settings Handler file

* Add update user settings method on User View Model

* Add Fetch and Update Settings on User View Model

* Fix update settings function on user view model

* 184 pin course in detail course view (#185)

* add a pin button next to the title

* put pin button in sparate class to avoid repetition

* use theme

* 163-revise-ipad-settings-UI (#174)

* Hamburger Settings Menu First Draft

- todo: refactor code, make it reusable
- test on more devices

* Refactor new tablet settings code into old

- delete new views and add conditionals to reuse old ones

* Reuse baseView

* Add return for phone view

and extract settings list code

* Remove debug print statement

---------

Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>

* Implemented dark mode for course cards (#199)

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 195 implement theme colors for option menu in video player (#198)

* added theme

* solved

* removed unused variable

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 140-implement-user-settings-view-UI (#180)

* Add Edit Profile View on Settings View

* Add playback speed picker and custom playback input on Settings View

* Add Playback Speed Picker View on settings

* Add Custom Playback Speed View on settings

* Add login error dialog card view on settings view

* Add error handler and info text for edit profile screen

* Fix Linting on Edit Profile View

* Fix bug when user selects multiple playback speeds on Settings View

* Display custom playback speeds on playback speed picker list

* Add greeting preferences view

* Fix update function on Edit Profile View

* Add a playback speeds view for playback speed picker and custom speed input

* Fix linting error on settings screen view

* Add load settings function on settings screen view

* Edit and modularize the setting views

* Fix fetching bug on playback speed view

* Add border radius on Custom Playback Speed input cart

* Add theme color on Authentication Error Card View

* Add padding on Playback Speed Picker View

* Add an error text to prevent a negative number from being entered in the Custom Playback Speed View

* Add a limit to the custom playback speed input view

* Add a character limit to the edit profile screen

* Add char limitation on Custom Playback Speed View

* 177 add control bar to video player in fullscreen and basic ChatUI for android and iOS (#200)

* Fix `markedAsWatched` bug being called 3 times

* Add menu to videoPlayer and cleaned the code

* Move `ChatView` to seperate folder

* Add pin course while watching video

* Remove unused code

* Add basic chatUI to make the videoView functional

* update setup_grpc.sh

* Linked the settings playback speeds with the videoPlayer

* fix `updateSelectedSpeeds()`

* fix options not appearing in android

* 207-adjust-the-playback-speed-to-make-one-is-always-be-enabled (#208)

Fix playback speed picker view as one is always be enabled

Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>

* 51 implement download functionality (#187)

* added download func

* implemented download funcitonality

* implement some changes2

* changed fetchdownloads

* changed signing

* added delete functionality

* implemented delete func

* Add download in video control bar

* Adapt download to videoPlayer

* Revert "Add download in video control bar"

This reverts commit 53732f9.

* Add `OfflineVideoPlayerPage`

* Use `OfflineVideoPlayerPage`in the download view

* delete unused code

* added stream downloads ability

* configure downloads UI

* added delete all pop up

* added mock url

* solved pipeline error

* commented the mock url

* Added notification for video downloading and downloaded video and solved the refresh bug

* 80% to 90% comment updated

* added stream name as filename, would add it as placeholder in next PR

* solved the bug with changing state

* .

* Deleted downloadedvideos from stream_view_model.dart

* Solved some more potential bugs

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>
Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>
Co-authored-by: Achraf Labidi <achraf.labidi@tum.de>

* 73 implement push notifications (#172)

* Add firebase cloud messaging service

* Implement `notification_handler.dart` and `notifiation_view_model`

* Update protofiles

* Update push notification handling

* Add `fetchFeaturedNotifications` and `fetchFeaturedNotifications()`

* Fix notificationViewModel and add notification state & pushnotification model

* Added functionality to notification view

* Linting

* Fix duplicate push notification bug

* Reformat files

* Revert "Reformat files"

This reverts commit 292dca4.

* Implement notification view UI

* Upgrade dependencies

* Clean up notification code and add live pushnotification

* Update README.md

---------

Co-authored-by: Achraf Labidi <achraf.labidi@tum.de>

* 85 implement chat functionalities using the api (#209)

* Update proto files

* Add `ChatHandlers`

* `fetch` and `post` chats from the `db`

* fix `clearError()`

* Add `fetchAllCourses()`

* Add `CourseState` and `CourseViewModel`

* Add intl

* Add `SuggestedStreamsWidget`

* Add `isRateLimitReached`, `isCoolDown` and `accessDenied` to `chatState`

* Add suggestions to chatView

* Add `_updateTimer` and `_isCooldownActive`

* Rename `chat_video_view` to `chat_view`

* Add DarkMode support

* Add DarkMode support

* Split chat view and state

* Merge conflicts fix

* fix `ChatState`

* 205-fix-settings-view-in-lanscape-and-fix-updating-settings (#222)

* Fix FocusScopeNode disposal issue in landscape mode on Settings View

* Made the BaseView a Consumer

* lint fix

* Create `SettingState` and `SettingViewModel`

* Rework the Settings updates

* fix the `_showLogoutDialog` using Navigator in async gap

* Add padding to setting view in Landscape mode

* Sort `playBackSpeed` and disabled speed higher than `2.0`

* Name shouldn´t be only empty spaces

* add padding to edit profile view for landscape

* show dialog box to handle error messages on edit profile view

---------

Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>
Co-authored-by: Achraf Labidi <achraf.labidi@tum.de>

* 197 search and filter function (#210)

* search function in detail course

* move initialize thumbnail to initializestreams

* move search bar from pinned_courses_content_view.dart to pinned_courses_view.dart, create searchbar

* move search bar from pinned_courses_content_view.dart to pinned_courses_view.dart, create searchbar

* clean up pin course, create UI for popup menu

* add the functionality of the filter function.

* fix filter in detail course and UI for pinned course filter

* fix filter in pinned course for newest and oldest

* create a popup for semesters, the semesters are fetched

* create a functional semester filter

* add a search and filter bar to my course and public course

* implement functionality of search function in my course and public course

* debug the search function in public course

* implement filter function in public course and my course

* reduce repeated code

* rework the state management

* small bug when you open pinned course after the detail view the filter moves from semester

* using theme color

* solve the pin bug

* disable newest and oldest when a semester is set

* the default for semester is the current semester

* useriverpod to implement fitler and sort in public mycourse and pinned views

* useriverpod to implement fitler and sort in  detail view

* fixing some bug

* fix one wrong function call

* fix wrong fetch in public course

* fix wrong fetches

* fix the semester bug

* fix the bug in detail course view

* fix the bug by the back arrow in pinned view

* Merge branch 'dev' into 197-search-and-filter-function

* change the download view to stateful view. commenting out the buggy code in base view.

* reverting the base view

* Fix double `AppBar` problem

* Fix hamburger menu appearing when search clicked

---------

Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>
Co-authored-by: Achraf Labidi <achraf.labidi@tum.de>

* GIve an option for different camera views (#243)

* Added different camera views download options

* Cleaned code in custom_video_control_bar.dart and added error message as saidd

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* 188-BUG-Dark-Mode (#244)

* bug solved

* solved light mode text not showing

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>

* #134-Create-new-home-design (#237)

* Basic Layout without Thumbnail done

* Display last lecture

TODO: somehow livenow never true (since streams are always empty)

* Add course card styling

- shadow
- correct corners
- outline

* Correct Shadow

* Display term, year in course card

* Add round icon, modify background and constraints

* Fix linting

* Livenow stream functionality

Still TODO: styling

* Add minimal styling

* Remove ViewAll for livecourses

future alternative: add LiveStream page to navigate to

* Styling

of
 -coursetitle and
- lineHeight

* Fix course_card

* Remove old livenow section

* Remove preview for publicCourses

* Add pulsing live

and
- image for mycourses
- viewCount
- roomnumber

todo:
- add redirect for room number
- icons/ colors for courses

removed settings hamburger menu for now

* Add redirect, fix background color

* Add scaling colored line

* Make border compatible with darkmode

* Add color picker

* Call the lastest stream

Problem: somehow this is empty

* Add URL launcher

* Fix linting

* Fix base light blue color on scrolling

* Bare minimum for course list view

* Add location image

* Fix expanded error

* Re-fix location aligning

* Livenow displayed correctly

* Fix linting

* Add navigation to course detail view

* Let livenow container hug content

* Refactor course section

* Refactor course card

* Pass lastLecture as lectureID

* Make lastLecture redirect

* Fix 'Don't use 'BuildContext's across async gaps.'

* Handle unmounted error

* Add null check for fetching lastLecture

Problem: fetching does not return stream correctly (a problem everywhere)

* Add rudimentary differentiation for Tablets

* Fix list view

* Add static progress bar

* Add functionality to progress

* Add stream length and date

* Make compatible with darkmode

* Commit before dev merge

* fix flutter dependencies

* Fix linting

* Avoid possible overflow error

* Fix lauchUrl on ios

* Add padding to downloads and pinns

* Fix padding for ipads

* Clean up comments, ..

- remove comments
- remove TODOS
- resolve error for course placeholder

* Redo merge stuff

* Add settings redirects

* Redo stream parameters

* Fix linting

* Remove thrown error

* Create folder `download_state_model`

* Remove comment

* Add shadow to the `BaseCard`

* Fix `progress` in stream card

---------

Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>
Co-authored-by: Achraf Labidi <achraf.labidi@tum.de>

* Fix the displayed courses state and add swipe gesture to pin-unpin a course (#248)

* Remove `lastStream` in course card

* Use `PopScope` to fix swiping left taking to login screen.

* Change Pinned course to use `CourseCard`

* fix navigation to `public` and `MyCourses`

* fix `RefreshIndicator` in course overview course

* fix `RefreshIndicator` all views

* linting

* fix `livenow` all views

* fix linting

* add `updateDisplayPinnedCourse` fo the pinned view

* Add sliding to pin and upin

* fix the `drawer` appearing when swipping from left in protrait mode.

* Use `DrawerMotion()` in the slide

* Update integer types to be consistent with API

---------

Co-authored-by: carlobortolan <carlobortolan@gmail.com>

* Adding download over wifi func (#242)

* Adding download over wifi func

* download over wifi func

* download func

* added error handing

* rollbacking Info.plist

* Added changes for mobile data.

* solved delete bug

* solved error

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>
Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>

* 221 create quiz (#251)

* update protofiles

* add poll handler, state model, view model

* create placeholder for poll, separate the inactive overlay from chat view

* clean the unused parameters

* update protofile, convert int64 to int

* fix the trailing comma

* fix the trailing comma

* Fix Bugs and clean logs (#255)

* Fix multiple errors when wrong credentials.

* Clean log and double error throwing

* change `CircleLoading` to `gray send button` when cooldown is active in chat

* Made `PinState` seperated

* fix `grpcCalls` with empty token

* fix `fetchSemester` in public courses

* Fix continue without and other bugs (#256)

* use enum for section kind

* fix the no live stream bug

* separate course section and live stream section

* separate course card and small stream card

* reduce logged in

* fetch live now thumbnails

* fetch live now thumbnails

* fetch live now thumbnails

* Disable pinning when user not logged in and add token check (#258)

* 225 Add course name on downloads card UI (#246)

* Added video name and duration

* Adding description in video details

* added a dialog box for deletion

* Add swipe t delete too `DownloadCard`

* Add swipe t delete too `DownloadCard`

---------

Co-authored-by: ge59dil <anish.goyal@tum.de>
Co-authored-by: Achraf Labidi <achraf.labidi@tum.de>
Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>

* Bug chat state not updating and add internationalization (#262)

---------

Co-authored-by: Anishyou <123313052+Anishyou@users.noreply.github.com>
Co-authored-by: ge59dil <anish.goyal@tum.de>
Co-authored-by: Jakob Körber <56073945+jakobkoerber@users.noreply.github.com>
Co-authored-by: Achraf Labidi <101757413+GravityDarkLab@users.noreply.github.com>
Co-authored-by: Saina Amiri <90347142+Sainaamr@users.noreply.github.com>
Co-authored-by: betül çimendağ <betul.cimendag@tum.de>
Co-authored-by: Milena Rode-Kotzé <84514915+milenark@users.noreply.github.com>
Co-authored-by: Achraf Labidi <achraf.labidi@tum.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User Authentication
3 participants