flutter/dev/integration_tests/android_views/lib/main.dart
Chris Yang 6ef4e822f7
Refactoring the Android_views tests app to prepare for adding the iOS platform view tests (#36200)
This PR created a main page for platform view tests in the android views testing app. The main page none contains a list of the links to the pages being tested. It puts the android view motion events tests to a sub page.
The PR also added iOS related files to get ready for adding the iOS platform views tests.
2019-07-17 08:21:09 -07:00

37 lines
944 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_driver/driver_extension.dart';
import 'motion_events_page.dart';
import 'page.dart';
final List<Page> _allPages = <Page>[
const MotionEventsPage(),
];
void main() {
enableFlutterDriverExtension(handler: driverDataHandler.handleMessage);
runApp(MaterialApp(home: Home()));
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView.builder(
itemCount: _allPages.length,
itemBuilder: (_, int index) => ListTile(
title: Text(_allPages[index].title),
key: _allPages[index].tileKey,
onTap: () => _pushPage(context, _allPages[index]),
),
),
);
}
void _pushPage(BuildContext context, Page page) {
Navigator.of(context).push(MaterialPageRoute<void>(
builder: (_) => Scaffold(
body: page,
)));
}
}