dev_v3.13.6_CS_V2
Haroon Amjad 1 year ago
parent 2c721830e9
commit 71861f9ba4

@ -70,40 +70,47 @@ class _HomePageState2 extends State<HomePage2> {
child: Container(
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
// stops: [0.1, 0.3, 0.5],
colors: [
Color(0xff2B35E),
Color(0xff596C7C),
],
image: DecorationImage(
image: AssetImage("assets/images/HealthSnap/background.png"),
fit: BoxFit.cover,
),
),
// decoration: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topRight,
// end: Alignment.bottomLeft,
// // stops: [0.1, 0.3, 0.5],
// colors: [
// Color(0xff2B35E),
// Color(0xff596C7C),
// ],
// ),
// ),
child: Stack(
children: [
SvgPicture.asset("assets/images/HealthSnap/background.svg", height: MediaQuery.sizeOf(context).height,width: MediaQuery.sizeOf(context).width),
// SvgPicture.asset("assets/images/HealthSnap/background.svg", height: MediaQuery.sizeOf(context).height,width: MediaQuery.sizeOf(context).width),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
mHeight(24.0),
SvgPicture.asset(
'assets/images/new/cloud_logo.svg',
'assets/images/HealthSnap/logo3.svg',
width: 80,
height: 80,
),
mHeight(96.0),
mHeight(82.0),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Welcome To",
style: TextStyle(color: Color(0XFF2B353E), fontSize: 22, letterSpacing: 1.28, fontWeight: FontWeight.normal),
style: TextStyle(color: Colors.white, fontSize: 24, letterSpacing: 1.28, fontWeight: FontWeight.normal),
),
Text(
"HealthSnap",
style: TextStyle(color: Color(0XFF2B353E), fontSize: 26, letterSpacing: 1.28, fontWeight: FontWeight.bold),
style: TextStyle(color: Colors.white, fontSize: 26, letterSpacing: 1.28, fontWeight: FontWeight.bold),
),
mHeight(84.0),
Row(
@ -159,7 +166,7 @@ class _HomePageState2 extends State<HomePage2> {
userId: 'dbd13e86-47f4-4a43-85f6-cf62fa750117');
Navigator.push(context, FadePage(page: VitalSigns(userInfo: userInfo)));
},
color: Color(0XFF2B353E),
color: CustomColors.accentColor,
disabledColor: CustomColors.grey,
),
],

@ -20,7 +20,7 @@ class ScanConditionChecklist extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Material(
color: Color(0xFF5d6b6c).withOpacity(.6),
color: Color(0xFF596C7C).withOpacity(0.7),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 32),

@ -24,7 +24,7 @@ class StartButton extends StatelessWidget {
: () {
if (!disabled) onPressed();
},
color: Colors.black,
color: Color(0xFF2B353E),
disabledColor: Colors.grey,
));
}

