mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

The flake appears to be coming from the Google Maps plugin. This test just needs a platform view plugin without the interface method implemented in general, not Maps specifically. Update it here to avoid the issue in Maps until that's fixed. Create a very simple platform view implementation that exercises this potential bug in order to create a minimal test case with less risk of causing second order issues like depending on any kind of full package would cause.
62 lines
1.4 KiB
Dart
62 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
const MethodChannel channel = MethodChannel('com.example.abstract_method_smoke_test');
|
|
await channel.invokeMethod<void>('show_keyboard');
|
|
runApp(MyApp());
|
|
print('Test suceeded');
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Flutter Demo',
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.blue,
|
|
),
|
|
home: HomePage(),
|
|
);
|
|
}
|
|
}
|
|
|
|
class HomePage extends StatefulWidget {
|
|
@override
|
|
_HomePage createState() => _HomePage();
|
|
}
|
|
|
|
class _HomePage extends State<HomePage> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
// Trigger the second route.
|
|
// https://github.com/flutter/flutter/issues/40126
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
Navigator.of(context).push(
|
|
MaterialPageRoute<void>(builder: (_) => SecondPage()));
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const Scaffold();
|
|
}
|
|
}
|
|
|
|
class SecondPage extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Column(
|
|
children: const <Widget>[
|
|
Expanded(
|
|
child: AndroidView(viewType: 'simple')
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |