| 1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | import 'package:flutter/material.dart'; |
| 6 | |
| 7 | /// Flutter code sample for [WidgetsApp]. |
| 8 | |
| 9 | void main() => runApp(const WidgetsAppExampleApp()); |
| 10 | |
| 11 | class WidgetsAppExampleApp extends StatelessWidget { |
| 12 | const WidgetsAppExampleApp({super.key}); |
| 13 | |
| 14 | @override |
| 15 | Widget build(BuildContext context) { |
| 16 | return WidgetsApp( |
| 17 | title: 'Example' , |
| 18 | color: const Color(0xFF000000), |
| 19 | home: const Center(child: Text('Hello World' )), |
| 20 | pageRouteBuilder: <T>(RouteSettings settings, WidgetBuilder builder) => PageRouteBuilder<T>( |
| 21 | settings: settings, |
| 22 | pageBuilder: |
| 23 | ( |
| 24 | BuildContext context, |
| 25 | Animation<double> animation, |
| 26 | Animation<double> secondaryAnimation, |
| 27 | ) => builder(context), |
| 28 | ), |
| 29 | ); |
| 30 | } |
| 31 | } |
| 32 | |