[flutter_tools] cleanups to web runner functionality (#61178)
Skip unnecessary parsing of chrome URI. Ensure stack traces are initialized in web server. Disclaimer on web server that it does not support debugging and remove help message. Fix generated entrypoint to check for main(List<String> args) - Fixes #59643 - Fixes #55084 - Fixes #60417
This commit is contained in:
@@ -52,3 +52,46 @@ class BasicProject extends Project {
|
||||
Uri get topLevelFunctionBreakpointUri => mainDart;
|
||||
int get topLevelFunctionBreakpointLine => lineContaining(main, '// TOP LEVEL BREAKPOINT');
|
||||
}
|
||||
|
||||
class BasicProjectWithUnaryMain extends Project {
|
||||
|
||||
@override
|
||||
final String pubspec = '''
|
||||
name: test
|
||||
environment:
|
||||
sdk: ">=2.0.0-dev.68.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
''';
|
||||
|
||||
@override
|
||||
final String main = r'''
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
while (true) {
|
||||
runApp(new MyApp());
|
||||
await Future.delayed(const Duration(milliseconds: 50));
|
||||
}
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
topLevelFunction();
|
||||
return new MaterialApp( // BUILD BREAKPOINT
|
||||
title: 'Flutter Demo',
|
||||
home: new Container(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
topLevelFunction() {
|
||||
print("topLevelFunction"); // TOP LEVEL BREAKPOINT
|
||||
}
|
||||
''';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user