-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
swciitg
committed
Aug 20, 2024
1 parent
f1bac09
commit 9b1c6bc
Showing
16 changed files
with
115 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.useAndroidX=true | ||
android.enableJetifier=true | ||
android.defaults.buildfeatures.buildconfig=true | ||
android.nonTransitiveRClass=false | ||
android.nonFinalResIds=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:onestop_dev/pages/elections/register_screen.dart'; | ||
import 'package:webview_cookie_manager/webview_cookie_manager.dart'; | ||
import 'package:webview_flutter/webview_flutter.dart'; | ||
|
||
class ElectionLoginWebView extends StatefulWidget { | ||
static const String id = "/electionView"; | ||
|
||
const ElectionLoginWebView({super.key}); | ||
|
||
@override | ||
State<ElectionLoginWebView> createState() => _ElectionLoginWebViewState(); | ||
} | ||
|
||
class _ElectionLoginWebViewState extends State<ElectionLoginWebView> { | ||
late WebViewController controller; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
controller = WebViewController() | ||
..setJavaScriptMode(JavaScriptMode.unrestricted) | ||
..setNavigationDelegate(NavigationDelegate( | ||
onPageFinished: (url) async { | ||
final nav = Navigator.of(context); | ||
if (url.startsWith('https://swc.iitg.ac.in/election_portal')) { | ||
List cookies = await WebviewCookieManager().getCookies( | ||
'https://swc.iitg.ac.in/elections_api/auth/login_success'); | ||
nav.pushReplacement(MaterialPageRoute( | ||
builder: (context) => | ||
RegisterScreen(authCookie: cookies.join("; ")))); | ||
} | ||
}, | ||
)) | ||
..loadRequest(Uri.parse( | ||
"https://swc.iitg.ac.in/elections_api/auth/accounts/microsoft/login/")); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
WebviewCookieManager().clearCookies(); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: WebViewWidget( | ||
controller: controller, | ||
), | ||
); | ||
} | ||
} | ||
// import 'package:flutter/material.dart'; | ||
// import 'package:onestop_dev/pages/elections/register_screen.dart'; | ||
// import 'package:webview_cookie_manager/webview_cookie_manager.dart'; | ||
// import 'package:webview_flutter/webview_flutter.dart'; | ||
// | ||
// class ElectionLoginWebView extends StatefulWidget { | ||
// static const String id = "/electionView"; | ||
// | ||
// const ElectionLoginWebView({super.key}); | ||
// | ||
// @override | ||
// State<ElectionLoginWebView> createState() => _ElectionLoginWebViewState(); | ||
// } | ||
// | ||
// class _ElectionLoginWebViewState extends State<ElectionLoginWebView> { | ||
// late WebViewController controller; | ||
// | ||
// @override | ||
// void initState() { | ||
// super.initState(); | ||
// controller = WebViewController() | ||
// ..setJavaScriptMode(JavaScriptMode.unrestricted) | ||
// ..setNavigationDelegate(NavigationDelegate( | ||
// onPageFinished: (url) async { | ||
// final nav = Navigator.of(context); | ||
// if (url.startsWith('https://swc.iitg.ac.in/election_portal')) { | ||
// List cookies = await WebviewCookieManager().getCookies( | ||
// 'https://swc.iitg.ac.in/elections_api/auth/login_success'); | ||
// nav.pushReplacement(MaterialPageRoute( | ||
// builder: (context) => | ||
// RegisterScreen(authCookie: cookies.join("; ")))); | ||
// } | ||
// }, | ||
// )) | ||
// ..loadRequest(Uri.parse( | ||
// "https://swc.iitg.ac.in/elections_api/auth/accounts/microsoft/login/")); | ||
// } | ||
// | ||
// @override | ||
// void dispose() { | ||
// WebviewCookieManager().clearCookies(); | ||
// super.dispose(); | ||
// } | ||
// | ||
// @override | ||
// Widget build(BuildContext context) { | ||
// return Scaffold( | ||
// body: WebViewWidget( | ||
// controller: controller, | ||
// ), | ||
// ); | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.