mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
test ffi
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* @Author: ekibun
|
||||
* @Date: 2020-08-08 08:16:51
|
||||
* @LastEditors: ekibun
|
||||
* @LastEditTime: 2020-08-27 20:39:32
|
||||
* @LastEditTime: 2020-09-06 19:44:32
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:typed_data';
|
||||
@@ -46,13 +46,13 @@ class TestPage extends StatefulWidget {
|
||||
|
||||
class _TestPageState extends State<TestPage> {
|
||||
String resp;
|
||||
FlutterJs engine;
|
||||
FlutterQjs engine;
|
||||
|
||||
CodeInputController _controller = CodeInputController();
|
||||
|
||||
_createEngine() async {
|
||||
if (engine != null) return;
|
||||
engine = FlutterJs();
|
||||
engine = FlutterQjs();
|
||||
await engine.setMethodHandler((String method, List arg) async {
|
||||
switch (method) {
|
||||
case "http":
|
||||
|
@@ -57,6 +57,13 @@ packages:
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "1.1.0-nullsafety"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
|
27
example/test/widget_test.dart
Normal file
27
example/test/widget_test.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
// This is a basic Flutter widget test.
|
||||
//
|
||||
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||
// utility that Flutter provides. For example, you can send tap and scroll
|
||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:flutter_qjs_example/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(MyApp());
|
||||
|
||||
// Verify that platform version is retrieved.
|
||||
expect(
|
||||
find.byWidgetPredicate(
|
||||
(Widget widget) => widget is Text &&
|
||||
widget.data.startsWith('Running on:'),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user