Skip to content

Commit

Permalink
Merge pull request #232 from vrrao01/election
Browse files Browse the repository at this point in the history
Election Pre Registration Form
  • Loading branch information
Hareesh-Nandigrama authored Mar 15, 2023
2 parents 9ef60eb + c14f119 commit bf1c6f2
Show file tree
Hide file tree
Showing 13 changed files with 855 additions and 12 deletions.
Binary file added assets/images/logoo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -217,6 +217,7 @@
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand All @@ -231,6 +232,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -375,7 +377,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 9LF97T55R7;
DEVELOPMENT_TEAM = 7T8XRG7HU9;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -507,7 +509,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 9LF97T55R7;
DEVELOPMENT_TEAM = 7T8XRG7HU9;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -533,7 +535,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 9LF97T55R7;
DEVELOPMENT_TEAM = 7T8XRG7HU9;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
41 changes: 41 additions & 0 deletions lib/pages/elections/election_login.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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({
Key? key,
}) :
super(key: key);


@override
State<ElectionLoginWebView> createState() => _ElectionLoginWebViewState();
}

class _ElectionLoginWebViewState extends State<ElectionLoginWebView> {

@override
void dispose() {
// TODO: implement dispose
WebviewCookieManager().clearCookies();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: WebView(
initialUrl: "https://swc.iitg.ac.in/elections_api/auth/accounts/microsoft/login/",
javascriptMode: JavascriptMode.unrestricted,
onPageFinished: (url) async {
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');
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => RegisterScreen(authCookie: cookies.join("; "))));
}
},
),
);
}
}
Loading

0 comments on commit bf1c6f2

Please sign in to comment.