@ -3,6 +3,7 @@ import 'dart:math';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:lottie/lottie.dart';
import 'package:vital_sign_camera/vital_sign_camera.dart';
// import 'package:wakelock/wakelock.dart';
@ -14,20 +15,18 @@ import 'components/start_button.dart';
import 'result_screen.dart';
// import 'package:lottie/lottie.dart';
final UserInfo userInfo = UserInfo(
age: 30,
gender: Gender.male,
weight: 75,
// kg, Optional
height: 164,
// cm, Optional
waistCircumference: 83,
// cm Optional
userId: 'dbd13e86-47f4-4a43-85f6-cf62fa750117');
final VitalSignCameraConfig config = VitalSignCameraConfig(
apiKey: 'nIsZO45woSXSfIxsL1t79MWeIpsnGQr6B941MSF2',
serverId: ServerId.awsEnterpriseProd);
// final UserInfo userInfo = UserInfo(
// age: 30,
// gender: Gender.male,
// weight: 75,
// // kg, Optional
// height: 164,
// // cm, Optional
// waistCircumference: 83,
// // cm Optional
// userId: 'dbd13e86-47f4-4a43-85f6-cf62fa750117');
final VitalSignCameraConfig config = VitalSignCameraConfig(apiKey: 'nIsZO45woSXSfIxsL1t79MWeIpsnGQr6B941MSF2', serverId: ServerId.awsEnterpriseProd);
class VitalSigns extends StatefulWidget {
const VitalSigns({super.key, required this.userInfo});
@ -56,10 +55,8 @@ class _VitalSignsState extends State<VitalSigns> with RouteAware {
return queryCameraDevice(CameraPosition.front);
}
bool startedScanning =
false; // set true when start button is pressed, set false when health result is tapped or error occurs
bool isAllConditionsMet =
false; // check for the 6 scan conditions before enabling the start button
bool startedScanning = false; // set true when start button is pressed, set false when health result is tapped or error occurs
bool isAllConditionsMet = false; // check for the 6 scan conditions before enabling the start button
ScanConditions? _conditions;
GetHealthStage? _scanningStage;
@ -105,39 +102,27 @@ class _VitalSignsState extends State<VitalSigns> with RouteAware {
final deviceSize = MediaQuery.of(context).size;
return Stack(
children: [
VitalSignCamera(
onCreated: _onVitalSignCameraCreated,
isActive: isCameraActive,
userInfo: widget.userInfo,
config: config,
device: cameraDevice,
onVideoFrameProcessed: _onVideoFrameProcessed),
if (_scanningStage !=
GetHealthStage.idle) // show remaining time count down during scan
VitalSignCamera(onCreated: _onVitalSignCameraCreated, isActive: isCameraActive, userInfo: widget.userInfo, config: config, device: cameraDevice, onVideoFrameProcessed: _onVideoFrameProcessed),
if (_scanningStage != GetHealthStage.idle) // show remaining time count down during scan
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(bottom: 16.0),
child: ScanStatus(
stage: _scanningStage, remainingTime: _remainingTime),
child: ScanStatus(stage: _scanningStage, remainingTime: _remainingTime),
)),
if (mounted)
Column(children: [
Expanded(
child: CircularOverlay(
state: (_scanningStage == null ||
_scanningStage == GetHealthStage.idle)
? AnimationState.stop
: AnimationState.playing,
state: (_scanningStage == null || _scanningStage == GetHealthStage.idle) ? AnimationState.stop : AnimationState.playing,
)),
if (_conditions != null)
ScanConditionChecklist(
deviceSize: deviceSize, conditions: _conditions!),
// Lottie.asset('assets/breathing.json', width: 200, height: 200, fit: BoxFit.fill),
if (_conditions != null) ScanConditionChecklist(deviceSize: deviceSize, conditions: _conditions!),
SizedBox(
height: 16,
),
if (_scanningStage == GetHealthStage.idle &&
isCameraActive) // show start button only when it is not scanning
if (_scanningStage == GetHealthStage.idle && isCameraActive) // show start button only when it is not scanning
...{
StartButton(
onPressed: () {
@ -248,9 +233,7 @@ class _VitalSignsState extends State<VitalSigns> with RouteAware {
}
void _onVideoFrameProcessed(VideoFrameProcessedEvent event) {
if (!_showedHealthResult &&
_healthResult == null &&
event.healthResult?.health != null) {
if (!_showedHealthResult && _healthResult == null && event.healthResult?.health != null) {
_showedHealthResult = true;
Navigator.push(
context,
@ -304,15 +287,13 @@ enum AnimationState { playing, stop }
class CircularOverlay extends StatefulWidget {
final AnimationState state;
const CircularOverlay({Key? key, this.state = AnimationState.stop})
: super(key: key);
const CircularOverlay({Key? key, this.state = AnimationState.stop}) : super(key: key);
@override
State<CircularOverlay> createState() => _CircularOverlayState();
}
class _CircularOverlayState extends State<CircularOverlay>
with SingleTickerProviderStateMixin {
class _CircularOverlayState extends State<CircularOverlay> with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
@ -361,8 +342,7 @@ class _CircularOverlayState extends State<CircularOverlay>
builder: (context, child) {
return CustomPaint(
painter: CircularBarsPainter(animationValue: _controller.value),
size: Size(MediaQuery.sizeOf(context).width * .9,
MediaQuery.sizeOf(context).height * .8),
size: Size(MediaQuery.sizeOf(context).width * .9, MediaQuery.sizeOf(context).height * .8),
);
},
);

Loading…
Cancel
Save