Dashboard API's 1.1
parent
baa7182655
commit
fb8d6c7b20
@ -0,0 +1,3 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="21.655" height="24.033" viewBox="0 0 21.655 24.033">
|
||||||
|
<path id="Path_4726" data-name="Path 4726" d="M12.03.53C9.864-.713,8.107.305,8.107,2.8V21.229c0,2.5,1.757,3.516,3.923,2.275l16.106-9.237c2.167-1.243,2.167-3.258,0-4.5Z" transform="translate(-8.107 0)" fill="#fff"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 324 B |
@ -0,0 +1,8 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="93.613" height="93.613" viewBox="0 0 93.613 93.613">
|
||||||
|
<g id="fingerprint-scan_1_" data-name="fingerprint-scan (1)" transform="translate(0 0)" opacity="0.049">
|
||||||
|
<path id="Path_4635" data-name="Path 4635" d="M243.282,223.494a2.743,2.743,0,0,0,2.743-2.742V207.5a2.743,2.743,0,1,0-5.485,0v13.255A2.743,2.743,0,0,0,243.282,223.494Z" transform="translate(-196.559 -167.317)" fill="#fff"/>
|
||||||
|
<path id="Path_4636" data-name="Path 4636" d="M167.739,215.135A2.743,2.743,0,0,0,165,217.877c0,11.945-8.538,21.664-19.032,21.664s-19.032-9.718-19.032-21.664V202.967a2.743,2.743,0,1,0-5.485,0v14.911c0,14.97,11,27.149,24.517,27.149s24.517-12.179,24.517-27.149A2.743,2.743,0,0,0,167.739,215.135Z" transform="translate(-99.243 -163.615)" fill="#fff"/>
|
||||||
|
<path id="Path_4637" data-name="Path 4637" d="M243.282,232.819c7.516,0,13.63-6.7,13.63-14.946V202.96a2.743,2.743,0,0,0-5.485,0v14.911c0,5.217-3.654,9.461-8.145,9.461a2.743,2.743,0,0,0,0,5.485Z" transform="translate(-196.559 -163.611)" fill="#fff"/>
|
||||||
|
<path id="Path_4638" data-name="Path 4638" d="M90.871,24.37H79.481a39.852,39.852,0,0,0-7.619-12.733A33.489,33.489,0,0,0,46.722,0,33.49,33.49,0,0,0,21.581,11.639a39.854,39.854,0,0,0-7.617,12.73H2.743a2.743,2.743,0,1,0,0,5.485h9.609a43.839,43.839,0,0,0-1.033,9.5V54.262A41.449,41.449,0,0,0,21.581,81.974,33.49,33.49,0,0,0,46.722,93.613,33.49,33.49,0,0,0,71.864,81.974,41.45,41.45,0,0,0,82.126,54.262V39.345a43.839,43.839,0,0,0-1.033-9.49h9.777a2.743,2.743,0,0,0,0-5.485ZM46.722,5.485c11.747,0,21.933,7.705,26.826,18.885H67.158C62.762,17.043,55.243,12.2,46.722,12.2a2.743,2.743,0,0,0,0,5.485A17.967,17.967,0,0,1,60.456,24.37H19.9C24.788,13.19,34.974,5.485,46.722,5.485ZM76.641,54.262c0,18.674-13.421,33.866-29.919,33.866S16.8,72.936,16.8,54.262V39.351a37.925,37.925,0,0,1,1.2-9.5H36.2a15.572,15.572,0,0,0-3.107,9.5V54.262a2.743,2.743,0,1,0,5.485,0V39.351c0-5.217,3.654-9.461,8.145-9.461l17.1-.035a24.013,24.013,0,0,1,1.929,9.493h0a2.743,2.743,0,0,0,5.485,0h0a29.615,29.615,0,0,0-1.549-9.492h5.752a37.927,37.927,0,0,1,1.2,9.491V54.262Z" fill="#fff"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1,39 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mohem_flutter_app/api/dashboard_api_client.dart';
|
||||||
|
import 'package:mohem_flutter_app/classes/utils.dart';
|
||||||
|
import 'package:mohem_flutter_app/main.dart';
|
||||||
|
import 'package:mohem_flutter_app/models/dashboard/get_attendance_tracking_list_model.dart';
|
||||||
|
|
||||||
|
/// Mix-in [DiagnosticableTreeMixin] to have access to [debugFillProperties] for the devtool
|
||||||
|
// ignore: prefer_mixin
|
||||||
|
class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
|
||||||
|
bool isAttendanceTrackingLoading = true;
|
||||||
|
int isTimeRemainingInSeconds = 0;
|
||||||
|
GetAttendanceTracking? attendanceTracking;
|
||||||
|
|
||||||
|
fetchAttendanceTracking() async {
|
||||||
|
try {
|
||||||
|
attendanceTracking = await DashbaordApiClient().getAttendanceTracking();
|
||||||
|
isAttendanceTrackingLoading = false;
|
||||||
|
isTimeRemainingInSeconds = calculateSeconds("00:00:30");
|
||||||
|
notifyListeners();
|
||||||
|
} catch (ex) {
|
||||||
|
Utils.handleException(ex, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int calculateSeconds(String time) {
|
||||||
|
int hour = int.parse(time.split(":")[0]);
|
||||||
|
int mints = int.parse(time.split(":")[1]);
|
||||||
|
int seconds = int.parse(time.split(":")[2]);
|
||||||
|
return ((hour * 60 * 60) + (mints * 60) + seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
isAttendanceTrackingLoading = !isAttendanceTrackingLoading;
|
||||||
|
attendanceTracking?.pSwipeIn = "a";
|
||||||
|
isTimeRemainingInSeconds = calculateSeconds("00:00:30");
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
import 'package:easy_localization/src/public_ext.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
||||||
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
||||||
|
import 'package:shimmer/shimmer.dart';
|
||||||
|
|
||||||
|
class GetAttendanceTrackingShimmer extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color(0xff000000).withOpacity(.05),
|
||||||
|
blurRadius: 26,
|
||||||
|
offset: const Offset(0, -3),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
// SvgPicture.asset("assets/images/"),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true).toShimmer(),
|
||||||
|
16.height,
|
||||||
|
"07:55:12".toText10(color: Colors.white, isBold: true).toShimmer(),
|
||||||
|
3.height,
|
||||||
|
LocaleKeys.timeLeftToday.tr().toText10(color: Colors.white).toShimmer(),
|
||||||
|
9.height,
|
||||||
|
const ClipRRect(
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(20),
|
||||||
|
),
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
value: 0.7,
|
||||||
|
minHeight: 8,
|
||||||
|
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
|
||||||
|
backgroundColor: const Color(0xff196D73),
|
||||||
|
),
|
||||||
|
).toShimmer(),
|
||||||
|
],
|
||||||
|
).paddingOnly(top: 12, right: 15, left: 12),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [LocaleKeys.checkIn.tr().toText12(color: Colors.white).toShimmer(),],
|
||||||
|
).paddingOnly(left: 12),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 45,
|
||||||
|
height: 45,
|
||||||
|
// color: Colors.blue,
|
||||||
|
padding: const EdgeInsets.only(left: 14, right: 14),
|
||||||
|
).toShimmer(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue