You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's tackle the first and main component, the `ScannerPage` class which will be implemented in `scan_page.dart`. In order to implement the full driver license scanner workflow, the following needs to be done in order:
84
84
@@ -188,16 +188,134 @@ class _ScannerPageState extends State<ScannerPage> with RouteAware {
188
188
>- The license string here grants a time-limited free trial which requires network connection to work.
189
189
>- You can request a 30-day trial license via the [Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=guide&package=mobile) portal.
190
190
191
-
### Implementing the DriverLicenseScanResult Class
191
+
### Define the Result Classes and Related APIs
192
192
193
-
The next step in building this app is to create the `DriverLicenseScanResult` class which will be used to represent the parsed information that is output by the library. **For the full implementation of this class, please refer to [*driver_license_scan_result.dart*]([ScanDriversLicense/lib/driver_license_scan_result.dart](https://github.com/Dynamsoft/barcode-reader-flutter-samples/blob/main/ScanDriversLicense/lib/driver_license_scan_result.dart))**. Here is a quick breakdown of the `DriverLicenseScanResult` class:
193
+
The next step in building this app is to create the `DriverLicenseScanResult` class which will be used to represent the parsed information that is output by the library. **For the full implementation of this class, please refer to [*driver_license_scan_result.dart*](https://github.com/Dynamsoft/barcode-reader-flutter-samples/blob/main/ScanDriversLicense/lib/driver_license_scan_result.dart). Here is a quick breakdown of the `DriverLicenseScanResult` class:
194
194
195
195
-`resultStatus` represents whether the result was produced successfully, if the scan operation was cancelled, or if an error occurred during the scanning process.
196
196
-`data` is a `DriverLicenseData` object that represents the parsed information as different string fields which can then be accessed via these key fields and presented to the user in a friendly manner.
197
197
-`DriverLicenseData` is created from a [`ParsedResultItem`]({{ site.dcp_flutter_api }}parsed-result-item.html) object via the `fromParsedResultItem()` function that is defined in the `DriverLicenseData` class.
198
198
-`errorString` is the error message that is produced should the `resultStatus` be `exception`.
Now that the main Scanner widget and the `DriverLicenseScanResult` class are implemented, it's time to bring them together in the *main.dart* of the project. For the full implementation of *main.dart*, please see the code below:
203
321
@@ -323,19 +441,6 @@ If everything is set up correctly, you should see the app running on your device
323
441
324
442
### Android
325
443
326
-
#### Camera Permissions
327
-
328
-
On Android, permission to use the camera must be set in the code as such:
329
-
330
-
```dart
331
-
PermissionUtil.requestCameraPermission();
332
-
```
333
-
334
-
> [!NOTE]
335
-
> This is done via the [`PermissionUtil`]({{ site.dcv_flutter_api }}utility/permission-util.html) class. Please note that the code snippets in the previous sections contain this line in order to make the app run successfully.
336
-
337
-
#### Deploying to Device
338
-
339
444
Go to the project folder, open a new terminal and run the following command:
340
445
341
446
```bash
@@ -344,12 +449,6 @@ flutter run -d <DEVICE_ID>
344
449
345
450
You can get the IDs of all connected (physical) devices by running the command `flutter devices`.
346
451
347
-
#### iOS
348
-
349
-
In order to deploy the app to a iOS device, we recommend doing it via Xcode by using the `Runner.xcworkspace` project that was generated when the pods were installed. Since the camera permissions are taken care of, all you need to do is properly configure the *Signing & Capabilities* section of the project settings. Should the iOS device be connected to the computer, you can now run and deploy the app to the device.
350
-
351
-
If everything is set up correctly, you should see the app running on your device.
352
-
353
452
## Full Sample Code
354
453
355
454
The full sample code is available [here](https://github.com/Dynamsoft/barcode-reader-flutter-samples/tree/main/ScanDriversLicense).
@@ -360,4 +459,4 @@ You can request a 30-day trial license via the [Trial License](https://www.dynam
0 commit comments