Skip to content

Commit c2dc979

Browse files
committed
up
1 parent d248cb9 commit c2dc979

File tree

16 files changed

+229
-122
lines changed

16 files changed

+229
-122
lines changed

lib/config.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Config {
2-
static const String APP_VERISON = "1.0.43+44";
2+
static const String APP_VERISON = "1.0.45+46";
33
static DateTime dummyTime = DateTime(
44
1,
55
1,

lib/utils/udpatepop.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import 'package:flutter/material.dart';
2+
import 'package:propview/views/updateScreen.dart';
23
import 'package:url_launcher/url_launcher.dart';
34

4-
versionErrorWiget(String version, BuildContext context, String uri) {
5+
versionErrorWiget(String version, BuildContext context) {
56
return showDialog(
67
context: context,
78
barrierDismissible: false,
@@ -16,11 +17,7 @@ versionErrorWiget(String version, BuildContext context, String uri) {
1617
style: TextStyle(fontWeight: FontWeight.bold),
1718
),
1819
onPressed: () async {
19-
if (await canLaunch(uri)) {
20-
await launch(uri);
21-
} else {
22-
throw 'Could not launch $uri';
23-
}
20+
Navigator.of(context).push(MaterialPageRoute(builder: (context)=> UpdateScreen()));
2421
},
2522
),
2623
],

lib/views/Admin/Attendance/AttendanceHome.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:collection/collection.dart';
2-
import 'package:flutter/cupertino.dart';
32
import "package:flutter/material.dart";
43
import 'package:flutter_typeahead/flutter_typeahead.dart';
54
import 'package:propview/config.dart';
@@ -176,7 +175,8 @@ class _AttendanceHomeState extends State<AttendanceHome>
176175
crossAxisAlignment: CrossAxisAlignment.start,
177176
children: [
178177
Text(
179-
user.name,
178+
user.name.split(" ").first,
179+
overflow: TextOverflow.ellipsis,
180180
style: Theme.of(context)
181181
.primaryTextTheme
182182
.headline5

lib/views/Admin/Inspection/inspectionHomeScreen.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class _InspectionHomeScreenState extends State<InspectionHomeScreen> {
2525
void initState() {
2626
super.initState();
2727
propertyElement = widget.propertyElement;
28+
print(propertyElement.propertyOwner.ownerName);
29+
print(propertyElement.tblSociety.socname);
2830
}
2931

3032
@override

lib/views/Admin/Profile/ProfileScreen.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import 'package:propview/utils/snackBar.dart';
2020
import 'package:propview/views/Admin/Profile/ExportAttendance.dart';
2121
import 'package:propview/views/NotifcationScreen.dart';
2222
import 'package:propview/views/loginScreen.dart';
23+
import 'package:propview/views/updateScreen.dart';
2324
import 'package:shared_preferences/shared_preferences.dart';
2425

2526
class ProfileScreen extends StatefulWidget {
@@ -327,6 +328,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
327328
Navigator.of(context).pushReplacement(
328329
MaterialPageRoute(builder: (context) => LoginScreen()));
329330
}),
331+
profileInfo('Update', '', Icons.mail, () {
332+
Navigator.of(context).push(MaterialPageRoute(
333+
builder: (context) => UpdateScreen(),
334+
));
335+
}),
330336
Padding(
331337
padding: EdgeInsets.all(12),
332338
child:

lib/views/Admin/landingPage.dart

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ import 'package:firebase_messaging/firebase_messaging.dart';
55
import 'package:flutter/material.dart';
66
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
77
import 'package:google_nav_bar/google_nav_bar.dart';
8-
import 'package:in_app_update/in_app_update.dart';
98
import 'package:propview/config.dart';
109
import 'package:propview/services/baseService.dart';
1110
import 'package:propview/utils/progressBar.dart';
12-
import 'package:propview/utils/snackBar.dart';
1311
import 'package:propview/utils/udpatepop.dart';
1412
import 'package:propview/views/Admin/Home/HomeScreen.dart';
1513
import 'package:propview/views/Admin/TaskManager/TaskManagerHome.dart';
@@ -41,7 +39,6 @@ class _LandingScreenState extends State<LandingScreen> {
4139
setState(() {
4240
isLoading = true;
4341
});
44-
await checkForUpdate();
4542
await checkVersion();
4643
initialiseLocalNotification();
4744
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
@@ -161,29 +158,11 @@ class _LandingScreenState extends State<LandingScreen> {
161158
});
162159
}
163160

164-
AppUpdateInfo _updateInfo;
165-
Future<void> checkForUpdate() async {
166-
InAppUpdate.checkForUpdate().then((info) {
167-
setState(() {
168-
_updateInfo = info;
169-
});
170-
}).catchError((e) {
171-
showInSnackBar(context, e.toString(), 800);
172-
});
173-
if (_updateInfo?.updateAvailability == UpdateAvailability.updateAvailable) {
174-
await InAppUpdate.performImmediateUpdate()
175-
.catchError((e) => showInSnackBar(context, e.toString(), 800));
176-
}
177-
}
178-
179161
checkVersion() async {
180162
var getVersion = await BaseService.getAppCurrentVersion();
181163
var responseMap = jsonDecode(getVersion);
182164
if (responseMap != Config.APP_VERISON) {
183-
versionErrorWiget(responseMap, context,
184-
"https://play.google.com/store/apps/details?id=com.propdial.propview");
185-
InAppUpdate.performImmediateUpdate()
186-
.catchError((e) => showInSnackBar(context, e.toString(), 800));
165+
versionErrorWiget(responseMap, context);
187166
}
188167
}
189168

lib/views/Employee/Attendance/AttendanceHome.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ class _AttendanceHomeState extends State<AttendanceHome>
164164
crossAxisAlignment: CrossAxisAlignment.start,
165165
children: [
166166
Text(
167-
user.name,
167+
user.name.split(" ").first,
168+
overflow: TextOverflow.ellipsis,
168169
style: Theme.of(context)
169170
.primaryTextTheme
170171
.headline5

lib/views/Employee/Attendance/SoloAttendanceScreen.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,6 @@ class _SoloAttendanceState extends State<SoloAttendance> {
101101
DateTime startTime = DateTime.parse(start);
102102
DateTime endTime = DateTime.parse(end);
103103
AttendanceElement tempAttendance;
104-
await MailService.sendMail(jsonEncode({
105-
"name": user.name,
106-
"type": "Punch Out",
107-
"lat": position.latitude,
108-
"long": position.longitude,
109-
110-
}));
111104
if (id != "-") {
112105
tempAttendance = await AttendanceService.getLogById(id);
113106
print(tempAttendance.toJson());

lib/views/Employee/Profile/ProfileScreen.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import 'package:propview/utils/routing.dart';
1919
import 'package:propview/utils/snackBar.dart';
2020
import 'package:propview/views/NotifcationScreen.dart';
2121
import 'package:propview/views/loginScreen.dart';
22+
import 'package:propview/views/updateScreen.dart';
2223

2324
class ProfileScreen extends StatefulWidget {
2425
@override
@@ -311,6 +312,10 @@ class _ProfileScreenState extends State<ProfileScreen> {
311312
await cacheData.emptyCache();
312313
Navigator.of(context).pushReplacement(
313314
MaterialPageRoute(builder: (context) => LoginScreen()));
315+
}), profileInfo('Update', '', Icons.mail, () {
316+
Navigator.of(context).push(MaterialPageRoute(
317+
builder: (context) => UpdateScreen(),
318+
));
314319
}),
315320
Padding(
316321
padding: EdgeInsets.all(12),

lib/views/Employee/landingPage.dart

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class _LandingScreenState extends State<LandingScreen> {
4242
setState(() {
4343
isLoading = true;
4444
});
45-
await checkForUpdate();
4645
await checkVersion();
4746
initialiseLocalNotification();
4847
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
@@ -162,27 +161,12 @@ class _LandingScreenState extends State<LandingScreen> {
162161
});
163162
}
164163

165-
AppUpdateInfo _updateInfo;
166-
Future<void> checkForUpdate() async {
167-
InAppUpdate.checkForUpdate().then((info) {
168-
setState(() {
169-
_updateInfo = info;
170-
});
171-
}).catchError((e) {
172-
showInSnackBar(context, e.toString(), 800);
173-
});
174-
if (_updateInfo?.updateAvailability == UpdateAvailability.updateAvailable) {
175-
await InAppUpdate.performImmediateUpdate()
176-
.catchError((e) => showInSnackBar(context, e.toString(), 800));
177-
}
178-
}
179164

180165
checkVersion() async {
181166
var getVersion = await BaseService.getAppCurrentVersion();
182167
var responseMap = jsonDecode(getVersion);
183168
if (responseMap != Config.APP_VERISON) {
184-
versionErrorWiget(responseMap, context,
185-
"https://play.google.com/store/apps/details?id=com.propdial.propview");
169+
versionErrorWiget(responseMap, context);
186170
}
187171
}
188172

@@ -257,15 +241,6 @@ class _LandingScreenState extends State<LandingScreen> {
257241
// ProfileScreen(),
258242
];
259243

260-
checkversion() async {
261-
var getVersion = await BaseService.getAppCurrentVersion();
262-
var responseMap = jsonDecode(getVersion);
263-
if (responseMap != Config.APP_VERISON) {
264-
versionErrorWiget(responseMap, context,
265-
"https://play.google.com/store/apps/details?id=com.propdial.propview");
266-
}
267-
}
268-
269244
@override
270245
Widget build(BuildContext context) {
271246
return Scaffold(

0 commit comments

Comments
 (0)