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.
58 lines
1.5 KiB
Dart
58 lines
1.5 KiB
Dart
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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(context),
|
|
style: const TextStyle(
|
|
fontSize: 16,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
Container(height: 100),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
String getScanStage(context) {
|
|
if (stage == GetHealthStage.waitingData) {
|
|
return TranslationBase.of(context).waitingData;
|
|
} else if (stage == GetHealthStage.collectingData) {
|
|
return TranslationBase.of(context).collectingData;
|
|
} else if (stage == GetHealthStage.analyzingData) {
|
|
return TranslationBase.of(context).analyzingData;
|
|
}
|
|
return ''; // idle
|
|
}
|
|
|
|
String getRemainingTime() {
|
|
return (remainingTime != null && remainingTime != double.infinity)
|
|
? remainingTime!.toStringAsFixed(0)
|
|
: "";
|
|
}
|
|
}
|