Skip to content

Commit

Permalink
magration to 1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KejariwalAyush committed Jan 24, 2021
1 parent 325b96c commit b3a4581
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 23 deletions.
2 changes: 1 addition & 1 deletion iter_aio/lib/Utilities/global_var.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var updateText = "New Update is Here!";

/// for helper
var cookie;
final mainUrl = "http://136.233.14.3:8282/CampusPortalSOA";
final mainUrl = "http://103.112.27.37:8282/CampusPortalSOA";
NoticesFetch nf;
LoginFetch loginFetch;
AttendanceFetch af;
Expand Down
11 changes: 7 additions & 4 deletions iter_aio/lib/components/splash_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:iteraio/MyHomePage.dart';
import 'package:iteraio/Utilities/global_var.dart';
import 'package:splashscreen/splashscreen.dart';
import 'package:iteraio/landing/LandingPage.dart';
import 'package:iteraio/pages/login_page.dart';
import 'package:iteraio/pages/attendance_page.dart';

class Splash extends StatelessWidget {
const Splash({
Expand All @@ -15,10 +17,11 @@ class Splash extends StatelessWidget {
seconds: 1,
//isLoading?sec:1,
navigateAfterSeconds: isLoggedIn != null
? isLoggedIn
? new MyHomePage()
: new LandingPage()
: new LandingPage(),
// ? isLoggedIn
// ? new MyHomePage()
// : new LandingPage()
? new AttendancePage()
: new LoginPage(),
title: new Text(
'ITER AIO\n\nAn all-in-one app for ITER',
textAlign: TextAlign.center,
Expand Down
8 changes: 6 additions & 2 deletions iter_aio/lib/helper/update_fetch.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'dart:convert';

import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:html/parser.dart';
import 'package:http/http.dart';
Expand Down Expand Up @@ -70,11 +70,13 @@ class UpdateFetch {
updateText = document.querySelector('div.markdown-body').text;
// print(updateText);
List links = document.querySelectorAll('div > ul > li > a > span ');
print(links.toString());
List<Map<String, String>> linkMap = [];
for (var link in links) {
linkMap.add({
'title': link.text,
});
log(link.text);
}
var dec = jsonDecode(json.encode(linkMap));
latestversion = dec[6]['title'];
Expand All @@ -91,7 +93,9 @@ class UpdateFetch {
// print(updatelink);

if (version.compareTo(latestversion) != 0) {
print('update available');
log(latestversion);
log('update available');
log(version);
isUpdateAvailable = true;
showSimpleNotification(
Text(
Expand Down
4 changes: 2 additions & 2 deletions iter_aio/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class _MyAppState extends State<MyApp> {
fontSize: 16.0,
);
}
isUpdateAvailable = await UpdateFetch().fetchupdate(context);
// isUpdateAvailable = await UpdateFetch().fetchupdate(context);
});
setState(() {
nf = NoticesFetch();
Expand All @@ -116,7 +116,7 @@ class _MyAppState extends State<MyApp> {
}

Future _getThingsOnStartup() async {
UpdateFetch().fetchupdate(context);
// UpdateFetch().fetchupdate(context);
clubsName = await clubs.get().then((QuerySnapshot querySnapshot) {
List<String> _list = [];
querySnapshot.docs.forEach((doc) {
Expand Down
1 change: 1 addition & 0 deletions iter_aio/lib/pages/attendance_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class _AttendancePageState extends State<AttendancePage> {
Icons.share,
),
onPressed: () {
// var x = new UpdateFetch().fetchupdate(context);
// Notify().showNotification(
// title: 'Share', body: 'Share Attendence');
ShareFilesAndScreenshotWidgets().shareScreenshot(
Expand Down
27 changes: 15 additions & 12 deletions iter_aio/lib/pages/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:iteraio/widgets/on_pop.dart';
import 'package:line_awesome_icons/line_awesome_icons.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:iteraio/landing/LandingPage.dart';
import 'package:iteraio/pages/attendance_page.dart';

class LoginPage extends StatefulWidget {
static const routeName = "/login-page";
Expand Down Expand Up @@ -154,16 +155,16 @@ class _LoginPageState extends State<LoginPage>
onPressed: () => Navigator.push(
context, MaterialPageRoute(builder: (context) => Notices())),
),
IconButton(
icon: new Icon(
Icons.home_outlined,
size: 20,
color:
brightness == Brightness.dark ? Colors.white : Colors.black,
),
onPressed: () => Navigator.push(context,
MaterialPageRoute(builder: (context) => LandingPage())),
),
// IconButton(
// icon: new Icon(
// Icons.home_outlined,
// size: 20,
// color:
// brightness == Brightness.dark ? Colors.white : Colors.black,
// ),
// onPressed: () => Navigator.push(context,
// MaterialPageRoute(builder: (context) => LandingPage())),
// ),
],
),
floatingActionButton: !_isLoggingIn
Expand Down Expand Up @@ -289,23 +290,25 @@ class _LoginPageState extends State<LoginPage>
),
onPressed: () async {
print('$regdNo : $password');
await _login(regdNo, password);
setState(() {
animationName = 'openEyes';
_isLoggingIn = true;
Future.delayed(Duration(seconds: 1)).whenComplete(() {
setState(() {
animationName = 'hello';
});
});
});
await _login(regdNo, password);
Future.delayed(Duration(seconds: 15))
.whenComplete(() => _setCredentials());
try {
if (loginFetch.finalLogin.status == 'success') {
isLoading = true;
_isLoggingIn = true;
Navigator.pushReplacementNamed(
context, MyHomePage.routeName);
context, AttendancePage.routeName);
// context, MyHomePage.routeName);
// Navigator.push(
// context,
// MaterialPageRoute(
Expand Down
1 change: 1 addition & 0 deletions iter_aio/lib/widgets/WebPageView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _WebPageViewState extends State<WebPageView> {
WebViewController controllerGlobal;

Future<bool> _exitApp(BuildContext context) async {
Navigator.pop(context);
if (await controllerGlobal.canGoBack()) {
print("onwill goback");
controllerGlobal.goBack();
Expand Down
4 changes: 2 additions & 2 deletions iter_aio/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter application.

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: 1.3.0+1
version: 1.4.0+1

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down Expand Up @@ -49,7 +49,7 @@ dependencies:
path_provider: ^1.6.22
path: ^1.7.0
# Url Handler
url_launcher: ^5.6.0
url_launcher: ^5.7.10
webview_flutter: ^1.0.7
# Report bugs
wiredash: ^0.1.0
Expand Down

0 comments on commit b3a4581

Please sign in to comment.