Skip to content

Commit daade48

Browse files
committed
Fix for "'CupertinoTextField' is not a subtype of type 'TextField'"
Issue Link: #2
1 parent 424e497 commit daade48

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.5
2+
3+
* Fix for "'CupertinoTextField' is not a subtype of type 'TextField'"
4+
15
## 0.0.4
26

37
* Upgrade of Drawer Manager (0.0.4)

lib/integration_test_helper.dart

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
library integration_test_helper;
22

33
import 'dart:convert';
4+
import 'package:flutter/cupertino.dart';
45
import 'package:flutter/services.dart';
56
import 'package:flutter/material.dart';
67
import 'package:flutter_test/flutter_test.dart';
@@ -132,8 +133,13 @@ abstract class BaseIntegrationTest {
132133
final userText = find.byKey(Key(fieldKey));
133134
expect(userText, findsOneWidget);
134135

135-
final textField = tester.firstWidget(userText) as TextField;
136-
textField.controller?.text = inputText;
136+
if(tester.firstWidget(userText) is TextField) {
137+
final textField = tester.firstWidget(userText) as TextField;
138+
textField.controller?.text = inputText;
139+
} else if(tester.firstWidget(userText) is CupertinoTextField) {
140+
final textField = tester.firstWidget(userText) as CupertinoTextField;
141+
textField.controller?.text = inputText;
142+
}
137143
}
138144

139145
Future<void> tapForKey(String fieldKey) async {

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: integration_test_helper
22
description: The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage.
3-
version: 0.0.4
3+
version: 0.0.5
44
homepage: https://github.com/the-mac/integration_test_helper
55

66
environment:

0 commit comments

Comments
 (0)