diff --git a/.env b/.env deleted file mode 100644 index b85f7c1b..00000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -KEY="Enter KEY Here"; \ No newline at end of file diff --git a/.env.dev b/.env.dev new file mode 100644 index 00000000..47421656 --- /dev/null +++ b/.env.dev @@ -0,0 +1 @@ +KEY="Tolm_fRDkfoN5WMU4oUXWxNwmn1E0MmYlbeh1LA29cU="; \ No newline at end of file diff --git a/.gitignore b/.gitignore index 457b3325..2aa0acc4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ .history .svn/ *.env +.env .fvm # IntelliJ related *.iml diff --git a/android/app/build.gradle b/android/app/build.gradle index 35ae2301..a9b024ed 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -31,7 +31,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" // } android { - compileSdkVersion 32 + compileSdkVersion 34 ndkVersion "26.1.10909125" lintOptions { @@ -93,8 +93,8 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' implementation 'com.google.firebase:firebase-core:16.0.1' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.9' - compile 'com.squareup.retrofit2:retrofit:2.3.0' - compile 'com.squareup.retrofit2:converter-gson:2.3.0' + implementation 'com.squareup.retrofit2:retrofit:2.3.0' + implementation 'com.squareup.retrofit2:converter-gson:2.3.0' // implementation "androidx.work:work-runtime-ktx:2.7.0" } diff --git a/android/build.gradle b/android/build.gradle index b50b6a7c..d2ca44c2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,7 +2,7 @@ buildscript { ext { ndkVersion = "26.1.10909125" } - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.8.22' repositories { google() jcenter() @@ -11,7 +11,7 @@ buildscript { dependencies { classpath 'com.google.gms:google-services:4.3.0' - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.3.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cfe88f69..302da314 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip \ No newline at end of file diff --git a/assets/login/login.html b/assets/login/login.html index bfe6b7d8..be94178d 100644 --- a/assets/login/login.html +++ b/assets/login/login.html @@ -131,9 +131,9 @@ id="loginLink" onclick="showLoading()" href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=vR1pU7wXWyve1rUkg0fMS6StL1Kr6paoSmRIiLXJ&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html" - > - + > + LOG IN VIA SSO diff --git a/assets/login/login_dark.html b/assets/login/login_dark.html index 4371899d..0a3df2e1 100644 --- a/assets/login/login_dark.html +++ b/assets/login/login_dark.html @@ -134,10 +134,10 @@ class="login" onclick="showLoading()" href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=vR1pU7wXWyve1rUkg0fMS6StL1Kr6paoSmRIiLXJ&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html" - > + > - + LOG IN VIA SSO
diff --git a/ios/Podfile b/ios/Podfile index 469e02f8..f0009271 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -39,6 +39,12 @@ post_install do |installer| flutter_additional_ios_build_settings(target) end + ################ Awesome Notifications pod modification ################### + awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks') + require awesome_pod_file + update_awesome_pod_build_settings(installer) + ################ Awesome Notifications pod modification ################### + installer.generated_projects.each do |project| project.targets.each do |target| target.build_configurations.each do |config| @@ -47,3 +53,9 @@ post_install do |installer| end end end + +################ Awesome Notifications pod modification ################### +awesome_pod_file = File.expand_path(File.join('plugins', 'awesome_notifications', 'ios', 'Scripts', 'AwesomePodFile'), '.symlinks') +require awesome_pod_file +update_awesome_main_target_settings('Runner', File.dirname(File.realpath(__FILE__)), flutter_root) +################ Awesome Notifications pod modification ################### diff --git a/lib/generated_plugin_registrant.dart b/lib/generated_plugin_registrant.dart deleted file mode 100644 index aba977a9..00000000 --- a/lib/generated_plugin_registrant.dart +++ /dev/null @@ -1,38 +0,0 @@ -// -// Generated file. Do not edit. -// - -// ignore_for_file: directives_ordering -// ignore_for_file: lines_longer_than_80_chars - -import 'package:camera_web/camera_web.dart'; -import 'package:device_info_plus_web/device_info_plus_web.dart'; -import 'package:firebase_core_web/firebase_core_web.dart'; -import 'package:firebase_messaging_web/firebase_messaging_web.dart'; -import 'package:flutter_keyboard_visibility_web/flutter_keyboard_visibility_web.dart'; -import 'package:flutter_native_timezone/flutter_native_timezone_web.dart'; -import 'package:image_picker_for_web/image_picker_for_web.dart'; -import 'package:location_web/location_web.dart'; -import 'package:package_info_plus_web/package_info_plus_web.dart'; -import 'package:shared_preferences_web/shared_preferences_web.dart'; -import 'package:uni_links_web/uni_links_web.dart'; -import 'package:url_launcher_web/url_launcher_web.dart'; - -import 'package:flutter_web_plugins/flutter_web_plugins.dart'; - -// ignore: public_member_api_docs -void registerPlugins(Registrar registrar) { - CameraPlugin.registerWith(registrar); - DeviceInfoPlusPlugin.registerWith(registrar); - FirebaseCoreWeb.registerWith(registrar); - FirebaseMessagingWeb.registerWith(registrar); - FlutterKeyboardVisibilityPlugin.registerWith(registrar); - FlutterNativeTimezonePlugin.registerWith(registrar); - ImagePickerPlugin.registerWith(registrar); - LocationWebPlugin.registerWith(registrar); - PackageInfoPlugin.registerWith(registrar); - SharedPreferencesPlugin.registerWith(registrar); - UniLinksPlugin.registerWith(registrar); - UrlLauncherPlugin.registerWith(registrar); - registrar.registerMessageHandler(); -} diff --git a/lib/main.dart b/lib/main.dart index 60973a7f..3e706bb2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -113,13 +113,13 @@ class MyAppState extends State with WidgetsBindingObserver { initAppLinksState(); } - WidgetsBinding.instance?.addObserver(this); + WidgetsBinding.instance.addObserver(this); } @override void dispose() async { _appLinksSub.cancel(); - WidgetsBinding.instance?.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); disposeNotification(); super.dispose(); } @@ -163,13 +163,10 @@ class MyAppState extends State with WidgetsBindingObserver { primaryContainer: widget.bloc.primaryColor[200], secondaryContainer: widget.bloc.accentColor[200], brightness: widget.bloc.brightness.toBrightness(), - onBackground: widget.bloc.brightness == AppBrightness.light - ? Colors.black - : Colors.white, surface: widget.bloc.brightness == AppBrightness.light ? Colors.white : widget.bloc.brightness.toColor(), - surfaceVariant: widget.bloc.brightness == AppBrightness.light + surfaceContainerHighest: widget.bloc.brightness == AppBrightness.light ? Color(0xFFE8ECF2) : Color(0xFF121212), onSurface: widget.bloc.brightness == AppBrightness.light @@ -184,38 +181,57 @@ class MyAppState extends State with WidgetsBindingObserver { ), primarySwatch: Colors.primaries.firstWhereOrNull( (c) => c.value == widget.bloc.accentColor.value), - - toggleableActiveColor: widget.bloc.accentColor, textSelectionTheme: TextSelectionThemeData(selectionColor: widget.bloc.accentColor), canvasColor: widget.bloc.brightness.toColor(), - - bottomAppBarColor: widget.bloc.primaryColor, brightness: widget.bloc.brightness.toBrightness(), textTheme: TextTheme( - headline4: TextStyle( + headlineMedium: TextStyle( color: widget.bloc.brightness == AppBrightness.light ? Colors.black : Colors.white, ), - headline3: TextStyle( + displaySmall: TextStyle( color: widget.bloc.brightness == AppBrightness.light ? Colors.black : Colors.white, ), - headline2: TextStyle( + displayMedium: TextStyle( color: widget.bloc.brightness == AppBrightness.light ? Colors.black : Colors.white, ), - headline1: TextStyle( + displayLarge: TextStyle( color: widget.bloc.brightness == AppBrightness.light ? Colors.black : Colors.white, ), - headline5: TextStyle()), + headlineSmall: TextStyle()), checkboxTheme: CheckboxThemeData( + fillColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } + if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } + return null; + }), + ), radioTheme: RadioThemeData( + fillColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } + if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } + return null; + }), + ), switchTheme: SwitchThemeData( + thumbColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } + if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } + return null; + }), + trackColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return null; } + if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; } + return null; + }), + ), bottomAppBarTheme: BottomAppBarTheme(color: widget.bloc.primaryColor), ), onGenerateRoute: (RouteSettings settings) { // print(settings.name); diff --git a/lib/src/api/apiclient.dart b/lib/src/api/apiclient.dart index ed5a2fe9..b19f8583 100644 --- a/lib/src/api/apiclient.dart +++ b/lib/src/api/apiclient.dart @@ -46,7 +46,7 @@ import 'model/offersecret.dart'; part 'apiclient.g.dart'; // @rt.RestApi(baseUrl: "http://127.0.0.1:8000/api") -// @rt.RestApi(baseUrl: "http://10.105.177.150/api") +// @rt.RestApi(baseUrl: "http://10.198.49.150/api") @rt.RestApi(baseUrl: "https://gymkhana.iitb.ac.in/instiapp/api") // @rt.RestApi(baseUrl: "https://dcae-2405-201-5004-30e9-a45d-9897-ea81-3414.ngrok-free.app/api") abstract class InstiAppApi { diff --git a/lib/src/api/apiclient.g.dart b/lib/src/api/apiclient.g.dart index a74f2b7d..a21985ed 100644 --- a/lib/src/api/apiclient.g.dart +++ b/lib/src/api/apiclient.g.dart @@ -6,9 +6,15 @@ part of 'apiclient.dart'; // RetrofitGenerator // ************************************************************************** +// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers + class _InstiAppApi implements InstiAppApi { - _InstiAppApi(this._dio, {this.baseUrl}) { + _InstiAppApi( + this._dio, { + this.baseUrl, + }) { baseUrl ??= 'https://gymkhana.iitb.ac.in/instiapp/api'; + // baseUrl ??= 'http://10.198.49.150/api'; } final Dio _dio; @@ -20,13 +26,24 @@ class _InstiAppApi implements InstiAppApi { const _extra = {}; final queryParameters = {}; final _headers = {}; - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/mess', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/mess', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Hostel.fromJson(i as Map)) .toList(); @@ -34,126 +51,226 @@ class _InstiAppApi implements InstiAppApi { } @override - Future passwordLogin(username, password) async { + Future passwordLogin( + String username, + String password, + ) async { const _extra = {}; final queryParameters = { r'username': username, - r'password': password + r'password': password, }; final _headers = {}; - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/pass-login', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/pass-login', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Session.fromJson(_result.data!); return value; } @override - Future passwordLoginFcm(username, password, fcmId) async { + Future passwordLoginFcm( + String username, + String password, + String fcmId, + ) async { const _extra = {}; final queryParameters = { r'username': username, r'password': password, - r'fcm_id': fcmId + r'fcm_id': fcmId, }; final _headers = {}; - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/pass-login', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/pass-login', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Session.fromJson(_result.data!); return value; } @override - Future login(code, redir) async { + Future login( + String code, + String redir, + ) async { const _extra = {}; - final queryParameters = {r'code': code, r'redir': redir}; + final queryParameters = { + r'code': code, + r'redir': redir, + }; final _headers = {}; - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/login', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/login', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Session.fromJson(_result.data!); return value; } @override - Future AlumniLogin(ldap) async { + Future AlumniLogin(String ldap) async { const _extra = {}; final queryParameters = {r'ldap': ldap}; final _headers = {}; - final _data = {}; + final Map? _data = null; final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/alumniLogin', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/alumniLogin', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = AlumniLoginResponse.fromJson(_result.data!); return value; } @override - Future AlumniOTP(ldap, otp) async { + Future AlumniOTP( + String ldap, + String otp, + ) async { const _extra = {}; - final queryParameters = {r'ldap': ldap, r'otp': otp}; + final queryParameters = { + r'ldap': ldap, + r'otp': otp, + }; final _headers = {}; - final _data = {}; + final Map? _data = null; final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/alumniOTP', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/alumniOTP', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = AlumniLoginResponse.fromJson(_result.data!); return value; } @override - Future ResendAlumniOTP(ldap) async { + Future ResendAlumniOTP(String ldap) async { const _extra = {}; final queryParameters = {r'ldap': ldap}; final _headers = {}; - final _data = {}; + final Map? _data = null; final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/resendAlumniOTP', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/resendAlumniOTP', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = AlumniLoginResponse.fromJson(_result.data!); return value; } @override Future> getPlacementBlogFeed( - sessionId, from, number, query) async { + String sessionId, + int from, + int number, + String query, + ) async { const _extra = {}; final queryParameters = { r'from': from, r'num': number, - r'query': query + r'query': query, }; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/placement-blog', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/placement-blog', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => PlacementBlogPost.fromJson(i as Map)) @@ -163,22 +280,37 @@ class _InstiAppApi implements InstiAppApi { @override Future> getExternalBlogFeed( - sessionId, from, number, query) async { + String sessionId, + int from, + int number, + String query, + ) async { const _extra = {}; final queryParameters = { r'from': from, r'num': number, - r'query': query + r'query': query, }; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/external-blog', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/external-blog', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map( (dynamic i) => ExternalBlogPost.fromJson(i as Map)) @@ -188,22 +320,37 @@ class _InstiAppApi implements InstiAppApi { @override Future> getTrainingBlogFeed( - sessionID, from, num, query) async { + String sessionID, + int from, + int num, + String query, + ) async { const _extra = {}; final queryParameters = { r'from': from, r'num': num, - r'query': query + r'query': query, }; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/training-blog', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/training-blog', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map( (dynamic i) => TrainingBlogPost.fromJson(i as Map)) @@ -212,24 +359,42 @@ class _InstiAppApi implements InstiAppApi { } @override - Future getEvent(sessionId, uuid) async { + Future getEvent( + String sessionId, + String uuid, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/events/${uuid}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events/${uuid}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Event.fromJson(_result.data!); return value; } @override - Future updateEvent(sessionId, event, uuid) async { + Future updateEvent( + String sessionId, + EventCreateRequest event, + String uuid, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; @@ -237,18 +402,31 @@ class _InstiAppApi implements InstiAppApi { final _data = {}; _data.addAll(event.toJson()); final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/events/${uuid}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events/${uuid}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = EventCreateResponse.fromJson(_result.data!); return value; } @override Future postEventForm( - sessionId, eventCreateRequest) async { + String sessionId, + EventCreateRequest eventCreateRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; @@ -256,108 +434,204 @@ class _InstiAppApi implements InstiAppApi { final _data = {}; _data.addAll(eventCreateRequest.toJson()); final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/events', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = EventCreateResponse.fromJson(_result.data!); return value; } @override - Future deleteEvent(sessionId, uuid) async { + Future deleteEvent( + String sessionId, + String uuid, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'DELETE', headers: _headers, extra: _extra) - .compose(_dio.options, '/events/${uuid}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future pushMail(sessionId, uuid) async { + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'DELETE', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events/${uuid}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future pushMail( + String sessionId, + String uuid, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/events/${uuid}/approve-mail', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future rejectMail(sessionId, uuid) async { + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events/${uuid}/approve-mail', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future rejectMail( + String sessionId, + String uuid, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/events/${uuid}/reject-mail', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events/${uuid}/reject-mail', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); } @override - Future getNewsFeed(sessionId) async { + Future getNewsFeed(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/events', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = NewsFeedResponse.fromJson(_result.data!); return value; } @override - Future getEventsBetweenDates(sessionId, start, end) async { + Future getEventsBetweenDates( + String sessionId, + String start, + String end, + ) async { const _extra = {}; - final queryParameters = {r'start': start, r'end': end}; + final queryParameters = { + r'start': start, + r'end': end, + }; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/events', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = NewsFeedResponse.fromJson(_result.data!); return value; } @override Future> getMessEventsBetweenDates( - sessionId, start, end) async { + String sessionId, + String start, + String end, + ) async { const _extra = {}; - final queryParameters = {r'start': start, r'end': end}; + final queryParameters = { + r'start': start, + r'end': end, + }; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/getUserMess', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/getUserMess', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => MessCalEvent.fromJson(i as Map)) .toList(); @@ -365,24 +639,38 @@ class _InstiAppApi implements InstiAppApi { } @override - Future getEncr(sessionId) async { + Future getEncr(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/getEncr', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/getEncr', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = GetEncrResponse.fromJson(_result.data!); return value; } @override - Future createEvent(sessionId, eventCreateRequest) async { + Future createEvent( + String sessionId, + EventCreateRequest eventCreateRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; @@ -390,11 +678,23 @@ class _InstiAppApi implements InstiAppApi { final _data = {}; _data.addAll(eventCreateRequest.toJson()); final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/events', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/events', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + print(_result.data); final value = EventCreateResponse.fromJson(_result.data!); return value; } @@ -404,12 +704,24 @@ class _InstiAppApi implements InstiAppApi { const _extra = {}; final queryParameters = {}; final _headers = {}; - final _data = {}; - final _result = await _dio.fetch>(_setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/locations', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/locations', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Venue.fromJson(i as Map)) .toList(); @@ -417,16 +729,28 @@ class _InstiAppApi implements InstiAppApi { } @override - Future> getVenue(id) async { + Future> getVenue(String id) async { const _extra = {}; final queryParameters = {}; final _headers = {}; - final _data = {}; - final _result = await _dio.fetch>(_setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/locations/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/locations/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Venue.fromJson(i as Map)) .toList(); @@ -434,49 +758,91 @@ class _InstiAppApi implements InstiAppApi { } @override - Future getUser(sessionId, uuid) async { + Future getUser( + String sessionId, + String uuid, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/users/${uuid}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/users/${uuid}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = User.fromJson(_result.data!); return value; } @override - Future getBody(sessionId, uuid) async { + Future getBody( + String sessionId, + String uuid, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/bodies/${uuid}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/bodies/${uuid}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Body.fromJson(_result.data!); return value; } @override - Future> getAllBodies(sessionId) async { + Future> getAllBodies(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>(_setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/bodies', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/bodies', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Body.fromJson(i as Map)) .toList(); @@ -484,157 +850,285 @@ class _InstiAppApi implements InstiAppApi { } @override - Future updateBodyFollowing(sessionID, eventID, action) async { + Future updateBodyFollowing( + String sessionID, + String eventID, + int action, + ) async { const _extra = {}; final queryParameters = {r'action': action}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/bodies/${eventID}/follow', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future uploadImage(sessionID, picture) async { + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/bodies/${eventID}/follow', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future uploadImage( + String sessionID, + File picture, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); final _data = FormData(); _data.files.add(MapEntry( - 'picture', - MultipartFile.fromFileSync(picture.path, - filename: picture.path.split(Platform.pathSeparator).last))); + 'picture', + MultipartFile.fromFileSync( + picture.path, + filename: picture.path.split(Platform.pathSeparator).last, + ), + )); final _result = await _dio.fetch>( _setStreamType(Options( - method: 'POST', - headers: _headers, - extra: _extra, - contentType: 'multipart/form-data') - .compose(_dio.options, '/upload', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + method: 'POST', + headers: _headers, + extra: _extra, + contentType: 'multipart/form-data', + ) + .compose( + _dio.options, + '/upload', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = ImageUploadResponse.fromJson(_result.data!); return value; } @override - Future getUserMe(sessionID) async { + Future getUserMe(String sessionID) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-me', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-me', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = User.fromJson(_result.data!); return value; } @override - Future updateUserEventStatus(sessionID, eventID, status) async { + Future updateUserEventStatus( + String sessionID, + String eventID, + int status, + ) async { const _extra = {}; final queryParameters = {r'status': status}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-me/ues/${eventID}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future updateUserNewsReaction(sessionID, postID, reaction) async { + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-me/ues/${eventID}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future updateUserNewsReaction( + String sessionID, + String postID, + int reaction, + ) async { const _extra = {}; final queryParameters = {r'reaction': reaction}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-me/unr/${postID}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future updateUserChatBotReaction(sessionID, chatBotLogRequest) async { + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-me/unr/${postID}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future updateUserChatBotReaction( + String sessionID, + ChatBotLogRequest chatBotLogRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(chatBotLogRequest.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-me/ucr/', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future patchFCMUserMe(sessionID, userFCMPatchRequest) async { + await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-me/ucr/', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future patchFCMUserMe( + String sessionID, + UserFCMPatchRequest userFCMPatchRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(userFCMPatchRequest.toJson()); - final _result = await _dio.fetch>(_setStreamType( - Options(method: 'PATCH', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-me', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'PATCH', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-me', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = User.fromJson(_result.data!); return value; } @override - Future patchSCNUserMe(sessionID, userSCNPatchRequest) async { + Future patchSCNUserMe( + String sessionID, + UserSCNPatchRequest userSCNPatchRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(userSCNPatchRequest.toJson()); - final _result = await _dio.fetch>(_setStreamType( - Options(method: 'PATCH', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-me', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'PATCH', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-me', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = User.fromJson(_result.data!); return value; } @override - Future> getNews(sessionID, from, num, query) async { + Future> getNews( + String sessionID, + int from, + int num, + String query, + ) async { const _extra = {}; final queryParameters = { r'from': from, r'num': num, - r'query': query + r'query': query, }; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/news', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/news', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => NewsArticle.fromJson(i as Map)) .toList(); @@ -642,18 +1136,29 @@ class _InstiAppApi implements InstiAppApi { } @override - Future> getNotifications(sessionID) async { + Future> getNotifications(String sessionID) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/notifications', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/notifications', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Notification.fromJson(i as Map)) .toList(); @@ -661,102 +1166,182 @@ class _InstiAppApi implements InstiAppApi { } @override - Future markNotificationRead(sessionID, notificationID) async { + Future markNotificationRead( + String sessionID, + String notificationID, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/notifications/read/${notificationID}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/notifications/read/${notificationID}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); } @override - Future markAllNotificationsRead(sessionID) async { + Future markAllNotificationsRead(String sessionID) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/notifications/read', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/notifications/read', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); } @override - Future logout(sessionID) async { + Future logout(String sessionID) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/logout', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future search(sessionID, query) async { + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/logout', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future search( + String sessionID, + String query, + ) async { const _extra = {}; final queryParameters = {r'query': query}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/search', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/search', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = ExploreResponse.fromJson(_result.data!); return value; } @override - Future searchType(sessionID, query, type) async { + Future searchType( + String sessionID, + String query, + String type, + ) async { const _extra = {}; - final queryParameters = {r'query': query, r'types': type}; + final queryParameters = { + r'query': query, + r'types': type, + }; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/search', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/search', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = ExploreResponse.fromJson(_result.data!); return value; } @override Future> getAllComplaints( - sessionId, from, number, query) async { + String sessionId, + int from, + int number, + String query, + ) async { const _extra = {}; final queryParameters = { r'from': from, r'num': number, - r'search': query + r'search': query, }; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/venter/complaints', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/complaints', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Complaint.fromJson(i as Map)) .toList(); @@ -764,18 +1349,29 @@ class _InstiAppApi implements InstiAppApi { } @override - Future> getUserComplaints(sessionId) async { + Future> getUserComplaints(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/venter/complaints?filter=me', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/complaints?filter=me', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Complaint.fromJson(i as Map)) .toList(); @@ -783,143 +1379,250 @@ class _InstiAppApi implements InstiAppApi { } @override - Future getComplaint(sessionId, complaintId) async { + Future getComplaint( + String sessionId, + String complaintId, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/venter/complaints/${complaintId}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/complaints/${complaintId}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Complaint.fromJson(_result.data!); return value; } @override - Future upVote(sessionId, complaintId, count) async { + Future upVote( + String sessionId, + String complaintId, + int count, + ) async { const _extra = {}; final queryParameters = {r'action': count}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose( - _dio.options, '/venter/complaints/${complaintId}/upvote', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/complaints/${complaintId}/upvote', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Complaint.fromJson(_result.data!); return value; } @override - Future subscribleToComplaint(sessionId, complaintId, count) async { + Future subscribleToComplaint( + String sessionId, + String complaintId, + int count, + ) async { const _extra = {}; final queryParameters = {r'action': count}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose( - _dio.options, '/venter/complaints/${complaintId}/subscribe', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/complaints/${complaintId}/subscribe', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Complaint.fromJson(_result.data!); return value; } @override - Future postComplaint(sessionId, complaintCreateRequest) async { + Future postComplaint( + String sessionId, + ComplaintCreateRequest complaintCreateRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(complaintCreateRequest.toJson()); - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/venter/complaints', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/complaints', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Complaint.fromJson(_result.data!); return value; } @override Future postComment( - sessionId, complaintId, commentCreateRequest) async { + String sessionId, + String complaintId, + CommentCreateRequest commentCreateRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(commentCreateRequest.toJson()); - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose( - _dio.options, '/venter/complaints/${complaintId}/comments', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/complaints/${complaintId}/comments', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Comment.fromJson(_result.data!); return value; } @override Future updateComment( - sessionId, commentId, commentCreateRequest) async { + String sessionId, + String commentId, + CommentCreateRequest commentCreateRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(commentCreateRequest.toJson()); - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/venter/comments/${commentId}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = + await _dio.fetch>(_setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/comments/${commentId}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Comment.fromJson(_result.data!); return value; } @override - Future deleteComment(sessionId, commentId) async { + Future deleteComment( + String sessionId, + String commentId, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'DELETE', headers: _headers, extra: _extra) - .compose(_dio.options, '/venter/comments/${commentId}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'DELETE', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/comments/${commentId}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); } @override - Future> getAllTags(sessionId) async { + Future> getAllTags(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/venter/tags', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/venter/tags', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => TagUri.fromJson(i as Map)) .toList(); @@ -928,7 +1631,9 @@ class _InstiAppApi implements InstiAppApi { @override Future postForm( - sessionId, achievementCreateRequest) async { + String sessionId, + AchievementCreateRequest achievementCreateRequest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; @@ -936,98 +1641,178 @@ class _InstiAppApi implements InstiAppApi { final _data = {}; _data.addAll(achievementCreateRequest.toJson()); final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = AchievementCreateResponse.fromJson(_result.data!); return value; } @override - Future updateAchievement(sessionId, offeredAchievements, id) async { + Future updateAchievement( + String sessionId, + OfferedAchievements offeredAchievements, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(offeredAchievements.toJson()); - final _result = await _dio.fetch(_setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements-offer/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = await _dio.fetch(_setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements-offer/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = _result.data; return value; } @override - Future postAchievementOffer(sessionId, id, secret) async { + Future postAchievementOffer( + String sessionId, + String id, + Offersecret secret, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(secret.toJson()); - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements-offer/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements-offer/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = SecretResponse.fromJson(_result.data!); return value; } @override - Future postInterests(sessionId, interest) async { + Future postInterests( + String sessionId, + Interest interest, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(interest.toJson()); - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/interests', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/interests', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = SecretResponse.fromJson(_result.data!); return value; } @override - Future postDelInterests(sessionId, title) async { + Future postDelInterests( + String sessionId, + String title, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'DELETE', headers: _headers, extra: _extra) - .compose(_dio.options, '/interests/${title}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'DELETE', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/interests/${title}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = SecretResponse.fromJson(_result.data!); return value; } @override - Future> getYourAchievements(sessionId) async { + Future> getYourAchievements(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Achievement.fromJson(i as Map)) .toList(); @@ -1035,34 +1820,62 @@ class _InstiAppApi implements InstiAppApi { } @override - Future toggleHidden(sessionID, id, hidden) async { + Future toggleHidden( + String sessionID, + String id, + AchievementHiddenPathRequest hidden, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(hidden.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'PATCH', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future> getBodyAchievements(sessionId, id) async { + await _dio.fetch(_setStreamType(Options( + method: 'PATCH', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future> getBodyAchievements( + String sessionId, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements-body/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements-body/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Achievement.fromJson(i as Map)) .toList(); @@ -1070,7 +1883,11 @@ class _InstiAppApi implements InstiAppApi { } @override - Future dismissAchievement(sessionID, id, achievement) async { + Future dismissAchievement( + String? sessionID, + String? id, + AchVerifyRequest achievement, + ) async { const _extra = {}; final queryParameters = {}; queryParameters.removeWhere((k, v) => v == null); @@ -1078,44 +1895,83 @@ class _InstiAppApi implements InstiAppApi { _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(achievement.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future deleteAchievement(sessionID, id) async { + await _dio.fetch(_setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future deleteAchievement( + String sessionID, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'DELETE', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements-offer/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future> getQueries(sessionID, query, category) async { + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'DELETE', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements-offer/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future> getQueries( + String sessionID, + String query, + String category, + ) async { const _extra = {}; final queryParameters = { r'query': query, - r'category': category + r'category': category, }; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>(_setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/query', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/query', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Query.fromJson(i as Map)) .toList(); @@ -1123,51 +1979,86 @@ class _InstiAppApi implements InstiAppApi { } @override - Future postFAQ(sessionId, request) async { + Future postFAQ( + String sessionId, + PostFAQRequest request, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(request.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/query/add', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future> getQueryCategories(sessionId) async { + await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/query/add', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future> getQueryCategories(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/query/categories', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/query/categories', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = _result.data!.cast(); return value; } @override - Future> getCommunities(sessionId) async { + Future> getCommunities(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/communities', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = + await _dio.fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communities', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => Community.fromJson(i as Map)) .toList(); @@ -1175,155 +2066,278 @@ class _InstiAppApi implements InstiAppApi { } @override - Future getCommunity(sessionId, id) async { + Future getCommunity( + String sessionId, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/communities/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communities/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = Community.fromJson(_result.data!); return value; } @override Future getCommunityPosts( - sessionId, status, query, id) async { + String sessionId, + int? status, + String query, + String id, + ) async { const _extra = {}; final queryParameters = { r'status': status, r'query': query, - r'community': id + r'community': id, }; queryParameters.removeWhere((k, v) => v == null); final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; + final Map? _data = null; final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/communityposts', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communityposts', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = CommunityPostListResponse.fromJson(_result.data!); return value; } @override - Future getCommunityPost(sessionId, id) async { + Future getCommunityPost( + String sessionId, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/communityposts/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communityposts/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = CommunityPost.fromJson(_result.data!); return value; } @override - Future createCommunityPost(sessionId, post) async { + Future createCommunityPost( + String sessionId, + CommunityPost post, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(post.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/communityposts', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future updateCommunityPost(sessionId, id, post) async { + await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communityposts', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future updateCommunityPost( + String sessionId, + String id, + CommunityPost post, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(post.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/communityposts/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future updateCommunityPostAction(sessionId, id, action, data) async { + await _dio.fetch(_setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communityposts/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future updateCommunityPostAction( + String sessionId, + String id, + String action, + ActionCommunityPostRequest data, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(data.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/communityposts/${action}/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; - } - - @override - Future updateCommunityPostStatus(sessionId, id, data) async { + await _dio.fetch(_setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communityposts/${action}/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); + } + + @override + Future updateCommunityPostStatus( + String sessionId, + String id, + UpdateCommunityPostRequest data, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(data.toJson()); - await _dio.fetch(_setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/communityposts/moderator/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; + await _dio.fetch(_setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/communityposts/moderator/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); } @override Future updateUserCommunityPostReaction( - sessionID, postID, reaction) async { + String sessionID, + String postID, + int reaction, + ) async { const _extra = {}; final queryParameters = {r'reaction': reaction}; final _headers = {r'Cookie': sessionID}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - await _dio.fetch(_setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-me/ucpr/${postID}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); - return null; + final Map? _data = null; + await _dio.fetch(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-me/ucpr/${postID}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); } @override - Future> getUserTags(sessionId) async { + Future> getUserTags(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-tags', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-tags', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => UserTagHolder.fromJson(i as Map)) .toList(); @@ -1332,51 +2346,89 @@ class _InstiAppApi implements InstiAppApi { @override Future getUserTagsReach( - sessionId, selectedTagIds) async { + String sessionId, + List selectedTagIds, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = selectedTagIds; final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/user-tags/reach', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/user-tags/reach', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = UserTagsReachResponse.fromJson(_result.data!); return value; } @override - Future createAchievement(sessionId, offeredAchievements) async { + Future createAchievement( + dynamic sessionId, + OfferedAchievements offeredAchievements, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {}; final _data = {}; _data.addAll(offeredAchievements.toJson()); - final _result = await _dio.fetch(_setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/achievements-offer', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = await _dio.fetch(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/achievements-offer', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = _result.data; return value; } @override - Future> getBuynSellPosts(sessionId) async { + Future> getBuynSellPosts(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/buy/products', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/buy/products', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map((dynamic i) => BuynSellPost.fromJson(i as Map)) .toList(); @@ -1384,88 +2436,156 @@ class _InstiAppApi implements InstiAppApi { } @override - Future getBuynSellPost(sessionId, id) async { + Future getBuynSellPost( + String sessionId, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/buy/products/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/buy/products/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = BuynSellPost.fromJson(_result.data!); return value; } @override - Future deleteBuynSellPost(sessionId, id) async { + Future deleteBuynSellPost( + String sessionId, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'DELETE', headers: _headers, extra: _extra) - .compose(_dio.options, '/buy/products/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'DELETE', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/buy/products/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = BuynSellPost.fromJson(_result.data!); return value; } @override - Future updateBuynSellPost(sessionId, id, post) async { + Future updateBuynSellPost( + String sessionId, + String id, + BuynSellPost post, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(post.toJson()); - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'PUT', headers: _headers, extra: _extra) - .compose(_dio.options, '/buy/products/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'PUT', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/buy/products/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = BuynSellPost.fromJson(_result.data!); return value; } @override - Future createBuynSellPost(sessionId, post) async { + Future createBuynSellPost( + String sessionId, + BuynSellPost post, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(post.toJson()); - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'POST', headers: _headers, extra: _extra) - .compose(_dio.options, '/buy/products', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/buy/products', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = BuynSellPost.fromJson(_result.data!); return value; } @override - Future> getLostAndFoundPosts(sessionId) async { + Future> getLostAndFoundPosts(String sessionId) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType>( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/lnf/products', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType>(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/lnf/products', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); var value = _result.data! .map( (dynamic i) => LostAndFoundPost.fromJson(i as Map)) @@ -1474,18 +2594,32 @@ class _InstiAppApi implements InstiAppApi { } @override - Future getLostAndFoundPost(sessionId, id) async { + Future getLostAndFoundPost( + String sessionId, + String id, + ) async { const _extra = {}; final queryParameters = {}; final _headers = {r'Cookie': sessionId}; _headers.removeWhere((k, v) => v == null); - final _data = {}; - final _result = await _dio.fetch>( - _setStreamType( - Options(method: 'GET', headers: _headers, extra: _extra) - .compose(_dio.options, '/lnf/products/${id}', - queryParameters: queryParameters, data: _data) - .copyWith(baseUrl: baseUrl ?? _dio.options.baseUrl))); + final Map? _data = null; + final _result = await _dio + .fetch>(_setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/lnf/products/${id}', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + )))); final value = LostAndFoundPost.fromJson(_result.data!); return value; } @@ -1502,4 +2636,21 @@ class _InstiAppApi implements InstiAppApi { } return requestOptions; } + + String _combineBaseUrls( + String dioBaseUrl, + String? baseUrl, + ) { + if (baseUrl == null || baseUrl.trim().isEmpty) { + return dioBaseUrl; + } + + final url = Uri.parse(baseUrl); + + if (url.isAbsolute) { + return url.toString(); + } + + return Uri.parse(dioBaseUrl).resolveUri(url).toString(); + } } diff --git a/lib/src/api/interceptors.dart b/lib/src/api/interceptors.dart index a0bc8699..5bd5d4ba 100644 --- a/lib/src/api/interceptors.dart +++ b/lib/src/api/interceptors.dart @@ -10,7 +10,7 @@ class ErrorInterceptor extends Interceptor { ErrorInterceptor({required this.context, required this.navigatorKey}); @override - void onError(DioError err, ErrorInterceptorHandler handler) async { + void onError(DioException err, ErrorInterceptorHandler handler) async { // print("Error"); final res = err.response; InstiAppBloc bloc = BlocProvider.of(context)!.bloc; diff --git a/lib/src/api/model/UserTag.g.dart b/lib/src/api/model/UserTag.g.dart index 8fb79cdb..058bdc3c 100644 --- a/lib/src/api/model/UserTag.g.dart +++ b/lib/src/api/model/UserTag.g.dart @@ -7,7 +7,7 @@ part of 'UserTag.dart'; // ************************************************************************** UserTag _$UserTagFromJson(Map json) => UserTag( - tagID: json['id'] as int?, + tagID: (json['id'] as num?)?.toInt(), tagName: json['name'] as String?, ); @@ -18,7 +18,7 @@ Map _$UserTagToJson(UserTag instance) => { UserTagHolder _$UserTagHolderFromJson(Map json) => UserTagHolder( - holderID: json['id'] as int?, + holderID: (json['id'] as num?)?.toInt(), holderName: json['name'] as String?, holderTags: (json['tags'] as List?) ?.map((e) => UserTag.fromJson(e as Map)) diff --git a/lib/src/api/model/body.g.dart b/lib/src/api/model/body.g.dart index 74467cc1..de8d4b62 100644 --- a/lib/src/api/model/body.g.dart +++ b/lib/src/api/model/body.g.dart @@ -16,7 +16,7 @@ Body _$BodyFromJson(Map json) => Body( ?.map((e) => Event.fromJson(e as Map)) .toList(), bodyID: json['id'] as String?, - bodyFollowersCount: json['followers_count'] as int?, + bodyFollowersCount: (json['followers_count'] as num?)?.toInt(), bodyImageURL: json['image_url'] as String?, bodyName: json['name'] as String?, bodyParents: (json['parents'] as List?) diff --git a/lib/src/api/model/buynsellPost.g.dart b/lib/src/api/model/buynsellPost.g.dart index d39af909..3caee192 100644 --- a/lib/src/api/model/buynsellPost.g.dart +++ b/lib/src/api/model/buynsellPost.g.dart @@ -21,7 +21,7 @@ BuynSellPost _$BuynSellPostFromJson(Map json) => BuynSellPost( action: json['action'] as String?, status: json['status'] as bool?, deleted: json['deleted'] as bool?, - price: json['price'] as int?, + price: (json['price'] as num?)?.toInt(), timeOfCreation: json['time_of_creation'] as String?, ) ..negotiable = json['negotiable'] as bool? diff --git a/lib/src/api/model/community.g.dart b/lib/src/api/model/community.g.dart index 29ce06df..117d8b42 100644 --- a/lib/src/api/model/community.g.dart +++ b/lib/src/api/model/community.g.dart @@ -9,7 +9,7 @@ part of 'community.dart'; Community _$CommunityFromJson(Map json) => Community( id: json['id'] as String?, name: json['name'] as String?, - followersCount: json['followers_count'] as int?, + followersCount: (json['followers_count'] as num?)?.toInt(), about: json['about'] as String?, logoImg: json['logo_image'] as String?, coverImg: json['cover_image'] as String?, diff --git a/lib/src/api/model/communityPost.g.dart b/lib/src/api/model/communityPost.g.dart index 1316a271..3c047669 100644 --- a/lib/src/api/model/communityPost.g.dart +++ b/lib/src/api/model/communityPost.g.dart @@ -14,7 +14,7 @@ CommunityPost _$CommunityPostFromJson(Map json) => ?.map((e) => CommunityPost.fromJson(e as Map)) .toList(), content: json['content'] as String?, - commentsCount: json['comments_count'] as int?, + commentsCount: (json['comments_count'] as num?)?.toInt(), imageUrl: (json['image_url'] as List?) ?.map((e) => e as String) .toList(), @@ -22,11 +22,11 @@ CommunityPost _$CommunityPostFromJson(Map json) => ? null : User.fromJson(json['posted_by'] as Map), reactionCount: (json['reactions_count'] as Map?)?.map( - (k, e) => MapEntry(k, e as int), + (k, e) => MapEntry(k, (e as num).toInt()), ), timeOfCreation: json['time_of_creation'] as String?, timeOfModification: json['time_of_modification'] as String?, - userReaction: json['user_reaction'] as int?, + userReaction: (json['user_reaction'] as num?)?.toInt(), mostLikedComment: json['most_liked_comment'] == null ? null : CommunityPost.fromJson( @@ -34,9 +34,9 @@ CommunityPost _$CommunityPostFromJson(Map json) => community: json['community'] == null ? null : Community.fromJson(json['community'] as Map), - threadRank: json['thread_rank'] as int?, + threadRank: (json['thread_rank'] as num?)?.toInt(), parent: json['parent'] as String?, - status: json['status'] as int?, + status: (json['status'] as num?)?.toInt(), interests: (json['interests'] as List?) ?.map((e) => Interest.fromJson(e as Map)) .toList(), diff --git a/lib/src/api/model/event.g.dart b/lib/src/api/model/event.g.dart index f3ff0964..49fef6bd 100644 --- a/lib/src/api/model/event.g.dart +++ b/lib/src/api/model/event.g.dart @@ -27,10 +27,11 @@ Event _$EventFromJson(Map json) => Event( eventOfferedAchievements: (json['offered_achievements'] as List?) ?.map((e) => OfferedAchievements.fromJson(e as Map)) .toList(), - eventInterestedCount: json['interested_count'] as int? ?? 0, - eventGoingCount: json['going_count'] as int? ?? 0, - eventUserTags: - (json['user_tags'] as List?)?.map((e) => e as int).toList(), + eventInterestedCount: (json['interested_count'] as num?)?.toInt() ?? 0, + eventGoingCount: (json['going_count'] as num?)?.toInt() ?? 0, + eventUserTags: (json['user_tags'] as List?) + ?.map((e) => (e as num).toInt()) + .toList(), eventInterested: (json['interested'] as List?) ?.map((e) => User.fromJson(e as Map)) .toList(), @@ -38,7 +39,7 @@ Event _$EventFromJson(Map json) => Event( ?.map((e) => User.fromJson(e as Map)) .toList(), eventWebsiteURL: json['website_url'] as String?, - eventUserUesInt: json['user_ues'] as int?, + eventUserUesInt: (json['user_ues'] as num?)?.toInt(), eventInterest: (json['event_interest'] as List?) ?.map((e) => Interest.fromJson(e as Map)) .toList(), diff --git a/lib/src/api/model/mess.g.dart b/lib/src/api/model/mess.g.dart index d5e11794..dd3f0883 100644 --- a/lib/src/api/model/mess.g.dart +++ b/lib/src/api/model/mess.g.dart @@ -27,7 +27,7 @@ Map _$HostelToJson(Hostel instance) => { HostelMess _$HostelMessFromJson(Map json) => HostelMess( id: json['id'] as String?, breakfast: json['breakfast'] as String?, - day: json['day'] as int?, + day: (json['day'] as num?)?.toInt(), lunch: json['lunch'] as String?, snacks: json['snacks'] as String?, dinner: json['dinner'] as String?, diff --git a/lib/src/api/model/messCalEvent.g.dart b/lib/src/api/model/messCalEvent.g.dart index 376b0c16..7d7efb76 100644 --- a/lib/src/api/model/messCalEvent.g.dart +++ b/lib/src/api/model/messCalEvent.g.dart @@ -10,7 +10,7 @@ MessCalEvent _$MessCalEventFromJson(Map json) => MessCalEvent( eid: json['id'] as String?, title: json['title'] as String?, dateTime: json['datetime'] as String?, - hostel: json['hostel'] as int?, + hostel: (json['hostel'] as num?)?.toInt(), )..eventStartDate = json['eventStartDate'] == null ? null : DateTime.parse(json['eventStartDate'] as String); diff --git a/lib/src/api/model/notification.g.dart b/lib/src/api/model/notification.g.dart index 92cc46ed..e217f903 100644 --- a/lib/src/api/model/notification.g.dart +++ b/lib/src/api/model/notification.g.dart @@ -7,7 +7,7 @@ part of 'notification.dart'; // ************************************************************************** Notification _$NotificationFromJson(Map json) => Notification( - notificationId: json['id'] as int?, + notificationId: (json['id'] as num?)?.toInt(), notificationVerb: json['verb'] as String?, notificationUnread: json['unread'] as bool?, notificationActorType: json['actor_type'] as String?, diff --git a/lib/src/api/model/offeredAchievements.g.dart b/lib/src/api/model/offeredAchievements.g.dart index 06103020..46af65f3 100644 --- a/lib/src/api/model/offeredAchievements.g.dart +++ b/lib/src/api/model/offeredAchievements.g.dart @@ -13,9 +13,9 @@ OfferedAchievements _$OfferedAchievementsFromJson(Map json) => desc: json['description'] as String?, body: json['body'] as String?, event: json['event'] as String?, - priority: json['priority'] as int?, + priority: (json['priority'] as num?)?.toInt(), secret: json['secret'] as String?, - stat: json['stat'] as int?, + stat: (json['stat'] as num?)?.toInt(), users: (json['users'] as List?) ?.map((e) => User.fromJson(e as Map)) .toList(), diff --git a/lib/src/api/model/post.g.dart b/lib/src/api/model/post.g.dart index 289c8e64..1358e622 100644 --- a/lib/src/api/model/post.g.dart +++ b/lib/src/api/model/post.g.dart @@ -97,9 +97,9 @@ NewsArticle _$NewsArticleFromJson(Map json) => NewsArticle( ? null : Body.fromJson(json['body'] as Map), reactionCount: (json['reactions_count'] as Map?)?.map( - (k, e) => MapEntry(k, e as int), + (k, e) => MapEntry(k, (e as num).toInt()), ), - userReaction: json['user_reaction'] as int?, + userReaction: (json['user_reaction'] as num?)?.toInt(), ); Map _$NewsArticleToJson(NewsArticle instance) => diff --git a/lib/src/api/model/venter.g.dart b/lib/src/api/model/venter.g.dart index 5d4ec634..4d96ee6a 100644 --- a/lib/src/api/model/venter.g.dart +++ b/lib/src/api/model/venter.g.dart @@ -31,7 +31,7 @@ Complaint _$ComplaintFromJson(Map json) => Complaint( images: (json['images'] as List?)?.map((e) => e as String).toList(), isSubscribed: json['is_subscribed'] as bool?, - voteCount: json['voteCount'] as int?, + voteCount: (json['voteCount'] as num?)?.toInt(), ); Map _$ComplaintToJson(Complaint instance) => { diff --git a/lib/src/api/model/venue.g.dart b/lib/src/api/model/venue.g.dart index 6c5035f3..24a10d51 100644 --- a/lib/src/api/model/venue.g.dart +++ b/lib/src/api/model/venue.g.dart @@ -13,9 +13,9 @@ Venue _$VenueFromJson(Map json) => Venue( venueDescripion: json['description'] as String?, venueParentId: json['parent'] as String?, venueParentRelation: json['parent_relation'] as String?, - venueGroupId: json['group_id'] as int?, - venuePixelX: json['pixel_x'] as int?, - venuePixelY: json['pixel_y'] as int?, + venueGroupId: (json['group_id'] as num?)?.toInt(), + venuePixelX: (json['pixel_x'] as num?)?.toInt(), + venuePixelY: (json['pixel_y'] as num?)?.toInt(), venueReusable: json['reusable'] as bool?, venueLatitude: json['lat'] as String?, venueLongitude: json['lng'] as String?, diff --git a/lib/src/api/request/chatbotlog_request.g.dart b/lib/src/api/request/chatbotlog_request.g.dart index 6b9e0ab9..ba416ad0 100644 --- a/lib/src/api/request/chatbotlog_request.g.dart +++ b/lib/src/api/request/chatbotlog_request.g.dart @@ -10,7 +10,7 @@ ChatBotLogRequest _$ChatBotLogRequestFromJson(Map json) => ChatBotLogRequest( json['question'] as String?, json['answer'] as String?, - json['reaction'] as int?, + (json['reaction'] as num?)?.toInt(), ); Map _$ChatBotLogRequestToJson(ChatBotLogRequest instance) => diff --git a/lib/src/api/request/event_create_request.g.dart b/lib/src/api/request/event_create_request.g.dart index 6e70e0da..13bf6c82 100644 --- a/lib/src/api/request/event_create_request.g.dart +++ b/lib/src/api/request/event_create_request.g.dart @@ -26,8 +26,9 @@ EventCreateRequest _$EventCreateRequestFromJson(Map json) => ?.map((e) => e as String) .toList(), notify: json['notify'] as bool?, - eventUserTags: - (json['user_tags'] as List?)?.map((e) => e as int).toList(), + eventUserTags: (json['user_tags'] as List?) + ?.map((e) => (e as num).toInt()) + .toList(), eventInterest: (json['event_interest'] as List?) ?.map((e) => Interest.fromJson(e as Map)) .toList(), diff --git a/lib/src/api/request/update_community_post_request.g.dart b/lib/src/api/request/update_community_post_request.g.dart index 9ef83c80..6ce96fc8 100644 --- a/lib/src/api/request/update_community_post_request.g.dart +++ b/lib/src/api/request/update_community_post_request.g.dart @@ -9,7 +9,7 @@ part of 'update_community_post_request.dart'; UpdateCommunityPostRequest _$UpdateCommunityPostRequestFromJson( Map json) => UpdateCommunityPostRequest( - status: json['status'] as int?, + status: (json['status'] as num?)?.toInt(), ); Map _$UpdateCommunityPostRequestToJson( diff --git a/lib/src/api/request/user_fcm_patch_request.g.dart b/lib/src/api/request/user_fcm_patch_request.g.dart index 205bc9bc..0a9ad2b8 100644 --- a/lib/src/api/request/user_fcm_patch_request.g.dart +++ b/lib/src/api/request/user_fcm_patch_request.g.dart @@ -9,7 +9,7 @@ part of 'user_fcm_patch_request.dart'; UserFCMPatchRequest _$UserFCMPatchRequestFromJson(Map json) => UserFCMPatchRequest( userFCMId: json['fcm_id'] as String?, - userAndroidVersion: json['android_version'] as int?, + userAndroidVersion: (json['android_version'] as num?)?.toInt(), ); Map _$UserFCMPatchRequestToJson( diff --git a/lib/src/api/response/community_post_list_response.g.dart b/lib/src/api/response/community_post_list_response.g.dart index f2ea75dc..6564bf2c 100644 --- a/lib/src/api/response/community_post_list_response.g.dart +++ b/lib/src/api/response/community_post_list_response.g.dart @@ -9,7 +9,7 @@ part of 'community_post_list_response.dart'; CommunityPostListResponse _$CommunityPostListResponseFromJson( Map json) => CommunityPostListResponse( - count: json['count'] as int?, + count: (json['count'] as num?)?.toInt(), data: (json['data'] as List?) ?.map((e) => CommunityPost.fromJson(e as Map)) .toList(), diff --git a/lib/src/api/response/news_feed_response.g.dart b/lib/src/api/response/news_feed_response.g.dart index cfd78eea..d7601f00 100644 --- a/lib/src/api/response/news_feed_response.g.dart +++ b/lib/src/api/response/news_feed_response.g.dart @@ -11,7 +11,7 @@ NewsFeedResponse _$NewsFeedResponseFromJson(Map json) => (json['data'] as List?) ?.map((e) => Event.fromJson(e as Map)) .toList(), - json['count'] as int?, + (json['count'] as num?)?.toInt(), ); Map _$NewsFeedResponseToJson(NewsFeedResponse instance) => diff --git a/lib/src/api/response/user_tags_reach_response.g.dart b/lib/src/api/response/user_tags_reach_response.g.dart index cfd5b7b0..6b15827e 100644 --- a/lib/src/api/response/user_tags_reach_response.g.dart +++ b/lib/src/api/response/user_tags_reach_response.g.dart @@ -9,7 +9,7 @@ part of 'user_tags_reach_response.dart'; UserTagsReachResponse _$UserTagsReachResponseFromJson( Map json) => UserTagsReachResponse( - json['count'] as int?, + (json['count'] as num?)?.toInt(), ); Map _$UserTagsReachResponseToJson( diff --git a/lib/src/components/dropdowns.dart b/lib/src/components/dropdowns.dart new file mode 100644 index 00000000..1a8e7c3c --- /dev/null +++ b/lib/src/components/dropdowns.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:dropdown_search/dropdown_search.dart'; + +class CustomDropdown extends StatelessWidget { + final itemBuilder; + final style; + final emptyText; + final label; + final onChanged; + final asyncItems; + final dropdownBuilder; + final validator; + final selectedItem; + final items; + const CustomDropdown( + {Key? key, + this.itemBuilder, + this.items, + this.style, + this.emptyText, + this.label, + this.onChanged, + this.asyncItems, + this.validator, + this.selectedItem, + this.dropdownBuilder}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return DropdownSearch( + validator: this.validator, + selectedItem: this.selectedItem, + popupProps: PopupProps.dialog( + itemBuilder: this.itemBuilder, + emptyBuilder: (BuildContext context, String? _) { + return Container( + alignment: Alignment.center, + padding: EdgeInsets.all(20), + child: Text( + this.emptyText, + style: this.style, + textAlign: TextAlign.center, + ), + ); + }, + showSearchBox: true, + isFilterOnline: true, + scrollbarProps: ScrollbarProps( + thickness: 7, + ), + ), + dropdownDecoratorProps: DropDownDecoratorProps( + dropdownSearchDecoration: InputDecoration( + labelText: this.label, + hintText: this.label, + ), + ), + onChanged: this.onChanged, + asyncItems: this.asyncItems, + dropdownBuilder: this.dropdownBuilder, + + // popupSafeArea: + // PopupSafeArea( + // top: true, + // bottom: true), + ); + } +} diff --git a/lib/src/drawer.dart b/lib/src/drawer.dart index 557c0723..c05f0f98 100644 --- a/lib/src/drawer.dart +++ b/lib/src/drawer.dart @@ -41,12 +41,12 @@ class _NavDrawerState extends State { navi = Navigator.of(context); return UpgradeAlert( + showReleaseNotes: true, + dialogStyle: UpgradeDialogStyle.cupertino, upgrader: Upgrader( // debugLogging: true, // debugDisplayAlways: true, - dialogStyle: UpgradeDialogStyle.cupertino, durationUntilAlertAgain: Duration(days: 1), - showReleaseNotes: false, messages: MyUpgraderMessages(), ), child: Drawer( @@ -313,7 +313,7 @@ class _NavDrawerState extends State { title: Text( snapshot.data?.profile?.userName ?? 'Not Logged in', - style: theme.textTheme.bodyText2 + style: theme.textTheme.bodyMedium ?.copyWith(fontWeight: FontWeight.bold), ), subtitle: snapshot.data != null @@ -321,7 +321,7 @@ class _NavDrawerState extends State { snapshot.data?.profile ?.userRollNumber ?? "", - style: theme.textTheme.bodyText2) + style: theme.textTheme.bodyMedium) : ElevatedButton( child: Text( "Log in", @@ -413,7 +413,7 @@ class _NavDrawerState extends State { "${snapshot.data?.length}", style: theme .textTheme - .overline + .labelSmall ?.copyWith( color: theme .colorScheme @@ -553,13 +553,13 @@ class NavListTile extends StatelessWidget { color: theme.colorScheme.onSurface, ) : Transform.translate( - offset: Offset(-3,3), - child: Icon( - //for lost and found icon - this.icon, - color: theme.colorScheme.onSurface, - size: 32), - ), + offset: Offset(-3, 3), + child: Icon( + //for lost and found icon + this.icon, + color: theme.colorScheme.onSurface, + size: 32), + ), dense: true, title: Text( this.title!, diff --git a/lib/src/routes/aboutpage.dart b/lib/src/routes/aboutpage.dart index a8684a3b..39bb3854 100644 --- a/lib/src/routes/aboutpage.dart +++ b/lib/src/routes/aboutpage.dart @@ -171,7 +171,7 @@ class _AboutPageState extends State { TitleWithBackButton( child: Text( widget.title, - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ), ]..addAll(_buildContent(theme, widget.sectionToNameToImageUrl)), @@ -187,7 +187,7 @@ class _AboutPageState extends State { Center( child: Text( entry.key, - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ), ), Padding( diff --git a/lib/src/routes/achievement_form.dart b/lib/src/routes/achievement_form.dart index baa507fd..f3a004d6 100644 --- a/lib/src/routes/achievement_form.dart +++ b/lib/src/routes/achievement_form.dart @@ -1,13 +1,13 @@ import 'dart:developer'; import 'package:InstiApp/src/api/model/user.dart'; import 'package:InstiApp/src/api/response/secret_response.dart'; +import 'package:InstiApp/src/components/dropdowns.dart'; import 'package:flutter/material.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:InstiApp/src/api/model/body.dart'; import 'package:InstiApp/src/api/request/achievement_create_request.dart'; import 'package:InstiApp/src/utils/common_widgets.dart'; -import 'package:dropdown_search/dropdown_search.dart'; import 'package:InstiApp/src/api/model/event.dart'; import '../bloc_provider.dart'; import '../drawer.dart'; @@ -38,7 +38,7 @@ class _CreateAchievementPage extends State { return Container( child: Text( "Search for an InstiApp Event", - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyLarge, ), ); } @@ -73,7 +73,7 @@ class _CreateAchievementPage extends State { return Container( child: Text( "Search for an organisation", - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyLarge, ), ); } @@ -109,7 +109,7 @@ class _CreateAchievementPage extends State { return Container( child: Text( "Search for a skill", - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyLarge, ), ); } @@ -232,7 +232,7 @@ class _CreateAchievementPage extends State { ), Text( "Login To View Achievements", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -274,8 +274,8 @@ class _CreateAchievementPage extends State { 15.0, 15.0, 10.0, 5.0), child: Text( 'Verification Request', - style: theme - .textTheme.headline4, + style: theme.textTheme + .headlineMedium, )), SizedBox( height: 40, @@ -368,56 +368,22 @@ class _CreateAchievementPage extends State { SizedBox( height: 20.0, ), - DropdownSearch( - mode: Mode.DIALOG, - dropdownSearchDecoration: - InputDecoration( - labelText: - "Event (Optional)", - hintText: - "Event (Optional)", - ), - maxHeight: 700, - isFilteredOnline: - true, - showSearchBox: true, + CustomDropdown( + emptyText: + "No events found. Refine your search!", onChanged: onEventChange, - onFind: bloc + label: + "Event (Optional)", + itemBuilder: + _customPopupItemBuilderEvent, + asyncItems: bloc .achievementBloc .searchForEvent, dropdownBuilder: buildDropdownMenuItemsEvent, - popupItemBuilder: - _customPopupItemBuilderEvent, - // popupSafeArea: - // PopupSafeArea( - // top: true, - // bottom: true), - scrollbarProps: - ScrollbarProps( - isAlwaysShown: true, - thickness: 7, - ), - emptyBuilder: - (BuildContext - context, - String? _) { - return Container( - alignment: - Alignment - .center, - padding: - EdgeInsets - .all(20), - child: Text( - "No events found. Refine your search!", - style: theme - .textTheme - .subtitle1, - ), - ); - }, + style: theme.textTheme + .titleMedium, ), SizedBox( height: this.selectedE @@ -447,67 +413,30 @@ class _CreateAchievementPage extends State { SizedBox( height: 20.0, ), - - DropdownSearch( - mode: Mode.DIALOG, - maxHeight: 700, - isFilteredOnline: - true, - showSearchBox: true, - dropdownSearchDecoration: - InputDecoration( - labelText: - "Verifying Authority", - hintText: - "Verifying Authority"), + CustomDropdown( + emptyText: + "No verifying authorities found. Refine your search!", + label: + "Verifying Authority", + itemBuilder: + _customPopupItemBuilderBody, + asyncItems: bloc + .achievementBloc + .searchForBody, + dropdownBuilder: + buildDropdownMenuItemsBody, + style: theme.textTheme + .titleMedium, validator: (value) { if (value == null) { return 'Please select a organization'; } return null; }, - onChanged: - onBodyChange, - onFind: bloc - .achievementBloc - .searchForBody, - dropdownBuilder: - buildDropdownMenuItemsBody, - popupItemBuilder: - _customPopupItemBuilderBody, - // popupSafeArea: - // PopupSafeArea( - // top: true, - // bottom: true), - scrollbarProps: - ScrollbarProps( - isAlwaysShown: true, - thickness: 7, - ), selectedItem: _selectedBody, - emptyBuilder: - (BuildContext - context, - String? _) { - return Container( - alignment: - Alignment - .center, - padding: - EdgeInsets - .all(20), - child: Text( - "No verifying authorities found. Refine your search!", - style: theme - .textTheme - .subtitle1, - textAlign: - TextAlign - .center, - ), - ); - }, + onChanged: + onBodyChange, ), SizedBox( height: this.selectedB @@ -562,10 +491,14 @@ class _CreateAchievementPage extends State { child: Text( 'Request Verification'), style: TextButton.styleFrom( - primary: Colors.black, + foregroundColor: + Colors.black, backgroundColor: Color(0xffffd740), - onSurface: Colors.grey, + disabledForegroundColor: + Colors.grey + .withOpacity( + 0.38), elevation: 5.0), ), ), @@ -602,68 +535,31 @@ class _CreateAchievementPage extends State { SizedBox( height: 20.0, ), - - DropdownSearch( - mode: Mode.DIALOG, - maxHeight: 700, - isFilteredOnline: - true, - showSearchBox: true, - dropdownSearchDecoration: - InputDecoration( - labelText: - "Title", - hintText: - "Titile"), - validator: (value) { - if (value == null) { - return 'Please select a Skill'; - } - return null; - }, + CustomDropdown( + emptyText: + "No skills found. Refine your search!", onChanged: onSkillChange, - onFind: bloc + label: "Title", + itemBuilder: + _customPopupItemBuilderSkill, + asyncItems: bloc .achievementBloc .searchForSkill, dropdownBuilder: buildDropdownMenuItemsSkill, - popupItemBuilder: - _customPopupItemBuilderSkill, - // popupSafeArea: - // PopupSafeArea( - // top: true, - // bottom: true), - scrollbarProps: - ScrollbarProps( - isAlwaysShown: true, - thickness: 7, - ), + style: theme.textTheme + .titleMedium, + validator: (value) { + if (value == null) { + return 'Please select a Skill'; + } + return null; + }, selectedItem: _selectedSkill, - emptyBuilder: - (BuildContext - context, - String? _) { - return Container( - alignment: - Alignment - .center, - padding: - EdgeInsets - .all(20), - child: Text( - "No skills found. Refine your search!", - style: theme - .textTheme - .subtitle1, - textAlign: - TextAlign - .center, - ), - ); - }, ), + SizedBox( height: this.selectedB ? 20.0 @@ -720,10 +616,14 @@ class _CreateAchievementPage extends State { child: Text( 'Request Verification'), style: TextButton.styleFrom( - primary: Colors.black, + foregroundColor: + Colors.black, backgroundColor: Color(0xffffd740), - onSurface: Colors.grey, + disabledForegroundColor: + Colors.grey + .withOpacity( + 0.38), elevation: 5.0), ), ), @@ -1059,7 +959,7 @@ class Card extends State { return ListTile( title: Text( widget.thing.eventName!, - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( @@ -1092,7 +992,7 @@ class BodyCardState extends State { return ListTile( title: Text( widget.thing?.bodyName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( diff --git a/lib/src/routes/alumniLoginPage.dart b/lib/src/routes/alumniLoginPage.dart index 3325884f..570ef462 100644 --- a/lib/src/routes/alumniLoginPage.dart +++ b/lib/src/routes/alumniLoginPage.dart @@ -46,7 +46,7 @@ class _AlumniLoginPageState extends State { initialValue: "", decoration: InputDecoration(labelText: "Enter your LDAP here."), onChanged: (value) => { - setState(() => {_bloc!.setAlumniID(value)}) + setState(() {_bloc!.setAlumniID(value);}) }, ), SizedBox( diff --git a/lib/src/routes/alumni_OTP_Page.dart b/lib/src/routes/alumni_OTP_Page.dart index 3654d913..08085aa2 100644 --- a/lib/src/routes/alumni_OTP_Page.dart +++ b/lib/src/routes/alumni_OTP_Page.dart @@ -54,7 +54,7 @@ class _AlumniOTPPageState extends State { initialValue: "", decoration: InputDecoration(labelText: "Enter the OTP here."), onChanged: (value) => { - setState(() => {_bloc!.setAlumniOTP(value)}) + setState(() {_bloc!.setAlumniOTP(value);}) }, ), SizedBox( diff --git a/lib/src/routes/blogpage.dart b/lib/src/routes/blogpage.dart index 27aa5ec5..6c6a25dc 100644 --- a/lib/src/routes/blogpage.dart +++ b/lib/src/routes/blogpage.dart @@ -29,7 +29,7 @@ TextSpan highlight(String result, String query, BuildContext context) { TextStyle posRes = TextStyle(color: Colors.white, backgroundColor: Colors.red); TextStyle? negRes = theme.textTheme - .subtitle1; // TextStyle(backgroundColor: bloc.bloc.brightness.toColor().withOpacity(1.0),); + .titleMedium; // TextStyle(backgroundColor: bloc.bloc.brightness.toColor().withOpacity(1.0),); if (result == "" || query == "") return TextSpan(text: result, style: negRes); result.replaceAll('\n', " ").replaceAll(" ", ""); @@ -243,7 +243,7 @@ class _BlogPageState extends State { children: [ Text( widget.title, - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ], ), @@ -253,7 +253,7 @@ class _BlogPageState extends State { padding: const EdgeInsets.all(28.0), child: Text( "You must be logged in to view ${widget.title}", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, textAlign: TextAlign.center, ), ), @@ -369,7 +369,7 @@ class _BlogPageState extends State { ), Text( "Ask your queries!", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -396,7 +396,7 @@ class _BlogPageState extends State { child: Center( child: Text.rich( TextSpan(children: [ - TextSpan(text: "👎 ", style: theme.textTheme.headline5), + TextSpan(text: "👎 ", style: theme.textTheme.headlineSmall), TextSpan(text: " No Suitable Results"), ]), )), @@ -422,7 +422,7 @@ class _BlogPageState extends State { args?.key == ActionKeys.LIKE_REACT && firstNotifAct) { firstNotifAct = false; - WidgetsBinding.instance?.addPostFrameCallback( + WidgetsBinding.instance.addPostFrameCallback( (_) => _pressedReact(post, theme, bloc, context)); } @@ -460,34 +460,30 @@ class _BlogPageState extends State { children: [ widget.postType == PostType.ChatBot ? RichText( - textScaleFactor: 0.8, - // textHeightBehavior: , text: TextSpan( text: "Click here to know more", style: - theme.textTheme.subtitle1!.copyWith( + theme.textTheme.titleMedium!.copyWith( fontWeight: FontWeight.normal, color: Colors.blue, decoration: TextDecoration.underline, )), textAlign: TextAlign.start, strutStyle: StrutStyle.fromTextStyle( - theme.textTheme.headline5!.copyWith( + theme.textTheme.headlineSmall!.copyWith( fontWeight: FontWeight.w900, color: Colors.blue), height: 0.7, - fontWeight: FontWeight.w900)) + fontWeight: FontWeight.w900), textScaler: TextScaler.linear(0.8)) : RichText( - textScaleFactor: 1.55, - // textHeightBehavior: , text: highlight( post.title, bloc.query, context), textAlign: TextAlign.start, strutStyle: StrutStyle.fromTextStyle( - theme.textTheme.headline5!.copyWith( + theme.textTheme.headlineSmall!.copyWith( fontWeight: FontWeight.w900), height: 0.7, - fontWeight: FontWeight.w900)), + fontWeight: FontWeight.w900), textScaler: TextScaler.linear(1.55)), // Text( // post.title, // textAlign: TextAlign.start, @@ -505,7 +501,7 @@ class _BlogPageState extends State { message: "Open body page", child: Text( "${((post as NewsArticle).body?.bodyName)} | ${post.published}", - style: theme.textTheme.subtitle1 + style: theme.textTheme.titleMedium ?.copyWith(color: Colors.lightBlue), ), ), @@ -515,7 +511,7 @@ class _BlogPageState extends State { : Text( post.published, textAlign: TextAlign.start, - style: theme.textTheme.subtitle1, + style: theme.textTheme.titleMedium, ), SizedBox( height: 4.0, @@ -565,7 +561,7 @@ class _BlogPageState extends State { child: CommonHtml( data: post.content, defaultTextStyle: - theme.textTheme.subtitle1 ?? TextStyle())), + theme.textTheme.titleMedium ?? TextStyle())), )), widget.postType == PostType.External ? Padding( @@ -575,7 +571,7 @@ class _BlogPageState extends State { ), child: Text( "By " + post.body, - style: theme.textTheme.bodyText1, + style: theme.textTheme.bodyLarge, ), ) : SizedBox(), @@ -643,7 +639,7 @@ class _BlogPageState extends State { text: "${nonZeroReactions.map((s) => reactionToEmoji[s]).join()} ", style: - theme.textTheme.headline5), + theme.textTheme.headlineSmall), TextSpan( text: " ${((article.userReaction ?? -1) < 0) ? "" : "You "}${((article.userReaction ?? -1) >= 0 && (totalNumberOfReactions ?? 0) > 1) ? "and " : ""}${numberOfPeopleOtherThanYou > 0 ? (numberOfPeopleOtherThanYou.toString() + " other " + (numberOfPeopleOtherThanYou > 1 ? "people " : "person ")) : ""}reacted"), @@ -656,7 +652,7 @@ class _BlogPageState extends State { TextSpan( text: "👍 ", style: - theme.textTheme.headline5), + theme.textTheme.headlineSmall), TextSpan(text: " Like"), ]), )), @@ -726,7 +722,7 @@ class _BlogPageState extends State { child: Text( reactionToEmoji[s] ?? "", style: theme - .textTheme.headline5, + .textTheme.headlineSmall, ), onPressed: () { Navigator.of(context, @@ -767,7 +763,7 @@ class _BlogPageState extends State { TextSpan(children: [ TextSpan( text: "👍 ", - style: theme.textTheme.headline5), + style: theme.textTheme.headlineSmall), TextSpan(text: " Like"), ]), )), @@ -824,7 +820,7 @@ class _BlogPageState extends State { : theme.cardColor, child: Text( reactionToEmoji[s] ?? "", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, ), onPressed: () { Navigator.of(context, rootNavigator: true).pop(s); @@ -859,7 +855,7 @@ class _BlogPageState extends State { Expanded( child: Text( widget.title, - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ), AnimatedContainer( @@ -903,14 +899,14 @@ class _BlogPageState extends State { duration: Duration(milliseconds: 500), child: TextField( controller: _searchFieldController, - cursorColor: theme.textTheme.bodyText2?.color, - style: theme.textTheme.bodyText2, + cursorColor: theme.textTheme.bodyMedium?.color, + style: theme.textTheme.bodyMedium, focusNode: _focusNode, decoration: InputDecoration( border: OutlineInputBorder( borderRadius: BorderRadius.circular(30)), - labelStyle: theme.textTheme.bodyText2, - hintStyle: theme.textTheme.bodyText2, + labelStyle: theme.textTheme.bodyMedium, + hintStyle: theme.textTheme.bodyMedium, prefixIcon: Icon( Icons.search_outlined, ), @@ -966,7 +962,7 @@ class _BlogPageState extends State { return MultiSelectDialogField( title: Text( "Filters", - style: theme.textTheme.subtitle1, + style: theme.textTheme.titleMedium, ), searchable: true, decoration: BoxDecoration(), diff --git a/lib/src/routes/bodypage.dart b/lib/src/routes/bodypage.dart index f61c4039..02585503 100644 --- a/lib/src/routes/bodypage.dart +++ b/lib/src/routes/bodypage.dart @@ -153,11 +153,11 @@ class _BodyPageState extends State { children: [ Text( body?.bodyName ?? "", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), SizedBox(height: 8.0), Text(body?.bodyShortDescription ?? "", - style: theme.textTheme.headline6), + style: theme.textTheme.titleLarge), ], ), ), @@ -186,7 +186,7 @@ class _BodyPageState extends State { child: CommonHtml( data: body?.bodyDescription ?? "", defaultTextStyle: - theme.textTheme.subtitle1 ?? TextStyle()), + theme.textTheme.titleMedium ?? TextStyle()), ), body?.bodyDescription != null ? SizedBox( @@ -206,7 +206,7 @@ class _BodyPageState extends State { horizontal: 28.0, vertical: 16.0), child: Text( "Events", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, ), ))) // Children @@ -219,7 +219,7 @@ class _BodyPageState extends State { horizontal: 28.0, vertical: 16.0), child: Text( "Organizations", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, ), ))) // People @@ -240,7 +240,7 @@ class _BodyPageState extends State { horizontal: 28.0, vertical: 16.0), child: Text( "People", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, ), ))) // Parents @@ -253,7 +253,7 @@ class _BodyPageState extends State { horizontal: 28.0, vertical: 16.0), child: Text( "Part of", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, ), ))) ..addAll([ @@ -307,12 +307,11 @@ class _BodyPageState extends State { ElevatedButton _buildFollowBody(ThemeData theme, InstiAppBloc bloc) { return ElevatedButton( style: ElevatedButton.styleFrom( - primary: body?.bodyUserFollows ?? false + foregroundColor: body?.bodyUserFollows ?? false + ? theme.floatingActionButtonTheme.foregroundColor + : theme.textTheme.bodyLarge?.color, backgroundColor: body?.bodyUserFollows ?? false ? theme.colorScheme.secondary : theme.scaffoldBackgroundColor, - onPrimary: body?.bodyUserFollows ?? false - ? theme.floatingActionButtonTheme.foregroundColor - : theme.textTheme.bodyText1?.color, shape: RoundedRectangleBorder( side: BorderSide( color: theme.colorScheme.secondary, @@ -390,8 +389,8 @@ class _BodyPageState extends State { Widget _buildBodyTile(InstiAppBloc bloc, TextTheme theme, Body body) { return ListTile( - title: Text(body.bodyName ?? "", style: theme.headline6), - subtitle: Text(body.bodyShortDescription ?? "", style: theme.subtitle2), + title: Text(body.bodyName ?? "", style: theme.titleLarge), + subtitle: Text(body.bodyShortDescription ?? "", style: theme.titleSmall), leading: NullableCircleAvatar( body.bodyImageURL ?? "", Icons.people_outline_outlined, @@ -407,7 +406,7 @@ class _BodyPageState extends State { return ListTile( title: Text( event.eventName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( @@ -431,7 +430,7 @@ class _BodyPageState extends State { ), title: Text( u.userName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), subtitle: Text(u.getSubTitle() ?? ""), onTap: () { diff --git a/lib/src/routes/buynsell_categories.dart b/lib/src/routes/buynsell_categories.dart index 15995f70..989c266d 100644 --- a/lib/src/routes/buynsell_categories.dart +++ b/lib/src/routes/buynsell_categories.dart @@ -3,7 +3,6 @@ import 'package:InstiApp/src/drawer.dart'; import 'package:InstiApp/src/utils/common_widgets.dart'; import 'package:InstiApp/src/utils/title_with_backbutton.dart'; -import '../utils/title_with_backbutton.dart'; double screen_h = 0, screen_w = 0; @@ -86,7 +85,7 @@ class BuyAndSellCategoryPage extends StatelessWidget { child: TitleWithBackButton( child: Text( "Choose Category", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ), ), ), diff --git a/lib/src/routes/buynsell_createpost.dart b/lib/src/routes/buynsell_createpost.dart index dff24329..c9542171 100644 --- a/lib/src/routes/buynsell_createpost.dart +++ b/lib/src/routes/buynsell_createpost.dart @@ -107,7 +107,7 @@ class _BuyAndSellFormState extends State { children: [ Text( "Create Post", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ),SizedBox(height: 20,), Text("Your Name and LDAP will be visible by default",style:TextStyle(color: Colors.red),maxLines: 2,) ], @@ -717,7 +717,7 @@ class _BuyAndSellFormState extends State { child: Text('Cancel'), ), style: ElevatedButton.styleFrom( - primary: Colors.white, + backgroundColor: Colors.white, ), onPressed: () { Navigator.pushNamed(context, '/buyandsell'); diff --git a/lib/src/routes/buynsell_info.dart b/lib/src/routes/buynsell_info.dart index 3cf1431a..fe9ea47f 100644 --- a/lib/src/routes/buynsell_info.dart +++ b/lib/src/routes/buynsell_info.dart @@ -128,7 +128,7 @@ class _BuyAndSellInfoPageState extends State { child: Text(bnsPost?.brand ?? "", maxLines: 3, overflow: TextOverflow.ellipsis, - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleLarge?.copyWith( fontWeight: FontWeight.w100, fontSize: 20)), ) // style: TextStyle( @@ -157,7 +157,7 @@ class _BuyAndSellInfoPageState extends State { child: Text(bnsPost?.name ?? "", maxLines: 3, overflow: TextOverflow.ellipsis, - style: theme.textTheme.headline5?.copyWith( + style: theme.textTheme.headlineSmall?.copyWith( fontWeight: FontWeight.bold, // fontSize: 30, fontSize: 30, @@ -171,7 +171,7 @@ class _BuyAndSellInfoPageState extends State { Container( margin: EdgeInsets.fromLTRB(screen_w * 0.1, 5, 0, 0), child: Text("Condition - " + (bnsPost?.condition ?? '0') + '/10', - style: theme.textTheme.headline6 + style: theme.textTheme.titleLarge ?.copyWith(fontSize: 15, fontWeight: FontWeight.w500) // style: TextStyle(fontSize: myfont, fontWeight: FontWeight.w100), ), @@ -209,7 +209,7 @@ class _BuyAndSellInfoPageState extends State { Text( 'Phone number - ' + (bnsPost?.contactDetails ?? ""), - style: theme.textTheme.headline4?.copyWith( + style: theme.textTheme.headlineMedium?.copyWith( fontSize: 20, fontWeight: FontWeight.w400), ), ], @@ -222,7 +222,7 @@ class _BuyAndSellInfoPageState extends State { ((bnsPost?.negotiable ?? false) ? "Yes" : "No"), - style: theme.textTheme.headline4?.copyWith( + style: theme.textTheme.headlineMedium?.copyWith( fontSize: 20, fontWeight: FontWeight.w400), ), ], @@ -234,7 +234,7 @@ class _BuyAndSellInfoPageState extends State { ? "GiveAway" : "Price - ₹" + (bnsPost?.price ?? 0).toString()), - style: theme.textTheme.headline4?.copyWith( + style: theme.textTheme.headlineMedium?.copyWith( fontSize: 20, fontWeight: FontWeight.w400), textAlign: TextAlign.left, ), diff --git a/lib/src/routes/buynsell_page.dart b/lib/src/routes/buynsell_page.dart index 687b28a3..8bddc3c7 100644 --- a/lib/src/routes/buynsell_page.dart +++ b/lib/src/routes/buynsell_page.dart @@ -122,7 +122,7 @@ class _SellpageState extends State { ), Text( "Login To View Buy and Sell Posts", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -136,7 +136,7 @@ class _SellpageState extends State { TitleWithBackButton( child: Text( "Buy & Sell (Beta)", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ), ), Center( @@ -150,8 +150,7 @@ class _SellpageState extends State { style: ElevatedButton.styleFrom( shape: RoundedRectangleBorder( borderRadius: - BorderRadius.circular(15)), - primary: theme.cardColor, + BorderRadius.circular(15)), backgroundColor: theme.cardColor, side: BorderSide( width: 2, color: MyPosts @@ -169,7 +168,7 @@ class _SellpageState extends State { }, child: Text( "All Posts", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, )), )), Expanded( @@ -177,7 +176,7 @@ class _SellpageState extends State { padding: EdgeInsets.fromLTRB(5, 10, 10, 10), child: ElevatedButton( child: Text("Your Posts", - style: theme.textTheme.headline6), + style: theme.textTheme.titleLarge), onPressed: () => { setState(() { MyPosts = true; @@ -186,8 +185,7 @@ class _SellpageState extends State { }, style: ElevatedButton.styleFrom( shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(15)), - primary: theme.cardColor, + borderRadius: BorderRadius.circular(15)), backgroundColor: theme.cardColor, side: BorderSide( width: 2, color: !MyPosts @@ -318,7 +316,7 @@ class _SellpageState extends State { EdgeInsets.fromLTRB(screen_h * 0.20 / 0.43, 11, 0, 50), child: Text( posts[index].name ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, //style: TextStyle( // fontSize: (myfont.toInt()).toDouble(), // fontWeight: FontWeight.w600), @@ -333,7 +331,7 @@ class _SellpageState extends State { (posts[index].brand ?? "").length <= 10 ? posts[index].brand ?? "" : (posts[index].brand ?? "").substring(0, 10) + '...', - style: theme.textTheme.bodyText2, + style: theme.textTheme.bodyMedium, maxLines: 1, ), ), @@ -345,7 +343,7 @@ class _SellpageState extends State { borderRadius: BorderRadius.circular(5), child: ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.red, + backgroundColor: Colors.red, ), onPressed: () { showDialog( @@ -386,7 +384,7 @@ class _SellpageState extends State { ? "GiveAway" : "₹" + (posts[index].price ?? 0).toString()), - style: theme.textTheme.bodyText1, + style: theme.textTheme.bodyLarge, // style: // TextStyle(fontSize: w, fontWeight: FontWeight.w800), @@ -403,7 +401,7 @@ class _SellpageState extends State { size: ((myfont / 18 * 12).toInt()).toDouble(), ), Text(' ' + (posts[index].timeBefore ?? ""), - style: theme.textTheme.bodyText1!.copyWith( + style: theme.textTheme.bodyLarge!.copyWith( fontWeight: FontWeight.bold, ) //theme.textTheme.labelSmall @@ -420,7 +418,7 @@ class _SellpageState extends State { child: Text( "Condition: " + (posts[index].condition ?? "") + "/10", style: //TextStyle( - theme.textTheme.bodyText2, + theme.textTheme.bodyMedium, // fontSize: ((myfont / 18 * 12).toInt()).toDouble()), ), margin: @@ -431,7 +429,7 @@ class _SellpageState extends State { (posts[index].description ?? ""), maxLines: 2, overflow: TextOverflow.ellipsis, - style: theme.textTheme.bodyText2, + style: theme.textTheme.bodyMedium, // style: TextStyle( // fontWeight: FontWeight.w500, // fontSize: ((myfont / 16 * 12).toInt()).toDouble()), diff --git a/lib/src/routes/calendarpage.dart b/lib/src/routes/calendarpage.dart index 994696ca..754f7d83 100644 --- a/lib/src/routes/calendarpage.dart +++ b/lib/src/routes/calendarpage.dart @@ -84,7 +84,7 @@ class _CalendarPageState extends State { children: [ Text( widget.title, - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), SizedBox( height: 18, @@ -127,21 +127,21 @@ class _CalendarPageState extends State { _eventIcon!); }, - headerTextStyle: theme.textTheme.headline6, + headerTextStyle: theme.textTheme.titleLarge, - weekendTextStyle: theme.textTheme.headline6 + weekendTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18) .copyWith(color: Colors.red[800]), daysTextStyle: - theme.textTheme.headline6?.copyWith(fontSize: 18), + theme.textTheme.titleLarge?.copyWith(fontSize: 18), inactiveDaysTextStyle: - theme.textTheme.headline6?.copyWith(fontSize: 18), - nextDaysTextStyle: theme.textTheme.headline6 + theme.textTheme.titleLarge?.copyWith(fontSize: 18), + nextDaysTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18) .copyWith( color: theme.colorScheme.onSurface .withAlpha(150)), - prevDaysTextStyle: theme.textTheme.headline6 + prevDaysTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18) .copyWith( color: theme.colorScheme.onSurface @@ -172,7 +172,7 @@ class _CalendarPageState extends State { todayButtonColor: theme.primaryColor.withOpacity(0.3), selectedDayButtonColor: theme.colorScheme.secondary, - selectedDayTextStyle: theme.textTheme.headline6 + selectedDayTextStyle: theme.textTheme.titleLarge ?.copyWith(color: theme.colorScheme.onSecondary), // height: min(MediaQuery.of(context).size.shortestSide, 600) * 1.6, @@ -208,7 +208,7 @@ class _CalendarPageState extends State { false) ? "${snapshot.data?[_currentDate]?.length} Events" : "No events", - style: theme.textTheme.button?.copyWith( + style: theme.textTheme.labelLarge?.copyWith( color: theme.colorScheme.onSecondary, ), ), @@ -251,7 +251,7 @@ class _CalendarPageState extends State { return ListTile( title: Text( event.eventName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( diff --git a/lib/src/routes/communitydetails.dart b/lib/src/routes/communitydetails.dart index 44d180d0..9fea6d6d 100644 --- a/lib/src/routes/communitydetails.dart +++ b/lib/src/routes/communitydetails.dart @@ -60,7 +60,6 @@ class _CommunityDetailsState extends State { }); } }); - } @override @@ -119,7 +118,7 @@ class _CommunityDetailsState extends State { ), Text( "Login To Continue", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -136,111 +135,109 @@ class _CommunityDetailsState extends State { }); }); }, - child: StreamBuilder(builder: (context, snapshot) { - return SingleChildScrollView( - child: Stack( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - community?.coverImg != null - ? Material( - type: MaterialType.transparency, - child: Ink.image( - child: Container(), - image: CachedNetworkImageProvider( - community?.coverImg ?? "", - ), - height: 200, - fit: BoxFit.cover, + child: SingleChildScrollView( + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + community?.coverImg != null + ? Material( + type: MaterialType.transparency, + child: Ink.image( + child: Container(), + image: CachedNetworkImageProvider( + community?.coverImg ?? "", ), - ) - : SizedBox(height: 200), - SizedBox( - height: _avatarRadius + 5, + height: 200, + fit: BoxFit.cover, + ), + ) + : SizedBox(height: 200), + SizedBox( + height: _avatarRadius + 5, + ), + _buildInfo(theme), + CommunityAboutSection(community: community), + CommunityPostSection(community: community), + ], + ), + Positioned( + top: 200 - _avatarRadius, + left: 20, + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + blurRadius: 3, + color: Colors.black.withOpacity(0.25), + ), + BoxShadow( + blurRadius: 10, + color: Colors.black.withOpacity(0.25), + spreadRadius: -2, + offset: Offset(0, 1), + ), + ], + ), + child: NullableCircleAvatar( + community?.logoImg ?? "", + Icons.person, + radius: _avatarRadius, + ), ), - _buildInfo(theme), - CommunityAboutSection(community: community), - CommunityPostSection(community: community), - ], - ), - Positioned( - top: 200 - _avatarRadius, - left: 20, - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration( + SizedBox(width: 20), + TextButton( + child: Text( + (community?.isUserFollowing ?? false) + ? "Joined" + : "Join", + style: theme.textTheme.titleMedium?.copyWith( color: Colors.white, - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - blurRadius: 3, - color: Colors.black.withOpacity(0.25), - ), - BoxShadow( - blurRadius: 10, - color: Colors.black.withOpacity(0.25), - spreadRadius: -2, - offset: Offset(0, 1), - ), - ], - ), - child: NullableCircleAvatar( - community?.logoImg ?? "", - Icons.person, - radius: _avatarRadius, + letterSpacing: 1.25, ), ), - SizedBox(width: 20), - TextButton( - child: Text( - (community?.isUserFollowing ?? false) - ? "Joined" - : "Join", - style: theme.textTheme.subtitle1?.copyWith( - color: Colors.white, - letterSpacing: 1.25, - ), - ), - onPressed: () async { - if (bloc.currSession == null) { - return; - } - setState(() { - loadingFollow = true; - }); - if (community != null) - await bloc.updateFollowCommunity(community!); - setState(() { - loadingFollow = false; - // event has changes - }); - }, - style: ButtonStyle( - padding: MaterialStateProperty.all( - EdgeInsets.symmetric( - horizontal: 24, vertical: 1)), - foregroundColor: MaterialStateProperty.all( - Colors.white), - backgroundColor: MaterialStateProperty.all( - (community?.isUserFollowing ?? false) - ? theme.colorScheme.primary - : theme.colorScheme.secondary), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(100.0), - side: BorderSide(color: Colors.transparent)))), - ) - ], - ), + onPressed: () async { + if (bloc.currSession == null) { + return; + } + setState(() { + loadingFollow = true; + }); + if (community != null) + await bloc.updateFollowCommunity(community!); + setState(() { + loadingFollow = false; + // event has changes + }); + }, + style: ButtonStyle( + padding: WidgetStateProperty.all( + EdgeInsets.symmetric( + horizontal: 24, vertical: 1)), + foregroundColor: WidgetStateProperty.all( + Colors.white), + backgroundColor: WidgetStateProperty.all( + (community?.isUserFollowing ?? false) + ? theme.colorScheme.primary + : theme.colorScheme.secondary), + shape: WidgetStateProperty.all( + RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(100.0), + side: BorderSide(color: Colors.transparent)))), + ) + ], ), - ], - ), - ); - }), + ), + ], + ), + ), ), floatingActionButton: FloatingActionButton( child: Icon( @@ -262,7 +259,7 @@ class _CommunityDetailsState extends State { children: [ Text( community?.name ?? "", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, ), Text((community?.followersCount ?? 0).toString() + " followers"), SizedBox(height: 10) @@ -297,27 +294,27 @@ class CommunityAboutSectionState extends State { mainAxisSize: MainAxisSize.min, children: [ Container( - child: TabBar( - tabs: [ - Tab( - child: Text( - "About", - style: theme.textTheme.bodyText1, - ), + child: TabBar( + tabs: [ + Tab( + child: Text( + "About", + style: theme.textTheme.bodyLarge, ), - Tab( - child: Text( - "Members", - style: theme.textTheme.bodyText1, - ), - ) - ], - onTap: (index) { - setState(() { - _selectedIndex = index; - }); - }, - ), + ), + Tab( + child: Text( + "Members", + style: theme.textTheme.bodyLarge, + ), + ) + ], + onTap: (index) { + setState(() { + _selectedIndex = index; + }); + }, + ), ), IndexedStack( children: [ @@ -346,7 +343,7 @@ class CommunityAboutSectionState extends State { ? [ new TextSpan( text: 'Read More.', - style: theme.textTheme.subtitle2 + style: theme.textTheme.titleSmall ?.copyWith(color: theme.colorScheme.primary), recognizer: new TapGestureRecognizer() ..onTap = () => setState(() { @@ -410,7 +407,7 @@ class CommunityAboutSectionState extends State { ), title: Text( u.userName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), subtitle: Text( u.getSubTitle() ?? "", @@ -432,7 +429,7 @@ class CommunityAboutSectionState extends State { Container( child: Text( 'Featured', - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, ), ), Container( @@ -494,8 +491,8 @@ class _CommunityPostSectionState extends State { var theme = Theme.of(context); var bloc = BlocProvider.of(context)!.bloc; var communityPostBloc = bloc.communityPostBloc; - - loading=false; + + loading = false; if (firstBuild) { communityPostBloc.query = ""; communityPostBloc.refresh(id: widget.community?.id); @@ -512,7 +509,8 @@ class _CommunityPostSectionState extends State { Container( width: MediaQuery.of(context).size.width, decoration: BoxDecoration( - color: theme.colorScheme.surfaceVariant.withOpacity(0.4)), + color: theme.colorScheme.surfaceContainerHighest + .withOpacity(0.4)), child: SingleChildScrollView( padding: EdgeInsets.zero, scrollDirection: Axis.horizontal, @@ -530,8 +528,7 @@ class _CommunityPostSectionState extends State { cpType = CPType.All; }); await communityPostBloc.refresh( - type: CPType.All, - id: widget.community?.id); + type: CPType.All, id: widget.community?.id); setState(() { loading = false; }); @@ -573,8 +570,7 @@ class _CommunityPostSectionState extends State { }); await communityPostBloc.refresh( type: CPType.PendingPosts, - id: widget.community?.id - ); + id: widget.community?.id); setState(() { loading = false; }); @@ -619,7 +615,7 @@ class _CommunityPostSectionState extends State { ? CircularProgressIndicator() : Container( decoration: BoxDecoration( - color: theme.colorScheme.surfaceVariant), + color: theme.colorScheme.surfaceContainerHighest), child: StreamBuilder>( stream: communityPostBloc.communityposts, builder: (BuildContext context, @@ -638,15 +634,15 @@ class _CommunityPostSectionState extends State { ButtonStyle _getButtonStyle(bool selected, ThemeData theme) { return ButtonStyle( - padding: MaterialStateProperty.all( + padding: WidgetStateProperty.all( EdgeInsets.symmetric(horizontal: 15, vertical: 0)), - foregroundColor: MaterialStateProperty.all( + foregroundColor: WidgetStateProperty.all( selected ? theme.colorScheme.primary : theme.colorScheme.onSurfaceVariant, ), - backgroundColor: MaterialStateProperty.all(Colors.transparent), - shape: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all(Colors.transparent), + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(100.0), side: BorderSide( @@ -673,8 +669,8 @@ class _CommunityPostSectionState extends State { return [ Padding( padding: EdgeInsets.symmetric(horizontal: 28.0, vertical: 8.0), - child: - Text.rich(TextSpan(style: theme.textTheme.headline6, children: [ + child: Text.rich( + TextSpan(style: theme.textTheme.titleLarge, children: [ TextSpan(text: "Nothing here yet!"), // TextSpan( // text: "\"${communityPostBloc.query}\"", diff --git a/lib/src/routes/communitypage.dart b/lib/src/routes/communitypage.dart index e5d96089..599481b5 100644 --- a/lib/src/routes/communitypage.dart +++ b/lib/src/routes/communitypage.dart @@ -128,7 +128,7 @@ class _CommunityPageState extends State { ), Text( "Login To View Communities", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -191,7 +191,7 @@ class _CommunityPageState extends State { Padding( padding: EdgeInsets.symmetric(horizontal: 28.0, vertical: 8.0), child: - Text.rich(TextSpan(style: theme.textTheme.headline6, children: [ + Text.rich(TextSpan(style: theme.textTheme.titleLarge, children: [ TextSpan(text: "Nothing here yet!"), // TextSpan( // text: "\"${communityBloc.query}\"", @@ -291,7 +291,7 @@ class _CommunityPageState extends State { : null, title: Text( community.name ?? "Some community", - style: theme.textTheme.subtitle1?.copyWith( + style: theme.textTheme.titleMedium?.copyWith( color: Color.fromARGB(255, 255, 255, 255), fontSize: 15, fontWeight: FontWeight.bold, diff --git a/lib/src/routes/communitypostpage.dart b/lib/src/routes/communitypostpage.dart index 197b1bac..d6470db6 100644 --- a/lib/src/routes/communitypostpage.dart +++ b/lib/src/routes/communitypostpage.dart @@ -144,7 +144,7 @@ class _CommunityPostPageState extends State { children: [ Expanded(child: SizedBox()), Container( - color: theme.colorScheme.surfaceVariant, + color: theme.colorScheme.surfaceContainerHighest, padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), child: Row( @@ -152,7 +152,7 @@ class _CommunityPostPageState extends State { Expanded( child: TextField( controller: _commentController, - cursorColor: theme.textTheme.bodyText2?.color, + cursorColor: theme.textTheme.bodyMedium?.color, style: theme.textTheme.bodyLarge, focusNode: _commentFocusNode, decoration: InputDecoration( @@ -556,7 +556,7 @@ class _CommentState extends State { flex: 3, child: Text( "View ${communityPost.commentsCount} Replies", - style: theme.textTheme.subtitle2?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.colorScheme.onSurfaceVariant, fontWeight: FontWeight.bold, ), @@ -659,7 +659,7 @@ class _CommentState extends State { padding: EdgeInsets.all(5), decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), - color: theme.colorScheme.surfaceVariant, + color: theme.colorScheme.surfaceContainerHighest, ), child: Row( children: emojis diff --git a/lib/src/routes/createpost_form.dart b/lib/src/routes/createpost_form.dart index c2a4b786..26c446b6 100644 --- a/lib/src/routes/createpost_form.dart +++ b/lib/src/routes/createpost_form.dart @@ -107,7 +107,7 @@ class _CreatePostPage extends State { ), Text( "Login To Make Post", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -135,9 +135,7 @@ class _CreatePostPage extends State { }, child: Icon(Icons.close), style: TextButton.styleFrom( - primary: Colors.black, - backgroundColor: theme.canvasColor, - onSurface: Colors.grey, + foregroundColor: Colors.black, backgroundColor: theme.canvasColor, disabledForegroundColor: Colors.grey.withOpacity(0.38), elevation: 0.0), ), ), @@ -186,13 +184,13 @@ class _CreatePostPage extends State { ), ), style: ButtonStyle( - foregroundColor: MaterialStateProperty + foregroundColor: WidgetStateProperty .all(Colors.white), backgroundColor: - MaterialStateProperty.all( + WidgetStateProperty.all( Color.fromARGB( 255, 72, 115, 235)), - shape: MaterialStateProperty.all< + shape: WidgetStateProperty.all< RoundedRectangleBorder>( RoundedRectangleBorder( borderRadius: @@ -211,7 +209,7 @@ class _CreatePostPage extends State { bottom: BorderSide( width: 1, color: theme - .colorScheme.surfaceVariant))), + .colorScheme.surfaceContainerHighest))), child: ListTile( leading: NullableCircleAvatar( (click == true) @@ -249,16 +247,16 @@ class _CreatePostPage extends State { : Icons.sentiment_neutral), style: ButtonStyle( foregroundColor: (click == true) - ? MaterialStateProperty.all( + ? WidgetStateProperty.all( Colors.grey) - : MaterialStateProperty.all( + : WidgetStateProperty.all( Colors.white), backgroundColor: (click == true) - ? MaterialStateProperty.all( + ? WidgetStateProperty.all( Colors.white) - : MaterialStateProperty.all( + : WidgetStateProperty.all( Colors.black), - shape: MaterialStateProperty.all< + shape: WidgetStateProperty.all< RoundedRectangleBorder>( RoundedRectangleBorder( borderRadius: diff --git a/lib/src/routes/event_form.dart b/lib/src/routes/event_form.dart index 419120c8..28e7e442 100644 --- a/lib/src/routes/event_form.dart +++ b/lib/src/routes/event_form.dart @@ -16,9 +16,9 @@ import 'package:InstiApp/src/utils/event_form_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/src/widgets/form.dart' as flut; import 'package:flutter/material.dart'; -import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:image_picker/image_picker.dart'; import 'package:multi_select_flutter/multi_select_flutter.dart'; +import 'package:flutter_typeahead/flutter_typeahead.dart'; class CreateEventBtn extends StatelessWidget { final GlobalKey formKey; @@ -39,9 +39,9 @@ class CreateEventBtn extends StatelessWidget { }, child: Text(isEditing ? 'Update' : 'Create'), style: TextButton.styleFrom( - primary: Colors.black, + foregroundColor: Colors.black, backgroundColor: Colors.amber, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey.withOpacity(0.38), elevation: 5.0), ), ); @@ -65,9 +65,9 @@ class DeleteEventBtn extends StatelessWidget { style: TextStyle(color: Colors.white), ), style: TextButton.styleFrom( - primary: Colors.black, + foregroundColor: Colors.black, backgroundColor: Colors.red, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey.withOpacity(0.38), elevation: 5.0), ), ); @@ -159,9 +159,9 @@ class _AchievementAdderState extends State { }); }, style: TextButton.styleFrom( - primary: Colors.black, + foregroundColor: Colors.black, backgroundColor: Colors.amber, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey.withOpacity(0.38), elevation: 5.0, ), ), @@ -831,41 +831,45 @@ class _EventFormState extends State { .map( (venue) => Padding( padding: const EdgeInsets.all(8.0), - child: TypeAheadFormField( - noItemsFoundBuilder: (ctx) => - Text("No Venue Found."), + child: TypeAheadField( + emptyBuilder: (ctx) => Text("No Venue Found."), + builder: (context, controller, focusNode) { + return TextField( + controller: venue, + focusNode: focusNode, + autofocus: true, + decoration: InputDecoration( + label: Text('Venue'), + suffixIcon: IconButton( + icon: (venues.indexOf(venue) > 0) + ? Icon(Icons.remove) + : Icon(Icons.add), + onPressed: () { + int index = venues.indexOf(venue); + if (venues.length > 1 && (index != 0)) { + setState(() { + eventVenues.removeAt(index); + venues.remove(venue); + }); + } else { + setState(() { + eventVenues.add(Venue()); + venues.add(TextEditingController()); + }); + } + }, + ), + )); + }, // initialValue: eventVenues[venues.indexOf(venue)].venueShortName!, - textFieldConfiguration: TextFieldConfiguration( - controller: venue, - decoration: InputDecoration( - label: Text('Venue'), - suffixIcon: IconButton( - icon: (venues.indexOf(venue) > 0) - ? Icon(Icons.remove) - : Icon(Icons.add), - onPressed: () { - int index = venues.indexOf(venue); - if (venues.length > 1 && (index != 0)) { - setState(() { - eventVenues.removeAt(index); - venues.remove(venue); - }); - } else { - setState(() { - eventVenues.add(Venue()); - venues.add(TextEditingController()); - }); - } - }, - ), - )), suggestionsCallback: (String q) => venueOptions .where((element) => (element.venueName! + element.venueShortName!) .toLowerCase() - .contains(q.toLowerCase())), + .contains(q.toLowerCase())) + .toList(), - onSuggestionSelected: (Venue v) { + onSelected: (Venue v) { int venueIndex = venues.indexOf(venue); setState(() { // venues[venueIndex].clear(); diff --git a/lib/src/routes/eventpage.dart b/lib/src/routes/eventpage.dart index b2537345..71257f17 100644 --- a/lib/src/routes/eventpage.dart +++ b/lib/src/routes/eventpage.dart @@ -191,11 +191,11 @@ class _EventPageState extends State { children: [ Text( event!.eventName ?? "", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), SizedBox(height: 8.0), Text(event!.getSubTitle(), - style: theme.textTheme.headline6), + style: theme.textTheme.titleLarge), ], ), ), @@ -218,7 +218,7 @@ class _EventPageState extends State { child: CommonHtml( data: event!.eventDescription ?? "", defaultTextStyle: - theme.textTheme.subtitle1 ?? TextStyle(), + theme.textTheme.titleMedium ?? TextStyle(), ), ), SizedBox( @@ -246,7 +246,7 @@ class _EventPageState extends State { child: Text( event!.eventLongDescription ?? "", style: - theme.textTheme.subtitle1 ?? TextStyle(), + theme.textTheme.titleMedium ?? TextStyle(), ), ) : null, @@ -269,9 +269,7 @@ class _EventPageState extends State { Navigator.of(context).pop(); }, style: TextButton.styleFrom( - primary: Colors.black, - backgroundColor: Colors.amber, - onSurface: Colors.grey, + foregroundColor: Colors.black, backgroundColor: Colors.amber, disabledForegroundColor: Colors.grey.withOpacity(0.38), elevation: 5.0, ), ), @@ -296,9 +294,7 @@ class _EventPageState extends State { Navigator.of(context).pop(); }, style: TextButton.styleFrom( - primary: Colors.black, - backgroundColor: Colors.amber, - onSurface: Colors.grey, + foregroundColor: Colors.black, backgroundColor: Colors.amber, disabledForegroundColor: Colors.grey.withOpacity(0.38), elevation: 5.0, ), ), @@ -338,8 +334,8 @@ class _EventPageState extends State { Widget _buildBodyTile(InstiAppBloc bloc, TextTheme theme, Body body) { return ListTile( - title: Text(body.bodyName ?? "", style: theme.headline6), - subtitle: Text(body.bodyShortDescription ?? "", style: theme.subtitle2), + title: Text(body.bodyName ?? "", style: theme.titleLarge), + subtitle: Text(body.bodyShortDescription ?? "", style: theme.titleSmall), leading: NullableCircleAvatar( body.bodyImageURL ?? defUrl, Icons.work_outline_outlined, @@ -355,12 +351,11 @@ class _EventPageState extends State { String name, UES uesButton, ThemeData theme, InstiAppBloc bloc) { return ElevatedButton( style: ElevatedButton.styleFrom( - primary: event?.eventUserUes == uesButton + foregroundColor: event?.eventUserUes == uesButton + ? theme.floatingActionButtonTheme.foregroundColor + : theme.textTheme.bodyLarge?.color, backgroundColor: event?.eventUserUes == uesButton ? theme.colorScheme.secondary : theme.scaffoldBackgroundColor, - onPrimary: event?.eventUserUes == uesButton - ? theme.floatingActionButtonTheme.foregroundColor - : theme.textTheme.bodyText1?.color, shape: RoundedRectangleBorder( side: BorderSide( color: theme.colorScheme.secondary, diff --git a/lib/src/routes/explorepage.dart b/lib/src/routes/explorepage.dart index 75e9de1f..b3e35165 100644 --- a/lib/src/routes/explorepage.dart +++ b/lib/src/routes/explorepage.dart @@ -135,7 +135,7 @@ class _ExplorePageState extends State { Expanded( child: Text( widget.title, - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ), AnimatedContainer( @@ -179,14 +179,14 @@ class _ExplorePageState extends State { duration: Duration(milliseconds: 500), child: TextField( controller: _searchFieldController, - cursorColor: theme.textTheme.bodyText2?.color, - style: theme.textTheme.bodyText2, + cursorColor: theme.textTheme.bodyMedium?.color, + style: theme.textTheme.bodyMedium, focusNode: _focusNode, decoration: InputDecoration( border: OutlineInputBorder( borderRadius: BorderRadius.circular(30)), - labelStyle: theme.textTheme.bodyText2, - hintStyle: theme.textTheme.bodyText2, + labelStyle: theme.textTheme.bodyMedium, + hintStyle: theme.textTheme.bodyMedium, prefixIcon: Icon( Icons.search_outlined, ), @@ -262,7 +262,7 @@ class _ExplorePageState extends State { Padding( padding: EdgeInsets.symmetric(horizontal: 28.0, vertical: 8.0), child: - Text.rich(TextSpan(style: theme.textTheme.headline6, children: [ + Text.rich(TextSpan(style: theme.textTheme.titleLarge, children: [ TextSpan(text: "Nothing found for the query "), TextSpan( text: "\"${exploreBloc.query}\"", @@ -328,7 +328,7 @@ class _ExplorePageState extends State { ), title: Text( title, - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), subtitle: Text(subtitle), onTap: onClick, diff --git a/lib/src/routes/feedpage.dart b/lib/src/routes/feedpage.dart index 47b5ef33..5bad611f 100644 --- a/lib/src/routes/feedpage.dart +++ b/lib/src/routes/feedpage.dart @@ -84,7 +84,7 @@ class _FeedPageState extends State { Expanded( child: Text( "Feed", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ), AnimatedContainer( @@ -190,7 +190,7 @@ class _FeedPageState extends State { EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), title: Text( event.eventName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, subtitle: Text(event.getSubTitle()), @@ -202,7 +202,7 @@ class _FeedPageState extends State { return ListTile( title: Text( event.eventName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( diff --git a/lib/src/routes/loginpage.dart b/lib/src/routes/loginpage.dart index 097f6404..52f0cab6 100644 --- a/lib/src/routes/loginpage.dart +++ b/lib/src/routes/loginpage.dart @@ -59,9 +59,9 @@ class _LoginPageState extends State { void initState() { super.initState(); - WidgetsBinding.instance?.addPostFrameCallback((_) => setupNotifications( + WidgetsBinding.instance.addPostFrameCallback((_) => setupNotifications( widget.navigatorKey?.currentContext ?? context, widget.bloc)); - WidgetsBinding.instance?.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { String? args = ModalRoute.of(context)?.settings.arguments as String?; if (args != null) { ScaffoldMessenger.of(context).showSnackBar(SnackBar( @@ -138,7 +138,7 @@ class _LoginPageState extends State { ), Text( "InstiApp", - style: Theme.of(context).textTheme.headline4?.copyWith( + style: Theme.of(context).textTheme.headlineMedium?.copyWith( color: Theme.of(context).colorScheme.secondary), ), CircularProgressIndicatorExtended( diff --git a/lib/src/routes/lostandfoundfeedpage.dart b/lib/src/routes/lostandfoundfeedpage.dart index 82a9ed84..324fd9fe 100644 --- a/lib/src/routes/lostandfoundfeedpage.dart +++ b/lib/src/routes/lostandfoundfeedpage.dart @@ -5,7 +5,6 @@ import 'package:InstiApp/src/drawer.dart'; import 'package:InstiApp/src/utils/common_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; -import '../api/model/lostandfoundPost.dart'; import '../utils/title_with_backbutton.dart'; class LostNFoundPage extends StatefulWidget { @@ -147,7 +146,7 @@ class _LostpageState extends State { ), Text( "Login To View Lost and Found Posts", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -161,7 +160,7 @@ class _LostpageState extends State { TitleWithBackButton( child: Text( "Lost & Found (Beta)", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ), ), StreamBuilder>( @@ -269,7 +268,7 @@ class _LostpageState extends State { screen_h * 0.20 / 0.43, 11, 0, 50), child: Text( posts[index].name ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, overflow: TextOverflow.ellipsis, maxLines: 1, ), @@ -282,7 +281,7 @@ class _LostpageState extends State { ? posts[index].foundAt ?? "" : (posts[index].foundAt ?? "").substring(0, 10) + '...', - style: theme.textTheme.bodyText2, + style: theme.textTheme.bodyMedium, maxLines: 1, ), ), @@ -296,7 +295,7 @@ class _LostpageState extends State { (posts[index].claimed == true ? "Claimed" : "Not\nclaimed"), - style: theme.textTheme.bodyText1, + style: theme.textTheme.bodyLarge, textAlign: TextAlign.center, ) ], @@ -310,7 +309,7 @@ class _LostpageState extends State { size: ((myfont / 18 * 12).toInt()).toDouble(), ), Text(' ' + (posts[index].timeBefore ?? ""), - style: theme.textTheme.bodyText1!.copyWith( + style: theme.textTheme.bodyLarge!.copyWith( fontWeight: FontWeight.bold, )) ]), @@ -327,7 +326,7 @@ class _LostpageState extends State { (posts[index].description ?? ""), maxLines: 2, overflow: TextOverflow.ellipsis, - style: theme.textTheme.bodyText2, + style: theme.textTheme.bodyMedium, ), margin: EdgeInsets.fromLTRB( screen_h * 0.20 / 0.43, 43, 0, 0)), diff --git a/lib/src/routes/lostandfoundinfo.dart b/lib/src/routes/lostandfoundinfo.dart index 305f8bcd..2e310c6e 100644 --- a/lib/src/routes/lostandfoundinfo.dart +++ b/lib/src/routes/lostandfoundinfo.dart @@ -126,7 +126,7 @@ class _LostAndFoundInfoPageState extends State { child: Text(lnfPost?.foundAt ?? "", maxLines: 3, overflow: TextOverflow.ellipsis, - style: theme.textTheme.headline6 + style: theme.textTheme.titleLarge ?.copyWith(fontWeight: FontWeight.w100, fontSize: 20)), ), ), @@ -152,7 +152,7 @@ class _LostAndFoundInfoPageState extends State { child: Text(lnfPost?.name ?? "", maxLines: 3, overflow: TextOverflow.ellipsis, - style: theme.textTheme.headline5?.copyWith( + style: theme.textTheme.headlineSmall?.copyWith( fontWeight: FontWeight.bold, fontSize: 30, ) @@ -193,7 +193,7 @@ class _LostAndFoundInfoPageState extends State { child: Text( 'Claimed by ' + (lnfPost?.claimedBy?.userLDAPId ?? ""), - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleLarge?.copyWith( fontWeight: FontWeight.bold, fontSize: 17), ), @@ -204,7 +204,7 @@ class _LostAndFoundInfoPageState extends State { Text( 'Phone number - ' + (lnfPost?.contactDetails ?? ""), - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleLarge?.copyWith( fontWeight: FontWeight.bold, fontSize: 17), ), ], @@ -215,7 +215,7 @@ class _LostAndFoundInfoPageState extends State { lnfPost?.claimed == true ? "Claimed" : "Not Claimed", - style: theme.textTheme.headline4?.copyWith( + style: theme.textTheme.headlineMedium?.copyWith( fontSize: 25, fontWeight: FontWeight.w600), textAlign: TextAlign.left, ), diff --git a/lib/src/routes/messcalendarpage.dart b/lib/src/routes/messcalendarpage.dart index 28566330..caac06d8 100644 --- a/lib/src/routes/messcalendarpage.dart +++ b/lib/src/routes/messcalendarpage.dart @@ -86,7 +86,7 @@ class _MessCalendarPageState extends State { ), Text( "Login To Have Your Meal", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -106,7 +106,7 @@ class _MessCalendarPageState extends State { children: [ Text( "Mess Calendar", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), SizedBox( height: 18, @@ -153,21 +153,21 @@ class _MessCalendarPageState extends State { _eventIcon!); }, - headerTextStyle: theme.textTheme.headline6, + headerTextStyle: theme.textTheme.titleLarge, - weekendTextStyle: theme.textTheme.headline6 + weekendTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18) .copyWith(color: Colors.red[800]), - daysTextStyle: theme.textTheme.headline6 + daysTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18), - inactiveDaysTextStyle: theme.textTheme.headline6 + inactiveDaysTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18), - nextDaysTextStyle: theme.textTheme.headline6 + nextDaysTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18) .copyWith( color: theme.colorScheme.onSurface .withAlpha(150)), - prevDaysTextStyle: theme.textTheme.headline6 + prevDaysTextStyle: theme.textTheme.titleLarge ?.copyWith(fontSize: 18) .copyWith( color: theme.colorScheme.onSurface @@ -201,7 +201,7 @@ class _MessCalendarPageState extends State { theme.primaryColor.withOpacity(0.3), selectedDayButtonColor: theme.colorScheme.secondary, - selectedDayTextStyle: theme.textTheme.headline6 + selectedDayTextStyle: theme.textTheme.titleLarge ?.copyWith( color: theme.colorScheme.onSecondary), @@ -239,7 +239,7 @@ class _MessCalendarPageState extends State { false) ? "${snapshot.data?[_currentDate]?.length} Meals" : "No meals", - style: theme.textTheme.button?.copyWith( + style: theme.textTheme.labelLarge?.copyWith( color: theme.colorScheme.onSecondary, ), ), @@ -272,7 +272,7 @@ class _MessCalendarPageState extends State { return ListTile( title: Text( event.title ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, // leading: NullableCircleAvatar( diff --git a/lib/src/routes/messpage.dart b/lib/src/routes/messpage.dart index ab3c5997..a34970a0 100644 --- a/lib/src/routes/messpage.dart +++ b/lib/src/routes/messpage.dart @@ -72,11 +72,11 @@ class _MessPageState extends State { children: [ Text( "Mess Menu", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), Text( "If the menu is not accurate please contact your hostel council", - style: theme.textTheme.subtitle1, + style: theme.textTheme.titleMedium, ), ], ), @@ -149,7 +149,7 @@ class _MessPageState extends State { value: entry.key, )) .toList(), - style: theme.textTheme.subtitle1 + style: theme.textTheme.titleMedium ?.copyWith(color: theme.colorScheme.secondary), onChanged: (h) { setState(() { @@ -181,14 +181,14 @@ class _MessPageState extends State { children: [ Text( mess.getDayName(), - style: localTheme.headline5?.copyWith(fontWeight: FontWeight.bold), + style: localTheme.headlineSmall?.copyWith(fontWeight: FontWeight.bold), ), SizedBox( height: 8.0, ), Text( "Breakfast", - style: localTheme.headline6 + style: localTheme.titleLarge ?.copyWith(color: theme.colorScheme.secondary), ), ContentText(mess.breakfast ?? "", context), @@ -197,7 +197,7 @@ class _MessPageState extends State { ), Text( "Lunch", - style: localTheme.headline6 + style: localTheme.titleLarge ?.copyWith(color: theme.colorScheme.secondary), ), ContentText(mess.lunch ?? "", context), @@ -206,7 +206,7 @@ class _MessPageState extends State { ), Text( "Snacks", - style: localTheme.headline6 + style: localTheme.titleLarge ?.copyWith(color: theme.colorScheme.secondary), ), ContentText(mess.snacks ?? "", context), @@ -215,7 +215,7 @@ class _MessPageState extends State { ), Text( "Dinner", - style: localTheme.headline6 + style: localTheme.titleLarge ?.copyWith(color: theme.colorScheme.secondary), ), ContentText(mess.dinner ?? "", context), @@ -233,5 +233,5 @@ class _MessPageState extends State { class ContentText extends Text { ContentText(String data, BuildContext context) - : super(data, style: Theme.of(context).textTheme.subtitle1); + : super(data, style: Theme.of(context).textTheme.titleMedium); } diff --git a/lib/src/routes/nativemappage.dart b/lib/src/routes/nativemappage.dart index 05959fd0..fe54ada6 100644 --- a/lib/src/routes/nativemappage.dart +++ b/lib/src/routes/nativemappage.dart @@ -126,7 +126,7 @@ class _NativeMapPageState extends State { ), child: Text( v.venueName ?? "", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ), ), Container( diff --git a/lib/src/routes/notificationspage.dart b/lib/src/routes/notificationspage.dart index 891ea68b..6f8fb4e5 100644 --- a/lib/src/routes/notificationspage.dart +++ b/lib/src/routes/notificationspage.dart @@ -69,7 +69,7 @@ class _NotificationsPageState extends State { TitleWithBackButton( child: Text( widget.title, - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ) ] + @@ -120,7 +120,7 @@ class _NotificationsPageState extends State { Padding( padding: EdgeInsets.symmetric(horizontal: 28.0, vertical: 8.0), child: - Text.rich(TextSpan(style: theme.textTheme.headline6, children: [ + Text.rich(TextSpan(style: theme.textTheme.titleLarge, children: [ TextSpan(text: "No new "), TextSpan( text: "notifications", diff --git a/lib/src/routes/putentitypage.dart b/lib/src/routes/putentitypage.dart index 9c7317f9..d2d8ebec 100644 --- a/lib/src/routes/putentitypage.dart +++ b/lib/src/routes/putentitypage.dart @@ -94,7 +94,7 @@ class _PutEntityPageState extends State { ? Center( child: Text( "Permission Denined", - style: theme.textTheme.headline1, + style: theme.textTheme.displayLarge, ), ) : webview.WebView( diff --git a/lib/src/routes/qrpage.dart b/lib/src/routes/qrpage.dart index 939a7b60..181d0f62 100644 --- a/lib/src/routes/qrpage.dart +++ b/lib/src/routes/qrpage.dart @@ -94,7 +94,7 @@ class _QRPageState extends State { ), Text( "Login To View QR", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -106,7 +106,7 @@ class _QRPageState extends State { TitleWithBackButton( child: Text( "QR Code", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ), loading @@ -126,7 +126,7 @@ class _QRPageState extends State { ), Text( "Some error in generating QR", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -140,11 +140,11 @@ class _QRPageState extends State { margin: EdgeInsets.all(50), alignment: Alignment.center, height: MediaQuery.of(context).size.height / 2, - child: QrImage( + child: QrImageView( // data: '', data: '${qrString}', size: MediaQuery.of(context).size.width / 2, - foregroundColor: Colors.black, + // foregroundColor: Colors.black, embeddedImage: AssetImage( 'assets/buynsell/DevcomLogo.png'), ), diff --git a/lib/src/routes/queryaddpage.dart b/lib/src/routes/queryaddpage.dart index 98cf1242..d6f13d2a 100644 --- a/lib/src/routes/queryaddpage.dart +++ b/lib/src/routes/queryaddpage.dart @@ -1,11 +1,11 @@ import 'package:InstiApp/src/api/request/postFAQ_request.dart'; import 'package:InstiApp/src/api/response/secret_response.dart'; +import 'package:InstiApp/src/components/dropdowns.dart'; import 'package:flutter/material.dart'; import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:InstiApp/src/api/model/body.dart'; import 'package:InstiApp/src/utils/common_widgets.dart'; -import 'package:dropdown_search/dropdown_search.dart'; import 'package:InstiApp/src/api/model/event.dart'; import '../bloc_provider.dart'; import '../drawer.dart'; @@ -46,7 +46,7 @@ class _QueryAddPageState extends State { return Container( child: Text( "Select a Category", - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyLarge, ), ); } @@ -133,7 +133,7 @@ class _QueryAddPageState extends State { ), Text( "Login To Ask a Question", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -154,7 +154,7 @@ class _QueryAddPageState extends State { EdgeInsets.fromLTRB(15.0, 15.0, 10.0, 5.0), child: Text( "Couldn't find what you're looking for?", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, )), SizedBox( height: 40, @@ -192,39 +192,19 @@ class _QueryAddPageState extends State { SizedBox( height: 20.0, ), - DropdownSearch( - mode: Mode.DIALOG, - maxHeight: 700, - isFilteredOnline: false, - showSearchBox: true, - dropdownSearchDecoration: - InputDecoration( - labelText: "Category", - hintText: "Category", - ), - items: categories, + CustomDropdown( + emptyText: + "No events found. Refine your search!", onChanged: onCategoryChange, + label: "Category", + itemBuilder: + _customPopupItemBuilderCategory, + asyncItems: + bloc.achievementBloc.searchForSkill, dropdownBuilder: buildDropdownMenuItemsCategory, - popupItemBuilder: - _customPopupItemBuilderCategory, - popupSafeArea: PopupSafeAreaProps( - top: true, bottom: true), - scrollbarProps: ScrollbarProps( - isAlwaysShown: true, - thickness: 7, - ), - emptyBuilder: - (BuildContext context, String? _) { - return Container( - alignment: Alignment.center, - padding: EdgeInsets.all(20), - child: Text( - "No events found. Refine your search!", - style: theme.textTheme.subtitle1, - ), - ); - }, + style: theme.textTheme.titleMedium, + items: categories, ), ])), Container( @@ -263,9 +243,10 @@ class _QueryAddPageState extends State { }, child: Text('Submit Question'), style: TextButton.styleFrom( - primary: Colors.black, + foregroundColor: Colors.black, backgroundColor: Colors.amber, - onSurface: Colors.grey, + disabledForegroundColor: + Colors.grey.withOpacity(0.38), elevation: 5.0), ), ), @@ -293,7 +274,7 @@ class Card extends State { return ListTile( title: Text( widget.thing?.eventName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( @@ -327,7 +308,7 @@ class BodyCardState extends State { return ListTile( title: Text( widget.thing?.bodyName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( diff --git a/lib/src/routes/quicklinkspage.dart b/lib/src/routes/quicklinkspage.dart index 6fcdbd9c..8e9cbbaa 100644 --- a/lib/src/routes/quicklinkspage.dart +++ b/lib/src/routes/quicklinkspage.dart @@ -86,7 +86,7 @@ class _QuickLinksPageState extends State { TitleWithBackButton( child: Text( "Quick Links", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ), Divider(), diff --git a/lib/src/routes/settingspage.dart b/lib/src/routes/settingspage.dart index 4de48e29..7bb8ebbb 100644 --- a/lib/src/routes/settingspage.dart +++ b/lib/src/routes/settingspage.dart @@ -58,7 +58,7 @@ class _SettingsPageState extends State { TitleWithBackButton( child: Text( "Settings", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ) ]; @@ -69,7 +69,7 @@ class _SettingsPageState extends State { horizontal: 28.0, vertical: 12.0), child: Text( "Profile settings", - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleLarge?.copyWith( fontWeight: FontWeight.bold, color: theme.primaryColor), ), @@ -142,7 +142,7 @@ class _SettingsPageState extends State { left: 28.0, right: 28.0, top: 8.0, bottom: 24.0), child: Text( "App settings", - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleLarge?.copyWith( fontWeight: FontWeight.bold, color: theme.primaryColor), ), ), @@ -150,7 +150,7 @@ class _SettingsPageState extends State { padding: const EdgeInsets.symmetric(horizontal: 28.0), child: Text( "Default Homepage", - style: theme.textTheme.bodyText2?.copyWith( + style: theme.textTheme.bodyMedium?.copyWith( fontWeight: FontWeight.bold, color: theme.colorScheme.secondary), ), @@ -192,7 +192,7 @@ class _SettingsPageState extends State { top: 16.0, bottom: 12.0, left: 28.0, right: 28.0), child: Text( "App Theme", - style: theme.textTheme.bodyText2?.copyWith( + style: theme.textTheme.bodyMedium?.copyWith( fontWeight: FontWeight.bold, color: theme.colorScheme.secondary), ), diff --git a/lib/src/routes/userpage.dart b/lib/src/routes/userpage.dart index 68e911ef..d8f01deb 100644 --- a/lib/src/routes/userpage.dart +++ b/lib/src/routes/userpage.dart @@ -1,6 +1,6 @@ import 'dart:async'; import 'dart:math'; -import 'package:dropdown_search/dropdown_search.dart'; +import 'package:InstiApp/src/components/dropdowns.dart'; import 'package:InstiApp/src/api/model/body.dart'; import 'package:InstiApp/src/api/model/event.dart'; import 'package:InstiApp/src/api/model/role.dart'; @@ -130,7 +130,7 @@ class _UserPageState extends State { return Container( child: Text( "Search for an interest", - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyLarge, ), ); } @@ -177,7 +177,7 @@ class _UserPageState extends State { user = u; } }); - WidgetsBinding.instance?.addPostFrameCallback((timeStamp) { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { var bloc = BlocProvider.of(context)?.bloc; bloc?.getUser("me").then((result) { if (result.userLDAPId == widget.initialUser?.userLDAPId) { @@ -270,16 +270,17 @@ class _UserPageState extends State { ), title: Text( user!.userName ?? "", - style: theme.textTheme.headline5?.copyWith( - fontFamily: theme - .textTheme.headline3?.fontFamily), + style: theme.textTheme.headlineSmall + ?.copyWith( + fontFamily: theme.textTheme + .displaySmall?.fontFamily), ), subtitle: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ user!.userRollNumber != null ? Text(user!.userRollNumber ?? "", - style: theme.textTheme.headline6) + style: theme.textTheme.titleLarge) : CircularProgressIndicatorExtended( size: 12, label: Text("Loading Roll Number"), @@ -298,8 +299,8 @@ class _UserPageState extends State { message: "E-mail this person", child: user!.userEmail != null ? Text(user!.userEmail!, - style: theme - .textTheme.headline6 + style: theme.textTheme + .titleLarge ?.copyWith( color: Colors .lightBlue)) @@ -325,7 +326,7 @@ class _UserPageState extends State { child: Text( user!.userContactNumber!, style: theme - .textTheme.headline6 + .textTheme.titleLarge ?.copyWith( color: Colors .lightBlue)), @@ -352,61 +353,30 @@ class _UserPageState extends State { SizedBox( height: 20.0, ), + cansee - ? DropdownSearch( - mode: Mode.DIALOG, - maxHeight: 700, - isFilteredOnline: true, - showSearchBox: true, - dropdownSearchDecoration: - InputDecoration( - labelText: "Interests", - hintText: "Interests", - ), + ? CustomDropdown( + emptyText: + "No interests found. Refine your search!", + onChanged: onBodyChange, + label: "Interests", + itemBuilder: + _customPopupItemBuilderInterest, + asyncItems: bloc + .achievementBloc + .searchForInterest, + dropdownBuilder: + buildDropdownMenuItemsInterest, + style: theme.textTheme + .titleMedium, validator: (value) { if (value == null) { return 'Please select a organization'; } return null; }, - onChanged: onBodyChange, - onFind: bloc - .achievementBloc - .searchForInterest, - dropdownBuilder: - buildDropdownMenuItemsInterest, - popupItemBuilder: - _customPopupItemBuilderInterest, - // popupSafeArea: - // PopupSafeArea( - // top: true, - // bottom: true), - scrollbarProps: - ScrollbarProps( - isAlwaysShown: true, - thickness: 7, - ), selectedItem: _selectedInterest, - emptyBuilder: - (BuildContext context, - String? _) { - return Container( - alignment: - Alignment.center, - padding: - EdgeInsets.all( - 20), - child: Text( - "No interests found. Refine your search!", - style: theme - .textTheme - .subtitle1, - textAlign: TextAlign - .center, - ), - ); - }, ) : SizedBox(), _buildChips(context), @@ -597,7 +567,7 @@ class _UserPageState extends State { return ListTile( title: Text( event.eventName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( @@ -614,8 +584,8 @@ class _UserPageState extends State { Widget _buildBodyTile(InstiAppBloc bloc, TextTheme theme, Body body) { return ListTile( - title: Text(body.bodyName ?? "", style: theme.headline6), - subtitle: Text(body.bodyShortDescription ?? "", style: theme.subtitle2), + title: Text(body.bodyName ?? "", style: theme.titleLarge), + subtitle: Text(body.bodyShortDescription ?? "", style: theme.titleSmall), leading: NullableCircleAvatar( body.bodyImageURL ?? "", Icons.people_outline_outlined, @@ -629,8 +599,9 @@ class _UserPageState extends State { Widget _buildRoleTile(InstiAppBloc bloc, TextTheme theme, Role role) { return ListTile( - title: Text(role.roleBodyDetails?.bodyName ?? "", style: theme.headline6), - subtitle: Text(role.roleName ?? "", style: theme.subtitle2), + title: + Text(role.roleBodyDetails?.bodyName ?? "", style: theme.titleLarge), + subtitle: Text(role.roleName ?? "", style: theme.titleSmall), leading: NullableCircleAvatar( role.roleBodyDetails?.bodyImageURL ?? "", Icons.people_outline_outlined, @@ -644,9 +615,10 @@ class _UserPageState extends State { Widget _buildFormerRoleTile(InstiAppBloc bloc, TextTheme theme, Role role) { return ListTile( - title: Text(role.roleBodyDetails?.bodyName ?? "", style: theme.headline6), + title: + Text(role.roleBodyDetails?.bodyName ?? "", style: theme.titleLarge), subtitle: Text("Former ${role.roleName} ${role.year ?? ""}", - style: theme.subtitle2), + style: theme.titleSmall), leading: NullableCircleAvatar( role.roleBodyDetails?.bodyImageURL ?? "", Icons.people_outline_outlined, diff --git a/lib/src/routes/verify_ach.dart b/lib/src/routes/verify_ach.dart index 08f400d3..84fd30bd 100644 --- a/lib/src/routes/verify_ach.dart +++ b/lib/src/routes/verify_ach.dart @@ -80,7 +80,7 @@ class _VerifyAchPageState extends State { SliverToBoxAdapter( child: Text( "Verify", - style: theme.textTheme.headline3, + style: theme.textTheme.displaySmall, ), ), SliverToBoxAdapter( @@ -246,7 +246,7 @@ class _VerifyListItemState extends State { }, child: Text(verifyText), style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Colors.deepPurple), + backgroundColor: WidgetStateProperty.all(Colors.deepPurple), ), ), ElevatedButton( @@ -264,8 +264,8 @@ class _VerifyListItemState extends State { ), style: ButtonStyle( backgroundColor: isVerified || isDismissed - ? MaterialStateProperty.all(Colors.grey) - : MaterialStateProperty.all(Colors.yellow), + ? WidgetStateProperty.all(Colors.grey) + : WidgetStateProperty.all(Colors.yellow), ), ), TextButton( @@ -277,7 +277,7 @@ class _VerifyListItemState extends State { style: TextStyle(color: Colors.red), ), style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Colors.transparent), + backgroundColor: WidgetStateProperty.all(Colors.transparent), ), ), ], diff --git a/lib/src/routes/your_achievements.dart b/lib/src/routes/your_achievements.dart index f446ec9a..5b9d21fa 100644 --- a/lib/src/routes/your_achievements.dart +++ b/lib/src/routes/your_achievements.dart @@ -75,7 +75,7 @@ class _YourAchievementPageState extends State { ), Text( "Login To View Achievements", - style: theme.textTheme.headline5, + style: theme.textTheme.headlineSmall, textAlign: TextAlign.center, ) ], @@ -102,7 +102,7 @@ class _YourAchievementPageState extends State { child: TitleWithBackButton( child: Text( "Verify", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ), ), ); @@ -148,7 +148,7 @@ class _YourAchievementPageState extends State { child: TitleWithBackButton( child: Text( "Your Acheivements", - style: theme.textTheme.headline4, + style: theme.textTheme.headlineMedium, ), ), ), @@ -329,7 +329,7 @@ class BodyCardState extends State { return ListTile( title: Text( widget.thing?.bodyName ?? "", - style: theme.textTheme.headline6, + style: theme.textTheme.titleLarge, ), enabled: true, leading: NullableCircleAvatar( diff --git a/lib/src/utils/common_widgets.dart b/lib/src/utils/common_widgets.dart index 076bfaff..0331b024 100644 --- a/lib/src/utils/common_widgets.dart +++ b/lib/src/utils/common_widgets.dart @@ -1,6 +1,7 @@ import 'dart:async'; // import 'package:InstiApp/src/blocs/ia_bloc.dart'; +import 'package:InstiApp/src/components/dropdowns.dart'; import 'package:flutter_linkify/flutter_linkify.dart'; import 'package:InstiApp/src/blocs/ia_bloc.dart'; import 'package:InstiApp/src/routes/communitypostpage.dart'; @@ -9,7 +10,6 @@ import 'package:InstiApp/src/api/model/communityPost.dart'; import 'package:InstiApp/src/routes/createpost_form.dart'; import 'package:InstiApp/src/routes/userpage.dart'; import 'package:InstiApp/src/utils/share_url_maker.dart'; -import 'package:dropdown_search/dropdown_search.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; @@ -1323,7 +1323,8 @@ class _CommunityPostWidgetState extends State { decoration: BoxDecoration( border: Border( bottom: BorderSide( - width: 1, color: theme.colorScheme.surfaceVariant))), + width: 1, + color: theme.colorScheme.surfaceContainerHighest))), child: ListTile( leading: NullableCircleAvatar( isAnon @@ -1568,7 +1569,7 @@ class _CommunityPostWidgetState extends State { ? [ new TextSpan( text: 'Read More.', - style: theme.textTheme.subtitle2?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.colorScheme.primary), // recognizer: new TapGestureRecognizer() // ..onTap = () => setState(() { @@ -1715,7 +1716,8 @@ class _CommunityPostWidgetState extends State { padding: EdgeInsets.all(5), decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), - color: theme.colorScheme.surfaceVariant, + color: + theme.colorScheme.surfaceContainerHighest, ), child: Row( children: emojis @@ -1795,8 +1797,8 @@ class _CommunityPostWidgetState extends State { flex: 1, child: TextButton( style: TextButton.styleFrom( - backgroundColor: theme.colorScheme.surfaceVariant, - primary: theme.colorScheme.onSurfaceVariant, + foregroundColor: theme.colorScheme.onSurfaceVariant, + backgroundColor: theme.colorScheme.surfaceContainerHighest, ), child: Text("Disapprove"), onPressed: () { @@ -1810,8 +1812,8 @@ class _CommunityPostWidgetState extends State { flex: 1, child: TextButton( style: TextButton.styleFrom( + foregroundColor: theme.colorScheme.primary, backgroundColor: theme.colorScheme.primaryContainer, - primary: theme.colorScheme.primary, ), child: Text("Approve"), onPressed: () { @@ -1833,8 +1835,8 @@ class _CommunityPostWidgetState extends State { flex: 1, child: TextButton( style: TextButton.styleFrom( - backgroundColor: theme.colorScheme.surfaceVariant, - primary: theme.colorScheme.onSurfaceVariant, + foregroundColor: theme.colorScheme.onSurfaceVariant, + backgroundColor: theme.colorScheme.surfaceContainerHighest, ), child: Text("Ignore"), onPressed: () { @@ -1848,8 +1850,8 @@ class _CommunityPostWidgetState extends State { flex: 1, child: TextButton( style: TextButton.styleFrom( + foregroundColor: theme.colorScheme.primary, backgroundColor: theme.colorScheme.primaryContainer, - primary: theme.colorScheme.primary, ), child: Text("Delete"), onPressed: () { @@ -1979,7 +1981,7 @@ class _DropdownMultiSelectState extends State> { return Container( child: Text( "Search for an ${widget.singularObjectName}", - style: Theme.of(context).textTheme.bodyText1, + style: Theme.of(context).textTheme.bodyLarge, ), ); } @@ -2030,33 +2032,20 @@ class _DropdownMultiSelectState extends State> { SizedBox( height: 20.0, ), - DropdownSearch( - mode: Mode.DIALOG, - maxHeight: 700, - isFilteredOnline: true, - showSearchBox: true, - dropdownSearchDecoration: InputDecoration( - labelText: widget.pluralObjectName, - hintText: widget.pluralObjectName, - ), + CustomDropdown( + emptyText: + "No ${widget.pluralObjectName} found. Refine your search!", onChanged: onObjectChange, - onFind: widget.onFind, + label: widget.pluralObjectName, + itemBuilder: _customPopupItemBuilder, + asyncItems: widget.onFind, dropdownBuilder: buildDropdownMenuItems, - popupItemBuilder: _customPopupItemBuilder, - scrollbarProps: ScrollbarProps( - isAlwaysShown: true, - thickness: 7, - ), - emptyBuilder: (BuildContext context, String? _) { - return Container( - alignment: Alignment.center, - padding: EdgeInsets.all(20), - child: Text( - "No ${widget.pluralObjectName} found. Refine your search!", - style: theme.textTheme.subtitle1, - textAlign: TextAlign.center, - ), - ); + style: theme.textTheme.titleMedium, + validator: (value) { + // if (value == null) { + // return 'Please select a Skill'; + // } + return null; }, ), _buildChips(context), diff --git a/lib/src/utils/customappbar.dart b/lib/src/utils/customappbar.dart index 744905a5..f6a54e1f 100644 --- a/lib/src/utils/customappbar.dart +++ b/lib/src/utils/customappbar.dart @@ -89,7 +89,7 @@ class _CustomAppBarState extends State { controller: _searchFieldController, cursorColor: widget.transparentBackground ? Colors.white - : theme!.textTheme.bodyText2?.color, + : theme!.textTheme.bodyMedium?.color, style: theme!.textTheme.bodyLarge?.copyWith( color: widget.transparentBackground ? Colors.white : null), focusNode: widget.appBarSearchStyle.focusNode, @@ -137,7 +137,7 @@ class _CustomAppBarState extends State { backgroundColor: widget.transparentBackground ? Colors.transparent : theme!.colorScheme.surface, - foregroundColor: theme!.colorScheme.onBackground, + foregroundColor: theme!.colorScheme.onSurface, actions: actionButtons, elevation: 0, leading: widget.leadingStyle != null diff --git a/lib/src/utils/notif_settings.dart b/lib/src/utils/notif_settings.dart index a84e4c16..17508e45 100644 --- a/lib/src/utils/notif_settings.dart +++ b/lib/src/utils/notif_settings.dart @@ -109,23 +109,23 @@ List notifChannels = [ /// List of channel groups used in the app List notifGroups = [ NotificationChannelGroup( - channelGroupkey: NotificationGroups.MISCELLANEOUS_GROUP, + channelGroupKey: NotificationGroups.MISCELLANEOUS_GROUP, channelGroupName: 'Miscellaneous', ), NotificationChannelGroup( - channelGroupkey: NotificationGroups.BLOG, + channelGroupKey: NotificationGroups.BLOG, channelGroupName: 'Blogs', ), NotificationChannelGroup( - channelGroupkey: NotificationGroups.NEWS, + channelGroupKey: NotificationGroups.NEWS, channelGroupName: 'News', ), NotificationChannelGroup( - channelGroupkey: NotificationGroups.COMMUNITY, + channelGroupKey: NotificationGroups.COMMUNITY, channelGroupName: 'Community', ), NotificationChannelGroup( - channelGroupkey: NotificationGroups.EVENT, + channelGroupKey: NotificationGroups.EVENT, channelGroupName: 'Events', ), ]; @@ -178,6 +178,54 @@ class NotificationType { static const String EXTERNAL = "externalblogentry"; } +class NotificationController { + @pragma("vm:entry-point") + static Future onNotificationCreatedMethod( + ReceivedNotification receivedNotification) async {} + + @pragma("vm:entry-point") + static Future onNotificationDisplayedMethod( + ReceivedNotification receivedNotification) async {} + + @pragma("vm:entry-point") + static Future onDismissActionReceivedMethod( + ReceivedAction receivedAction) async {} + + @pragma("vm:entry-point") + static Future onActionReceivedMethod( + customHandler, ReceivedAction receivedAction) async { + // Navigate into pages, avoiding to open the notification details page over another details page already opened + return customHandler(receivedAction); + } +} + +/// Gives the route to navigate to from a notification +String routeFromNotification(RichNotification fromMap) { + // Navigating to correct page + return { + NotificationType.BLOG: + fromMap.notificationExtra?.contains("/internship") ?? false + ? "/trainblog" + : "/placeblog", + NotificationType.PLACEMENT: "/placeblog", + NotificationType.COMMUNITY: + "/group/${fromMap.notificationObjectID ?? ""}", + NotificationType.COMMUNITYPOST: + "/communitypost/${fromMap.notificationObjectID ?? ""}", + NotificationType.COMMUNITYPOSTUSERREACTION: "/groups", + NotificationType.INTERNSHIP: "/trainblog", + NotificationType.BODY: "/body/${fromMap.notificationObjectID ?? ""}", + NotificationType.EVENT: "/event/${fromMap.notificationObjectID ?? ""}", + NotificationType.USER: "/user/${fromMap.notificationObjectID ?? ""}", + NotificationType.NEWS: "/news", + NotificationType.COMPLAINTS: + "/complaint/${fromMap.notificationExtra ?? ""}?reload=true", + NotificationType.QUERY: "/query", + NotificationType.EXTERNAL: "/externalblog", + }[fromMap.notificationType] ?? + "/"; +} + /// Setup notifications with awesome notifications /// /// [context] is the [BuildContext] of the app @@ -191,34 +239,6 @@ void setupNotifications(BuildContext context, InstiAppBloc bloc) async { /// Listen for incoming notifs and send a notification to the user FirebaseMessaging.onMessage.listen(sendMessage); - /// Gives the route to navigate to from a notification - String routeFromNotification(RichNotification fromMap) { - // Navigating to correct page - return { - NotificationType.BLOG: - fromMap.notificationExtra?.contains("/internship") ?? false - ? "/trainblog" - : "/placeblog", - NotificationType.PLACEMENT: "/placeblog", - NotificationType.COMMUNITY: - "/group/${fromMap.notificationObjectID ?? ""}", - NotificationType.COMMUNITYPOST: - "/communitypost/${fromMap.notificationObjectID ?? ""}", - NotificationType.COMMUNITYPOSTUSERREACTION: "/groups", - NotificationType.INTERNSHIP: "/trainblog", - NotificationType.BODY: "/body/${fromMap.notificationObjectID ?? ""}", - NotificationType.EVENT: - "/event/${fromMap.notificationObjectID ?? ""}", - NotificationType.USER: "/user/${fromMap.notificationObjectID ?? ""}", - NotificationType.NEWS: "/news", - NotificationType.COMPLAINTS: - "/complaint/${fromMap.notificationExtra ?? ""}?reload=true", - NotificationType.QUERY: "/query", - NotificationType.EXTERNAL: "/externalblog", - }[fromMap.notificationType] ?? - "/"; - } - /// Handle what action to take depending on key void _handleActionKey(String actionKey, RichNotification notif) async { // Open browser @@ -256,8 +276,24 @@ void setupNotifications(BuildContext context, InstiAppBloc bloc) async { } } - // Listen to app opens from notifications - AwesomeNotifications().actionStream.listen(_handleNotification); + AwesomeNotifications().setListeners( + onActionReceivedMethod: (ReceivedAction receivedAction) { + return NotificationController.onActionReceivedMethod( + _handleNotification, receivedAction); + }, + onNotificationCreatedMethod: (ReceivedNotification receivedNotification) { + return NotificationController.onNotificationCreatedMethod( + receivedNotification); + }, + onNotificationDisplayedMethod: (ReceivedNotification receivedNotification) { + return NotificationController.onNotificationDisplayedMethod( + receivedNotification); + }, + onDismissActionReceivedMethod: (ReceivedAction receivedAction) { + return NotificationController.onDismissActionReceivedMethod( + receivedAction); + }, + ); } void requestNotificationPermission( @@ -418,5 +454,5 @@ List? getActionButtons(RichNotification notif) { /// Remember to dispose the notification sink when app is closed void disposeNotification() { - AwesomeNotifications().actionSink.close(); + // AwesomeNotifications().actionSink.close(); } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 6d5c33d8..5feaa67a 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,26 +5,30 @@ import FlutterMacOS import Foundation -import device_info_plus_macos +import awesome_notifications +import device_info_plus +import file_selector_macos import firebase_core import firebase_messaging +import flutter_image_compress_macos import flutter_local_notifications -import flutter_native_timezone import location -import package_info_plus_macos -import path_provider_macos +import package_info_plus +import path_provider_foundation import shared_preferences_foundation import sqflite import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + AwesomeNotificationsPlugin.register(with: registry.registrar(forPlugin: "AwesomeNotificationsPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) + FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) - FlutterNativeTimezonePlugin.register(with: registry.registrar(forPlugin: "FlutterNativeTimezonePlugin")) LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) - FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) diff --git a/pubspec.yaml b/pubspec.yaml index 04cfe13e..7d9f5e5a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,67 +15,70 @@ environment: dependencies: flutter: sdk: flutter - camera: ^0.9.4+4 + camera: ^0.11.0+1 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. # cupertino_icons: ^1.0.1 url_launcher: ^6.0.17 - qr_code_scanner: ^0.6.1 - http: ^0.13.4 - rxdart: ^0.26.0 + qr_code_scanner: ^1.0.1 + http: ^1.2.1 + rxdart: ^0.27.7 flutter_widget_from_html_core: any fwfh_selectable_text: ^0.8.3 - markdown: ^4.0.1 + markdown: ^7.2.2 shared_preferences: ^2.0.10 date_format: ^2.0.4 share: ^2.0.4 - photo_view: ^0.13.0 - flutter_calendar_carousel: 2.1.0 + photo_view: ^0.15.0 + flutter_calendar_carousel: ^2.4.3 # google_maps_flutter: ^2.1.1 # flutter_google_places: ^0.3.0 - location: ^4.3.0 + location: ^6.0.2 flutter_material_color_picker: ^1.1.0+2 - flutter_typeahead: ^3.2.4 - image_picker: ^0.8.4+4 + flutter_typeahead: ^5.2.0 + image_picker: ^1.1.2 + firebase_messaging: ^11.2.3 - flutter_local_notifications: 9.1.5 + flutter_local_notifications: ^17.1.2 path_provider: ^2.0.8 cached_network_image: ^3.2.0 - flutter_image_compress: ^1.1.0 + flutter_image_compress: ^2.3.0 uni_links: ^0.5.1 - analyzer: ^2.8.0 + analyzer: ^6.4.1 flutter_dynamic_icon: ^2.0.0 device_calendar: ^4.2.0 - dropdown_search: ^2.0.1 - multi_select_flutter: 4.0.0 - retrofit: ^3.0.0 + dropdown_search: ^5.0.6 + multi_select_flutter: ^4.1.3 + retrofit: ^4.1.0 logger: any - dio: ^4.0.4 + dio: ^5.4.3+1 json_annotation: ^4.4.0 jaguar: ^3.0.12 jaguar_flutter_asset: ^3.0.0 - flutter_webview_pro: 3.0.1+3 - home_widget: ^0.1.5 + flutter_webview_pro: ^3.0.1+4 + home_widget: ^0.6.0 flutter_dotenv: ^5.1.0 - permission_handler: ^8.3.0 + permission_handler: ^11.3.1 qr_flutter: ^4.0.0 - intl: ^0.17.0 + intl: ^0.18.1 - awesome_notifications: ^0.6.21 - flutter_linkify: ^5.0.2 - upgrader: ^4.11.1 + awesome_notifications: ^0.8.2 + flutter_linkify: ^6.0.0 + upgrader: ^10.3.0 encrypt: ^5.0.1 + collection: any + timezone: any + firebase_core: any dev_dependencies: flutter_test: sdk: flutter - retrofit_generator: any - build_runner: any + retrofit_generator: '>=7.0.0 <8.0.0' + build_runner: '>=2.3.0 <4.0.0' + json_serializable: ^6.6.2 json_model: any - json_serializable: ^6.1.1 - firebase_core: 1.10.5 # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec @@ -140,4 +143,4 @@ dependency_overrides: firebase_dynamic_links_platform_interface: 0.2.0+5 firebase_performance_platform_interface: 0.1.0+5 firebase_app_installations_platform_interface: 0.1.0+6 - firebase_core_platform_interface: 4.2.2 + firebase_core_platform_interface: 4.2.2 \ No newline at end of file