Flutter plugin for scanning and generating QR codes using the ZXing library, supporting Android, iOS, and desktop platforms
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.

47 lines
1.2 KiB

import 'package:flutter/material.dart';
class ScanModeDropdown extends StatelessWidget {
const ScanModeDropdown({
Key? key,
this.isMultiScan = false,
this.onChanged,
}) : super(key: key);
final bool isMultiScan;
final Function(bool value)? onChanged;
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(bottom: 20),
child: Container(
height: 56,
padding: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
child: DropdownButtonHideUnderline(
child: DropdownButton<bool>(
value: isMultiScan,
items: const [
DropdownMenuItem(
value: false,
child: Text('Single Scan'),
),
DropdownMenuItem(
value: true,
child: Text('Multi Scan'),
),
],
onChanged: (value) => onChanged?.call(value ?? false),
),
),
),
),
);
}
}