You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
Dart
57 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:vital_sign_camera/vital_sign_camera.dart';
|
|
|
|
class ScanStatus extends StatelessWidget {
|
|
final GetHealthStage? stage;
|
|
final double? remainingTime;
|
|
|
|
const ScanStatus({
|
|
Key? key,
|
|
required this.stage,
|
|
required this.remainingTime,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
Text(
|
|
getRemainingTime(),
|
|
style: const TextStyle(
|
|
fontSize: 16,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
Text(
|
|
getScanStage(),
|
|
style: const TextStyle(
|
|
fontSize: 16,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
Container(height: 100),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
String getScanStage() {
|
|
if (stage == GetHealthStage.waitingData) {
|
|
return 'Waiting Data...';
|
|
} else if (stage == GetHealthStage.collectingData) {
|
|
return 'Collecting Data...';
|
|
} else if (stage == GetHealthStage.analyzingData) {
|
|
return 'Analyzing Data...';
|
|
}
|
|
return ''; // idle
|
|
}
|
|
|
|
String getRemainingTime() {
|
|
return (remainingTime != null && remainingTime != double.infinity)
|
|
? remainingTime!.toStringAsFixed(0)
|
|
: "";
|
|
}
|
|
}
|