Skip to content

Commit

Permalink
Merge pull request #31 from vicajilau/bugfix/tests_and_companion
Browse files Browse the repository at this point in the history
Tests and constant improvement
  • Loading branch information
jachzen authored Nov 7, 2023
2 parents fae28af + 535e0fe commit 5342ddd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class CunningDocumentScannerPlugin : FlutterPlugin, MethodCallHandler, ActivityA
private var binding: ActivityPluginBinding? = null
private var pendingResult: Result? = null
private lateinit var activity: Activity
private val START_DOCUMENT_ACTIVITY: Int = 0x362738

/// The MethodChannel that will the communication between Flutter and native Android
///
Expand Down Expand Up @@ -157,4 +156,8 @@ class CunningDocumentScannerPlugin : FlutterPlugin, MethodCallHandler, ActivityA
private fun removeActivityResultListener() {
this.delegate?.let { this.binding?.removeActivityResultListener(it) }
}

companion object {
private const val START_DOCUMENT_ACTIVITY: Int = 0x362738
}
}
4 changes: 2 additions & 2 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:cunning_document_scanner_example/main.dart';

void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async {
testWidgets('View is created', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());

// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is Text && widget.data!.startsWith('Running on:'),
widget is Text && widget.data!.startsWith('Add Pictures'),
),
findsOneWidget,
);
Expand Down

0 comments on commit 5342ddd

Please sign in to comment.