@@ -2,25 +2,22 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [SelectionContainer].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
void main() => runApp(const MyApp());
|
||||
/// Flutter code sample for [SelectionContainer].
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
void main() => runApp(const SelectionContainerExampleApp());
|
||||
|
||||
static const String _title = 'Flutter Code Sample';
|
||||
class SelectionContainerExampleApp extends StatelessWidget {
|
||||
const SelectionContainerExampleApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: _title,
|
||||
home: SelectionArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(title: const Text(_title)),
|
||||
appBar: AppBar(title: const Text('SelectionContainer Sample')),
|
||||
body: const Center(
|
||||
child: SelectionAllOrNoneContainer(
|
||||
child: Column(
|
||||
@@ -40,10 +37,7 @@ class MyApp extends StatelessWidget {
|
||||
}
|
||||
|
||||
class SelectionAllOrNoneContainer extends StatefulWidget {
|
||||
const SelectionAllOrNoneContainer({
|
||||
super.key,
|
||||
required this.child
|
||||
});
|
||||
const SelectionAllOrNoneContainer({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
|
||||
@@ -6,19 +6,16 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() => runApp(const MyApp());
|
||||
void main() => runApp(const SelectionContainerDisabledExampleApp());
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
static const String _title = 'Flutter Code Sample';
|
||||
class SelectionContainerDisabledExampleApp extends StatelessWidget {
|
||||
const SelectionContainerDisabledExampleApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: _title,
|
||||
home: Scaffold(
|
||||
appBar: AppBar(title: const Text(_title)),
|
||||
appBar: AppBar(title: const Text('SelectionContainer.disabled Sample')),
|
||||
body: const Center(
|
||||
child: SelectionArea(
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user