Rename Sample classes (#124080)

Rename Sample classes
This commit is contained in:
Greg Spencer
2023-04-04 13:34:29 -07:00
committed by GitHub
parent c8a3dbaf06
commit e3bc8efd39
480 changed files with 3125 additions and 3816 deletions

View File

@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for [ErrorWidget].
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
/// Flutter code sample for [ErrorWidget].
void main() {
// Set the ErrorWidget's builder before the app is started.
ErrorWidget.builder = (FlutterErrorDetails details) {
@@ -28,19 +28,17 @@ void main() {
};
// Start the app.
runApp(const MyApp());
runApp(const ErrorWidgetExampleApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
static const String _title = 'ErrorWidget Sample';
class ErrorWidgetExampleApp extends StatefulWidget {
const ErrorWidgetExampleApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
State<ErrorWidgetExampleApp> createState() => _ErrorWidgetExampleAppState();
}
class _MyAppState extends State<MyApp> {
class _ErrorWidgetExampleAppState extends State<ErrorWidgetExampleApp> {
bool throwError = false;
@override
@@ -55,13 +53,14 @@ class _MyAppState extends State<MyApp> {
);
} else {
return MaterialApp(
title: MyApp._title,
home: Scaffold(
appBar: AppBar(title: const Text(MyApp._title)),
appBar: AppBar(title: const Text('ErrorWidget Sample')),
body: Center(
child: TextButton(
onPressed: () {
setState(() { throwError = true; });
setState(() {
throwError = true;
});
},
child: const Text('Error Prone')),
),