Flutter plugin for scanning and generating QR codes using the ZXing library, supporting Android, iOS, and desktop platforms
flutterbarcode-generatorbarcode-scannergeneratorqrqrcodeqrcode-generatorqrcode-scannerscannerzxingbarcodezxscanner
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.9 KiB
64 lines
1.9 KiB
import 'package:flutter/material.dart'; |
|
|
|
class DebugInfoWidget extends StatelessWidget { |
|
const DebugInfoWidget({ |
|
Key? key, |
|
required this.successScans, |
|
required this.failedScans, |
|
this.error, |
|
this.duration = 0, |
|
this.onReset, |
|
}) : super(key: key); |
|
|
|
final int successScans; |
|
final int failedScans; |
|
final String? error; |
|
final int duration; |
|
|
|
final Function()? onReset; |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
TextStyle? style = |
|
Theme.of(context).textTheme.bodySmall?.copyWith(color: Colors.white); |
|
return Align( |
|
alignment: Alignment.topCenter, |
|
child: Padding( |
|
padding: const EdgeInsets.all(10.0), |
|
child: ClipRRect( |
|
borderRadius: BorderRadius.circular(10), |
|
child: Container( |
|
color: Colors.black54, |
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), |
|
child: Row( |
|
mainAxisSize: MainAxisSize.min, |
|
children: [ |
|
Flexible( |
|
child: SingleChildScrollView( |
|
scrollDirection: Axis.horizontal, |
|
child: Row( |
|
mainAxisSize: MainAxisSize.min, |
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
children: [ |
|
Text('Success: $successScans', style: style), |
|
const SizedBox(width: 10), |
|
Text('Failed: $failedScans', style: style), |
|
const SizedBox(width: 10), |
|
Text('Duration: $duration ms', style: style), |
|
], |
|
), |
|
), |
|
), |
|
const SizedBox(width: 10), |
|
TextButton( |
|
onPressed: onReset, |
|
child: const Text('Reset'), |
|
), |
|
], |
|
), |
|
), |
|
), |
|
), |
|
); |
|
} |
|
}
|
|
|