updateOrg method

Future<void> updateOrg(
  1. String code
)

Updates the organization details based on the scanned QR code.

Implementation

Future<void> updateOrg(String code) async {
  //String cameraScanResult = code ;//await scanner.scanPhoto();
  if (code.isEmpty) {
    setState(() {
      isEditOrg = false;
    });
    return;
  }

  if (code.contains("CMFETO")) {
    getDevice(code);
  } else {
    setState(() {
      isEditOrg = false;
    });
    Fluttertoast.showToast(
        msg: 'Invalid code', toastLength: Toast.LENGTH_LONG);
  }
}