123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- import 'dart:io';
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import '../index.dart';
- class ImageDetectingDialog extends GetView<IdCardScanController> {
- const ImageDetectingDialog({Key? key}) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Obx(
- () {
- if (controller.state.processingImageLocalPath.isEmpty) {
- return Container();
- }
- return Center(
- child: Stack(
- children: [
- ModalBarrier(
- color: Colors.black.withOpacity(0.5),
- dismissible: false,
- ),
- Center(
- child: Container(
- width: 850,
- height: 600,
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10),
- ),
- clipBehavior: Clip.antiAlias,
- padding: const EdgeInsets.all(40),
- child: Column(
- children: [
- Stack(
- children: [
- Center(
- child: Container(
- decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(10),
- ),
- clipBehavior: Clip.antiAlias,
- child: Image(
- image: FileImage(
- File(controller
- .state.processingImageLocalPath),
- ),
- fit: BoxFit.cover,
- ),
- ),
- ),
- ],
- ),
- const SizedBox(height: 40),
- Expanded(
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: const [
- SizedBox(
- height: 20,
- width: 20,
- child: CircularProgressIndicator(
- valueColor:
- AlwaysStoppedAnimation<Color>(Colors.blue),
- ),
- ),
- SizedBox(
- width: 20,
- ),
- Text(
- '身份证信息识别中,请稍后...',
- style: TextStyle(
- fontSize: 16, color: Colors.black54),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- // 旋转的 loading
- ],
- ),
- );
- },
- );
- }
- }
|