Skip to content

Commit

Permalink
Merge pull request #64 from Prayas-Agrawal/migration
Browse files Browse the repository at this point in the history
Migration to flutter 3
  • Loading branch information
HariRags authored Aug 11, 2024
2 parents 865481c + 863e810 commit bf50ee3
Show file tree
Hide file tree
Showing 75 changed files with 2,613 additions and 1,531 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

1 change: 1 addition & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
KEY="Tolm_fRDkfoN5WMU4oUXWxNwmn1E0MmYlbeh1LA29cU=";
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.history
.svn/
*.env
.env
.fvm
# IntelliJ related
*.iml
Expand Down
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// }

android {
compileSdkVersion 32
compileSdkVersion 34
ndkVersion "26.1.10909125"

lintOptions {
Expand Down Expand Up @@ -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"
}

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions assets/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=5jyMJufq0Vk0aDlj9Hnudsj84UfbFZlYRUnn02Xd&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
>
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=MQXcx3EHMqoGW57dXM27j2HSzEpvGAARASXraRmX&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=5jyMJufq0Vk0aDlj9Hnudsj84UfbFZlYRUnn02Xd&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=gxzx6u7aw6wco6SJBioORPwum5Sug7OrIPrm8r2W&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/sso/account/login/?next=/sso/oauth/authorize/%3Fclient_id%3Dl3Scj8qKuIRqOg7eaAy54tC8AkEd03Hb9oss8gv7%26response_type%3Dcode%26scope%3Dbasic%2520profile%2520picture%2520sex%2520ldap%2520phone%2520insti_address%2520program%2520secondary_emails%26redirect_uri=https://redirecturi"> -->
LOG IN VIA SSO
Expand Down
4 changes: 2 additions & 2 deletions assets/login/login_dark.html
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
>
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=5jyMJufq0Vk0aDlj9Hnudsj84UfbFZlYRUnn02Xd&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=8iPdGfcUEoe6P3IHmQQ63CuPW4glQd1mbsdQtHkW&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=MQXcx3EHMqoGW57dXM27j2HSzEpvGAARASXraRmX&response_type=code&scope=basic%20profile%20picture%20sex%20ldap%20phone%20insti_address%20program%20secondary_emails&redirect_uri=https://www.insti.app/login-android.html"> -->
<!-- href="https://gymkhana.iitb.ac.in/profiles/oauth/authorize/?client_id=8iPdGfcUEoe6P3IHmQQ63CuPW4glQd1mbsdQtHkW&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
</a>
<div class="loading-circle" id="loadingSpinner"></div>
Expand Down
12 changes: 12 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand All @@ -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 ###################
38 changes: 0 additions & 38 deletions lib/generated_plugin_registrant.dart

This file was deleted.

46 changes: 31 additions & 15 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ class MyAppState extends State<MyApp> 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();
}
Expand Down Expand Up @@ -163,13 +163,10 @@ class MyAppState extends State<MyApp> 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
Expand All @@ -184,38 +181,57 @@ class MyAppState extends State<MyApp> 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<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) { return null; }
if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; }
return null;
}),
), radioTheme: RadioThemeData(
fillColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) { return null; }
if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; }
return null;
}),
), switchTheme: SwitchThemeData(
thumbColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
if (states.contains(WidgetState.disabled)) { return null; }
if (states.contains(WidgetState.selected)) { return widget.bloc.accentColor; }
return null;
}),
trackColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> 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);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/api/apiclient.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit bf50ee3

Please sign in to comment.