flutter/examples/flutter_gallery/lib/main.dart
Todd Volkert 7c60b7405a
Instrument vm service extensions in the gallery (#17977)
https://github.com/flutter/flutter/issues/17956

* Add a `debugInstrumentAction()` method that will wrap an action
  in a stopwatch and print the time it took to run the action.
* Add a global `debugInstrumentationEnabled` that will control
  whether `debugInstrumentAction()` does anything (even in debug
  builds).
* Add some basic instrumentation to `registerServiceExtension()`
* Temporarily enable the `debugInstrumentationEnabled` flag in the
  Gallery to give us better visibility into what's happening in
  https://github.com/flutter/flutter/issues/17956
2018-05-28 12:40:43 -07:00

22 lines
730 B
Dart

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Thanks for checking out Flutter!
// Like what you see? Tweet us @flutterio
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'gallery/app.dart';
void main() {
// Temporary debugging hook for https://github.com/flutter/flutter/issues/17956
debugInstrumentationEnabled = true;
// Overriding https://github.com/flutter/flutter/issues/13736 for better
// visual effect at the cost of performance.
MaterialPageRoute.debugEnableFadingRoutes = true; // ignore: deprecated_member_use
runApp(const GalleryApp());
}