Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //host_page.dart:
- import 'dart:convert';
- import 'package:flutter/material.dart';
- import 'package:flutter_moving_background/flutter_moving_background.dart';
- import 'package:task_app_es/meeting_list_screen.dart';
- import 'work_screen.dart';
- import 'login_page.dart';
- import 'meeting_list_screen.dart';
- import 'package:qr_flutter/qr_flutter.dart';
- import 'package:flutter_blue/flutter_blue.dart' as flutter_blue;
- class HostPage extends StatefulWidget {
- final String id;
- final String username;
- final String esEmail;
- final String passCode;
- final String deviceID;
- final String jobs;
- final String meetingName;
- const HostPage(
- {super.key,
- required this.id,
- required this.username,
- required this.esEmail,
- required this.passCode,
- required this.deviceID,
- required this.meetingName,
- required this.jobs});
- @override
- _HostPageState createState() => _HostPageState();
- }
- class _HostPageState extends State<HostPage> {
- bool _fadeInCompleted = false;
- bool _attendMeetingActive = false;
- final TextEditingController _pinController = TextEditingController();
- bool _isSearching = false;
- String _message = '';
- @override
- void initState() {
- super.initState();
- print('ID: ${widget.id}');
- print('Username: ${widget.username}');
- print('ES_Email: ${widget.esEmail}');
- print('Passcode: ${widget.passCode}');
- print('Device ID passed over to HostPage: ${widget.deviceID}');
- Future.delayed(const Duration(milliseconds: 1000), () {
- _startFadeInAnimation();
- // Call the method to initialize NFC
- });
- }
- @override
- void dispose() {
- super.dispose();
- }
- void _loginback({required String deviceID}) {
- Navigator.push(
- context,
- MaterialPageRoute(
- builder: (context) => LoginPage(deviceID: widget.deviceID)),
- );
- }
- void _startFadeInAnimation() {
- Future.delayed(const Duration(milliseconds: 1000), () {
- setState(() {
- _fadeInCompleted = true;
- });
- });
- }
- void _searchForHost() async {
- setState(() {
- _isSearching = true;
- });
- flutter_blue.FlutterBlue flutterBlue = flutter_blue.FlutterBlue.instance;
- flutterBlue.scanResults.listen((results) {
- for (var result in results) {
- if (result.device.name == 'Your Host Device Name') {
- _connectToHost(result.device);
- break;
- }
- }
- });
- flutterBlue.startScan(timeout: Duration(seconds: 10));
- }
- void _connectToHost(flutter_blue.BluetoothDevice device) async {
- try {
- await device.connect();
- await _sendPayload(device);
- } catch (e) {
- print('Error connecting to host: $e');
- }
- }
- Future<void> _sendPayload(flutter_blue.BluetoothDevice device) async {
- final pin = await _promptPin();
- if (pin != null) {
- // Send payload in JSON format
- final userData = {
- 'id': int.parse(widget.id),
- 'username': widget.username,
- 'esEmail': widget.esEmail,
- };
- final payload = jsonEncode(userData);
- try {
- // Connect to the device
- await device.connect();
- // Discover services
- List<flutter_blue.BluetoothService> services = await device.discoverServices();
- // Iterate through each service to find characteristics
- for (var service in services) {
- List<flutter_blue.BluetoothCharacteristic> characteristics = service.characteristics;
- // Iterate through each characteristic
- for (var characteristic in characteristics) {
- // Write the payload to the characteristic
- await characteristic.write(utf8.encode(payload));
- // Notify the user of successful connection
- setState(() {
- _message = 'You have joined the meeting.';
- });
- // Disconnect after sending payload
- await device.disconnect();
- return; // Exit the method after successful operation
- }
- }
- // If no characteristic was found
- print('No characteristic found.');
- } catch (e) {
- print('Error: $e');
- }
- } else {
- print('PIN entry cancelled.');
- }
- }
- Future<String?> _promptPin() async {
- String? pin;
- await showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- title: Text('Enter PIN'),
- content: TextField(
- controller: _pinController,
- keyboardType: TextInputType.number,
- decoration: InputDecoration(labelText: 'PIN'),
- ),
- actions: <Widget>[
- TextButton(
- child: Text('Cancel'),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- TextButton(
- child: Text('OK'),
- onPressed: () {
- pin = _pinController.text;
- Navigator.of(context).pop();
- },
- ),
- ],
- );
- },
- );
- return pin;
- }
- @override
- Widget build(BuildContext context) {
- return AnimatedOpacity(
- opacity: _fadeInCompleted ? 1.0 : 0.0,
- duration: const Duration(milliseconds: 1500),
- child: Stack(
- children: [
- SizedBox(
- width: MediaQuery.of(context).size.width,
- height: MediaQuery.of(context).size.height,
- child: const MovingBackground(
- backgroundColor: Colors.transparent,
- circles: [
- MovingCircle(
- color: Color.fromARGB(149, 39, 2, 102), blurSigma: 100),
- MovingCircle(
- color: Color.fromARGB(118, 217, 0, 255), blurSigma: 170),
- MovingCircle(
- color: Color.fromARGB(123, 150, 2, 214), blurSigma: 80),
- MovingCircle(
- color: Color.fromARGB(115, 84, 10, 105), blurSigma: 120),
- MovingCircle(
- color: Color.fromARGB(129, 213, 128, 255), blurSigma: 60),
- MovingCircle(
- color: Color.fromARGB(99, 255, 255, 255), blurSigma: 100),
- ],
- ),
- ),
- Center(
- child: Container(
- width: MediaQuery.of(context).size.width * 0.95,
- height: MediaQuery.of(context).size.height * 0.95,
- child: Column(
- mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Container(
- height: MediaQuery.of(context).size.height * 0.7,
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- ElevatedButton(
- onPressed: () {
- Navigator.pushReplacement(
- context,
- MaterialPageRoute(
- builder: (context) => WorkScreen(
- id: widget.id,
- username: widget.username,
- esEmail: widget.esEmail,
- passCode: widget.passCode,
- deviceID: widget.deviceID,
- meetingName: '',
- jobs: '',
- ),
- ),
- );
- },
- style: ElevatedButton.styleFrom(
- backgroundColor: const Color.fromARGB(118, 101, 31, 170),
- minimumSize: Size(
- double.infinity,
- MediaQuery.of(context).size.height * 0.35,
- ),
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(20),
- topRight: Radius.circular(20),
- ),
- side: BorderSide(
- color: Color.fromARGB(194, 132, 0, 255),
- width: 5.0,
- ),
- ),
- ),
- child: Column(
- children: [
- Icon(
- Icons.perm_identity,
- color: const Color.fromARGB(194, 132, 0, 255),
- size: MediaQuery.of(context).size.width * 0.4,
- ),
- const SizedBox(height: 5),
- Text(
- 'Host a meeting',
- style: TextStyle(
- color: const Color.fromARGB(255, 132, 0, 255),
- fontSize:
- MediaQuery.of(context).size.width * 0.08,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(height: 5),
- ElevatedButton(
- onPressed: () {
- setState(() {
- _attendMeetingActive = !_attendMeetingActive;
- // Additional logic can be added here
- });
- },
- style: ElevatedButton.styleFrom(
- backgroundColor: _attendMeetingActive
- ? const Color.fromARGB(169, 172, 89, 255)
- : const Color.fromARGB(118, 101, 31, 170),
- minimumSize: Size(
- double.infinity,
- MediaQuery.of(context).size.height * 0.335,
- ),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(0),
- side: const BorderSide(
- color: Color.fromARGB(194, 132, 0, 255),
- width: 5.0,
- ),
- ),
- ),
- child: Stack(
- children: [
- Align(
- alignment: Alignment.center,
- child: Column(
- children: [
- Icon(
- Icons.group_add_rounded,
- color: _attendMeetingActive
- ? const Color.fromARGB(193, 255, 255, 255)
- : const Color.fromARGB(194, 132, 0, 255),
- size: MediaQuery.of(context).size.width *
- 0.339,
- ),
- SizedBox(
- height: _attendMeetingActive ? 15 : 5),
- Text(
- _attendMeetingActive
- ? ''
- : 'Attend a meeting',
- style: TextStyle(
- color: _attendMeetingActive
- ? const Color.fromARGB(193, 255, 255, 255)
- : const Color.fromARGB(194, 132, 0, 255),
- fontSize:
- MediaQuery.of(context).size.width *
- 0.08,
- ),
- ),
- ],
- ),
- ),
- Positioned.fill(
- child: Visibility(
- visible: _attendMeetingActive,
- child: Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.end,
- children: [
- ElevatedButton(
- onPressed: () {
- // Create a Map with the desired key-value pairs
- Map<String, dynamic> userData = {
- 'id': int.parse(widget.id),
- 'username': widget.username,
- 'esEmail': widget.esEmail,
- };
- // Encode the map to JSON format
- String jsonData =
- jsonEncode(userData);
- print(jsonData);
- showDialog(
- context: context,
- builder: (BuildContext context) {
- return AlertDialog(
- backgroundColor: const Color.fromARGB(
- 248, 0, 0, 0),
- contentPadding: EdgeInsets.zero,
- content: Container(
- width: MediaQuery.of(context)
- .size
- .width *
- 0.99, // 80% of screen width
- height: MediaQuery.of(context)
- .size
- .height *
- 0.4, // 90% of screen height
- child: Column(
- mainAxisAlignment:
- MainAxisAlignment
- .center,
- mainAxisSize:
- MainAxisSize.min,
- children: [
- Text(
- 'SHOW TO HOST',
- style: TextStyle(
- fontSize: MediaQuery.of(
- context)
- .size
- .width *
- 0.055, // Adjust title size
- color: const Color.fromARGB(
- 255,
- 213,
- 181,
- 255),
- ),
- ),
- const SizedBox(height: 10),
- Container(
- width: 200,
- height: 200,
- child: QrImageView(
- data:
- jsonData, // Pass the JSON encoded data
- version:
- QrVersions.auto,
- gapless: true,
- eyeStyle: const QrEyeStyle(
- eyeShape:
- QrEyeShape
- .square,
- color: Color.fromARGB(255, 0, 0, 0)),
- dataModuleStyle:
- const QrDataModuleStyle(
- color: Color.fromARGB(255, 0, 0, 0)),
- backgroundColor:
- Color.fromARGB(255, 255, 255, 255),
- ),
- ),
- ],
- ),
- ),
- actions: [
- Center(
- child: TextButton(
- onPressed: () {
- Navigator.of(context)
- .pop();
- },
- child: Text(
- 'CLOSE',
- style: TextStyle(
- color: const Color.fromARGB(
- 255,
- 213,
- 181,
- 255),
- fontSize: MediaQuery.of(
- context)
- .size
- .width *
- 0.045,
- ),
- ),
- ),
- ),
- ],
- );
- },
- );
- },
- style: ElevatedButton.styleFrom(
- backgroundColor:
- const Color.fromARGB(118, 101, 31, 170),
- minimumSize: Size(
- MediaQuery.of(context).size.width *
- 0.4,
- MediaQuery.of(context).size.height *
- 0.04,
- ),
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(20)),
- ),
- side: const BorderSide(
- color: Color.fromARGB(
- 194, 132, 0, 255),
- width: 3.0,
- ),
- ),
- child: const Text(
- 'QR Code',
- style: TextStyle(
- fontSize: 18,
- color: Color.fromARGB(
- 194, 255, 255, 255)),
- ),
- ),
- ElevatedButton(
- onPressed: () {
- _searchForHost();
- },
- style: ElevatedButton.styleFrom(
- backgroundColor:
- const Color.fromARGB(118, 101, 31, 170),
- minimumSize: Size(
- MediaQuery.of(context).size.width *
- 0.4,
- MediaQuery.of(context).size.height *
- 0.04,
- ),
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- bottomRight:
- Radius.circular(20)),
- ),
- side: const BorderSide(
- color: Color.fromARGB(
- 194, 132, 0, 255),
- width: 3.0,
- ),
- ),
- child: const Text(
- 'Bluetooth',
- style: TextStyle(
- fontSize: 18,
- color: Color.fromARGB(
- 194, 255, 255, 255)),
- ),
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- Container(
- height: MediaQuery.of(context).size.height * 0.15,
- width: MediaQuery.of(context).size.width * 0.95,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- ElevatedButton(
- onPressed: () {
- Navigator.pushReplacement(
- context,
- MaterialPageRoute(
- builder: (context) => MeetingListScreen(
- id: widget.id,
- username: widget.username,
- esEmail: widget.esEmail,
- passCode: widget.passCode,
- deviceID: widget.deviceID,
- meetingName: '',
- jobs: '',
- ),
- ),
- );
- },
- style: ElevatedButton.styleFrom(
- backgroundColor: const Color.fromARGB(118, 101, 31, 170),
- minimumSize: Size(
- MediaQuery.of(context).size.width * 0.313,
- double.infinity,
- ),
- padding: EdgeInsets.symmetric(
- vertical:
- MediaQuery.of(context).size.width * 0.04),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(0),
- side: const BorderSide(
- color: Color.fromARGB(194, 132, 0, 255),
- width: 5.0,
- ),
- ),
- ),
- child: Column(
- children: [
- Icon(
- Icons.app_shortcut_rounded,
- color: const Color.fromARGB(194, 132, 0, 255),
- size: MediaQuery.of(context).size.width * 0.12,
- ),
- const SizedBox(height: 5),
- Text(
- 'My Meetings',
- style: TextStyle(
- color: const Color.fromARGB(255, 132, 0, 255),
- fontSize:
- MediaQuery.of(context).size.width * 0.03,
- ),
- ),
- ],
- ),
- ),
- ElevatedButton(
- onPressed: () {
- // Handle 'Collaborators' button press
- },
- style: ElevatedButton.styleFrom(
- backgroundColor: const Color.fromARGB(118, 101, 31, 170),
- minimumSize: Size(
- MediaQuery.of(context).size.width * 0.313,
- double.infinity,
- ),
- padding: EdgeInsets.symmetric(
- vertical:
- MediaQuery.of(context).size.width * 0.04),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(0),
- side: const BorderSide(
- color: Color.fromARGB(194, 132, 0, 255),
- width: 5.0,
- ),
- ),
- ),
- child: Column(
- children: [
- Icon(
- Icons.group_rounded,
- color: const Color.fromARGB(194, 132, 0, 255),
- size: MediaQuery.of(context).size.width * 0.12,
- ),
- const SizedBox(height: 5),
- Text(
- 'Collaborators',
- style: TextStyle(
- color: const Color.fromARGB(255, 132, 0, 255),
- fontSize:
- MediaQuery.of(context).size.width * 0.03,
- ),
- ),
- ],
- ),
- ),
- ElevatedButton(
- onPressed: () {
- // Handle 'Options' button press
- },
- style: ElevatedButton.styleFrom(
- backgroundColor: const Color.fromARGB(118, 101, 31, 170),
- minimumSize: Size(
- MediaQuery.of(context).size.width * 0.313,
- double.infinity,
- ),
- padding: EdgeInsets.symmetric(
- vertical:
- MediaQuery.of(context).size.width * 0.04),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(0),
- side: const BorderSide(
- color: Color.fromARGB(194, 132, 0, 255),
- width: 5.0,
- ),
- ),
- ),
- child: Column(
- children: [
- Icon(
- Icons.settings,
- color: const Color.fromARGB(194, 132, 0, 255),
- size: MediaQuery.of(context).size.width * 0.12,
- ),
- const SizedBox(height: 5),
- Text(
- 'Options',
- style: TextStyle(
- color: const Color.fromARGB(255, 132, 0, 255),
- fontSize:
- MediaQuery.of(context).size.width * 0.03,
- ),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- Container(
- child: ElevatedButton(
- onPressed: () {
- _loginback(deviceID: widget.deviceID);
- },
- style: ElevatedButton.styleFrom(
- backgroundColor: const Color.fromARGB(45, 255, 0, 21),
- minimumSize: Size(
- double.infinity,
- MediaQuery.of(context).size.height * 0.05,
- ),
- shape: const RoundedRectangleBorder(
- borderRadius: BorderRadius.only(
- bottomLeft: Radius.circular(20),
- bottomRight: Radius.circular(20),
- ),
- ),
- side: const BorderSide(
- color: Color.fromARGB(194, 132, 0, 255),
- width: 5.0,
- ),
- ),
- child: Text(
- 'LOG OUT',
- style: TextStyle(
- color: const Color.fromARGB(115, 255, 58, 58),
- fontSize: MediaQuery.of(context).size.width * 0.06,
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
- ----------------------------------------------
- //qr_scanner.dart:
- import 'dart:async';
- import 'dart:convert';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- import 'package:flutter/widgets.dart';
- import 'dart:math';
- import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart' as barcode_scanner;
- import 'package:flutter_blue/flutter_blue.dart' as flutter_blue;
- class BarcodeScannerWidget extends StatefulWidget {
- @override
- _BarcodeScannerWidgetState createState() => _BarcodeScannerWidgetState();
- }
- class _BarcodeScannerWidgetState extends State<BarcodeScannerWidget> with WidgetsBindingObserver {
- List<Map<String, dynamic>> _scannedDataList = [];
- bool _acceptBluetooth = false;
- String _randomPin = '';
- bool _isScanningBluetooth = false;
- flutter_blue.FlutterBlue flutterBlue = flutter_blue.FlutterBlue.instance;
- @override
- void initState() {
- super.initState();
- WidgetsBinding.instance!.addObserver(this);
- _generateRandomPin();
- }
- @override
- void dispose() {
- WidgetsBinding.instance!.removeObserver(this);
- _stopBluetoothScan();
- super.dispose();
- }
- @override
- void didChangeAppLifecycleState(AppLifecycleState state) {
- if (state == AppLifecycleState.paused) {
- // Save data or perform other tasks when app is paused
- }
- }
- Future<void> scanQR() async {
- try {
- final qrScanRes = await barcode_scanner.FlutterBarcodeScanner.scanBarcode(
- '#ff6666',
- 'Cancel',
- true,
- barcode_scanner.ScanMode.QR,
- );
- if (qrScanRes != '-1') {
- final data = parseQRData(qrScanRes);
- setState(() {
- _scannedDataList.add(data);
- });
- }
- } catch (e) {
- print('Error scanning QR code: $e');
- }
- }
- Map<String, dynamic> parseQRData(String qrData) {
- try {
- return jsonDecode(qrData);
- } catch (e) {
- print('Error parsing QR data: $e');
- return {};
- }
- }
- Color generateRandomColor(List<Color> previousColors) {
- final random = Random();
- Color color;
- do {
- final r = 180 + random.nextInt(76);
- final g = 180 + random.nextInt(76);
- final b = 180 + random.nextInt(76);
- color = Color.fromRGBO(r, g, b, 0.7);
- } while (previousColors.contains(color));
- return color;
- }
- void _generateRandomPin() {
- final random = Random();
- _randomPin = '${random.nextInt(10)}${random.nextInt(10)}${random.nextInt(10)}${random.nextInt(10)}';
- }
- void simulateScan() {
- final random = Random();
- final id = random.nextInt(1000);
- final username = 'Lewis.Whitehead';
- final email = 'Lewis.whitehead@epilepsysociety.org.uk';
- final data = {
- 'id': id,
- 'username': username,
- 'esEmail': email,
- };
- setState(() {
- _scannedDataList.insert(0, data);
- });
- }
- void _startBluetoothScan() {
- _isScanningBluetooth = true;
- flutterBlue.scanResults.listen((results) {
- for (var result in results) {
- _connectToDevice(result.device);
- }
- });
- flutterBlue.startScan(timeout: Duration(seconds: 10));
- }
- void _stopBluetoothScan() {
- _isScanningBluetooth = false;
- flutterBlue.stopScan();
- }
- void _connectToDevice(flutter_blue.BluetoothDevice device) async {
- try {
- await device.connect();
- List<flutter_blue.BluetoothService> services = await device.discoverServices();
- services.forEach((service) async {
- List<flutter_blue.BluetoothCharacteristic> characteristics = service.characteristics;
- for (var characteristic in characteristics) {
- if (characteristic.uuid.toString() == 'Your PIN Characteristic UUID') {
- List<int> pin = await characteristic.read();
- if (utf8.decode(pin) == _randomPin) {
- // Send payload if PIN is correct
- await _sendData(characteristic);
- break;
- } else {
- print('Incorrect PIN');
- }
- }
- }
- });
- } catch (e) {
- print('Error connecting to device: $e');
- } finally {
- await device.disconnect();
- }
- }
- Future<void> _sendData(flutter_blue.BluetoothCharacteristic characteristic) async {
- try {
- // Write payload data to the characteristic
- await characteristic.write(utf8.encode('Your Payload Data'));
- } catch (e) {
- print('Error sending data: $e');
- }
- }
- @override
- Widget build(BuildContext context) {
- List<Color> previousColors = [];
- return MaterialApp(
- home: WillPopScope(
- onWillPop: () async {
- return true;
- },
- child: Scaffold(
- appBar: AppBar(
- title: const Text('Add Attendees by Scanning.'),
- actions: [
- IconButton(
- icon: Icon(Icons.add),
- onPressed: simulateScan,
- ),
- ],
- ),
- body: Column(
- children: [
- Row(
- children: [
- Expanded(
- child: ElevatedButton(
- onPressed: scanQR,
- child: Text('Scan QR', maxLines: 1,),
- ),
- ),
- Spacer(),
- Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('Accept Bluetooth Connections?'),
- Switch(
- value: _acceptBluetooth,
- onChanged: (bool value) {
- setState(() {
- _acceptBluetooth = value;
- if (_acceptBluetooth) {
- _startBluetoothScan();
- } else {
- _stopBluetoothScan();
- _randomPin = '';
- }
- });
- },
- ),
- if (_acceptBluetooth) Text('Random PIN: $_randomPin'),
- if (_isScanningBluetooth) CircularProgressIndicator(),
- ],
- ),
- ],
- ),
- Expanded(
- child: ListView.builder(
- itemCount: _scannedDataList.length,
- itemBuilder: (context, index) {
- final data = _scannedDataList[index];
- final color = generateRandomColor(previousColors);
- previousColors.add(color);
- if (previousColors.length > 5) {
- previousColors.removeAt(0);
- }
- return Dismissible(
- key: Key(data['id'].toString()),
- onDismissed: (direction) {
- setState(() {
- _scannedDataList.removeAt(index);
- });
- },
- background: Container(
- color: Colors.red,
- child: Icon(Icons.delete),
- alignment: Alignment.centerRight,
- padding: EdgeInsets.only(right: 16.0),
- ),
- child: Card(
- color: color,
- child: ListTile(
- title: Text('Name: ${data['username'] ?? ''}'),
- subtitle: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('Email: ${data['esEmail'] ?? ''}'),
- Text('ID: ${data['id']}'),
- ],
- ),
- ),
- ),
- );
- },
- ),
- ),
- Container(
- height: MediaQuery.of(context).size.height * 0.09,
- padding: const EdgeInsets.all(8.0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- ElevatedButton(
- onPressed: () {
- Navigator.pop(context);
- },
- child: Text('Cancel'),
- ),
- if (_scannedDataList.isNotEmpty)
- ElevatedButton(
- onPressed: () {
- Navigator.pop(context, _scannedDataList);
- },
- child: Text('Add Attendees'),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement