basic_project.dart 1.24 KB
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
import 'project.dart';
6

7
class BasicProject extends Project {
8 9 10 11

  @override
  final String pubspec = '''
  name: test
12 13 14
  environment:
    sdk: ">=2.0.0-dev.68.0 <3.0.0"

15 16 17 18 19 20 21
  dependencies:
    flutter:
      sdk: flutter
  ''';

  @override
  final String main = r'''
22 23
  import 'dart:async';

24
  import 'package:flutter/material.dart';
25

26 27 28 29 30 31
  Future<void> main() async {
    while (true) {
      runApp(new MyApp());
      await Future.delayed(const Duration(milliseconds: 50));
    }
  }
32

33 34 35 36
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      topLevelFunction();
37
      return new MaterialApp( // BUILD BREAKPOINT
38 39 40 41 42 43 44
        title: 'Flutter Demo',
        home: new Container(),
      );
    }
  }

  topLevelFunction() {
45
    print("topLevelFunction"); // TOP LEVEL BREAKPOINT
46 47 48
  }
  ''';

49 50
  Uri get buildMethodBreakpointUri => mainDart;
  int get buildMethodBreakpointLine => lineContaining(main, '// BUILD BREAKPOINT');
51

52
  Uri get topLevelFunctionBreakpointUri => mainDart;
53
  int get topLevelFunctionBreakpointLine => lineContaining(main, '// TOP LEVEL BREAKPOINT');
54
}