chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 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 | |
chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 5 | import 'package:flutter/material.dart'; |
| 6 | |
Greg Spencer | e3bc8ef | 2023-04-04 13:34:29 -0700 | [diff] [blame^] | 7 | /// Flutter code sample for [SelectionArea]. |
chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 8 | |
Greg Spencer | e3bc8ef | 2023-04-04 13:34:29 -0700 | [diff] [blame^] | 9 | void main() => runApp(const SelectionAreaExampleApp()); |
chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 10 | |
Greg Spencer | e3bc8ef | 2023-04-04 13:34:29 -0700 | [diff] [blame^] | 11 | class SelectionAreaExampleApp extends StatelessWidget { |
| 12 | const SelectionAreaExampleApp({super.key}); |
chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 13 | |
| 14 | @override |
| 15 | Widget build(BuildContext context) { |
| 16 | return MaterialApp( |
chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 17 | home: SelectionArea( |
| 18 | child: Scaffold( |
Greg Spencer | e3bc8ef | 2023-04-04 13:34:29 -0700 | [diff] [blame^] | 19 | appBar: AppBar(title: const Text('SelectionArea Sample')), |
Michael Goderbauer | b0f1714 | 2023-02-02 11:33:57 -0800 | [diff] [blame] | 20 | body: const Center( |
chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 21 | child: Column( |
| 22 | mainAxisAlignment: MainAxisAlignment.center, |
Michael Goderbauer | b0f1714 | 2023-02-02 11:33:57 -0800 | [diff] [blame] | 23 | children: <Widget>[ |
chunhtai | efb9368 | 2022-05-24 13:53:55 -0700 | [diff] [blame] | 24 | Text('Row 1'), |
| 25 | Text('Row 2'), |
| 26 | Text('Row 3'), |
| 27 | ], |
| 28 | ), |
| 29 | ), |
| 30 | ), |
| 31 | ), |
| 32 | ); |
| 33 | } |
| 34 | } |