transitions_perf.dart 950 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6 7
import 'dart:async';
import 'dart:convert' show JsonEncoder;

8
import 'package:flutter_driver/driver_extension.dart';
9
import 'package:flutter_gallery/gallery/demos.dart';
10 11
import 'package:flutter_gallery/gallery/app.dart' show GalleryApp;
import 'package:flutter/material.dart';
12

13
Future<String> _handleMessages(String message) async {
14 15 16 17
  assert(message == 'demoNames');
  return const JsonEncoder.withIndent('  ').convert(
    kAllGalleryDemos.map((GalleryDemo demo) => '${demo.title}@${demo.category.name}').toList(),
  );
18 19
}

20
void main() {
21
  enableFlutterDriverExtension(handler: _handleMessages);
22 23 24
  // As in lib/main.dart: overriding https://github.com/flutter/flutter/issues/13736
  // for better visual effect at the cost of performance.
  runApp(const GalleryApp(testMode: true));
25
}