@@ -2,12 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for custom labeled switch.
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for custom labeled switch.
|
||||
|
||||
void main() => runApp(const LabeledSwitchApp());
|
||||
|
||||
class LabeledSwitchApp extends StatelessWidget {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for custom labeled switch.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for custom labeled switch.
|
||||
|
||||
void main() => runApp(const LabeledSwitchApp());
|
||||
|
||||
class LabeledSwitchApp extends StatelessWidget {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [SwitchListTile].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [SwitchListTile].
|
||||
|
||||
void main() => runApp(const SwitchListTileApp());
|
||||
|
||||
class SwitchListTileApp extends StatelessWidget {
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [SwitchListTile].
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Flutter code sample for [SwitchListTile].
|
||||
|
||||
void main() => runApp(const SwitchListTileApp());
|
||||
|
||||
class SwitchListTileApp extends StatelessWidget {
|
||||
@@ -15,9 +15,7 @@ class SwitchListTileApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
theme: ThemeData(useMaterial3: true),
|
||||
home: Scaffold(
|
||||
appBar: AppBar(title: const Text('SwitchListTile Sample')),
|
||||
body: const SwitchListTileExample()),
|
||||
home: Scaffold(appBar: AppBar(title: const Text('SwitchListTile Sample')), body: const SwitchListTileExample()),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -58,7 +56,8 @@ class _SwitchListTileExampleState extends State<SwitchListTileExample> {
|
||||
});
|
||||
},
|
||||
title: const Text('Headline'),
|
||||
subtitle: const Text('Longer supporting text to demonstrate how the text wraps and the switch is centered vertically with the text.'),
|
||||
subtitle: const Text(
|
||||
'Longer supporting text to demonstrate how the text wraps and the switch is centered vertically with the text.'),
|
||||
),
|
||||
const Divider(height: 0),
|
||||
SwitchListTile(
|
||||
@@ -69,7 +68,8 @@ class _SwitchListTileExampleState extends State<SwitchListTileExample> {
|
||||
});
|
||||
},
|
||||
title: const Text('Headline'),
|
||||
subtitle: const Text("Longer supporting text to demonstrate how the text wraps and how setting 'SwitchListTile.isThreeLine = true' aligns the switch to the top vertically with the text."),
|
||||
subtitle: const Text(
|
||||
"Longer supporting text to demonstrate how the text wraps and how setting 'SwitchListTile.isThreeLine = true' aligns the switch to the top vertically with the text."),
|
||||
isThreeLine: true,
|
||||
),
|
||||
const Divider(height: 0),
|
||||
|
||||
Reference in New Issue
Block a user