Unverified Commit bbca7ff6 authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

Add Material 3 `SwitchListTile` example and update existing examples (#119714)

* Add Material 3 `SwitchListTile` example and update existing examples

* Update examples with `useMaterial3: true` and update example descriptions.

* add a `ColorScheme` colour
parent b8f5394a
...@@ -14,8 +14,9 @@ class CheckboxListTileApp extends StatelessWidget { ...@@ -14,8 +14,9 @@ class CheckboxListTileApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const MaterialApp( return MaterialApp(
home: CheckboxListTileExample(), theme: ThemeData(useMaterial3: true),
home: const CheckboxListTileExample(),
); );
} }
} }
......
...@@ -14,7 +14,7 @@ class CheckboxListTileApp extends StatelessWidget { ...@@ -14,7 +14,7 @@ class CheckboxListTileApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), theme: ThemeData(useMaterial3: true),
home: const CheckboxListTileExample(), home: const CheckboxListTileExample(),
); );
} }
...@@ -44,7 +44,7 @@ class _CheckboxListTileExampleState extends State<CheckboxListTileExample> { ...@@ -44,7 +44,7 @@ class _CheckboxListTileExampleState extends State<CheckboxListTileExample> {
setState(() { setState(() {
checkboxValue1 = value!; checkboxValue1 = value!;
}); });
}, },
title: const Text('Headline'), title: const Text('Headline'),
subtitle: const Text('Supporting text'), subtitle: const Text('Supporting text'),
), ),
...@@ -55,7 +55,7 @@ class _CheckboxListTileExampleState extends State<CheckboxListTileExample> { ...@@ -55,7 +55,7 @@ class _CheckboxListTileExampleState extends State<CheckboxListTileExample> {
setState(() { setState(() {
checkboxValue2 = value!; checkboxValue2 = value!;
}); });
}, },
title: const Text('Headline'), title: const Text('Headline'),
subtitle: const Text('Longer supporting text to demonstrate how the text wraps and the checkbox is centered vertically with the text.'), subtitle: const Text('Longer supporting text to demonstrate how the text wraps and the checkbox is centered vertically with the text.'),
), ),
...@@ -66,7 +66,7 @@ class _CheckboxListTileExampleState extends State<CheckboxListTileExample> { ...@@ -66,7 +66,7 @@ class _CheckboxListTileExampleState extends State<CheckboxListTileExample> {
setState(() { setState(() {
checkboxValue3 = value!; checkboxValue3 = value!;
}); });
}, },
title: const Text('Headline'), title: const Text('Headline'),
subtitle: const Text("Longer supporting text to demonstrate how the text wraps and how setting 'CheckboxListTile.isThreeLine = true' aligns the checkbox to the top vertically with the text."), subtitle: const Text("Longer supporting text to demonstrate how the text wraps and how setting 'CheckboxListTile.isThreeLine = true' aligns the checkbox to the top vertically with the text."),
isThreeLine: true, isThreeLine: true,
......
...@@ -8,15 +8,16 @@ import 'package:flutter/gestures.dart'; ...@@ -8,15 +8,16 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() => runApp(const LabeledCheckBoxApp()); void main() => runApp(const LabeledCheckboxApp());
class LabeledCheckBoxApp extends StatelessWidget { class LabeledCheckboxApp extends StatelessWidget {
const LabeledCheckBoxApp({super.key}); const LabeledCheckboxApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const MaterialApp( return MaterialApp(
home: LabeledCheckBoxExample(), theme: ThemeData(useMaterial3: true),
home: const LabeledCheckboxExample(),
); );
} }
} }
...@@ -68,14 +69,14 @@ class LinkedLabelCheckbox extends StatelessWidget { ...@@ -68,14 +69,14 @@ class LinkedLabelCheckbox extends StatelessWidget {
} }
} }
class LabeledCheckBoxExample extends StatefulWidget { class LabeledCheckboxExample extends StatefulWidget {
const LabeledCheckBoxExample({super.key}); const LabeledCheckboxExample({super.key});
@override @override
State<LabeledCheckBoxExample> createState() => _LabeledCheckBoxExampleState(); State<LabeledCheckboxExample> createState() => _LabeledCheckboxExampleState();
} }
class _LabeledCheckBoxExampleState extends State<LabeledCheckBoxExample> { class _LabeledCheckboxExampleState extends State<LabeledCheckboxExample> {
bool _isSelected = false; bool _isSelected = false;
@override @override
......
...@@ -6,15 +6,16 @@ ...@@ -6,15 +6,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() => runApp(const LabeledCheckBoxApp()); void main() => runApp(const LabeledCheckboxApp());
class LabeledCheckBoxApp extends StatelessWidget { class LabeledCheckboxApp extends StatelessWidget {
const LabeledCheckBoxApp({super.key}); const LabeledCheckboxApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return const MaterialApp( return MaterialApp(
home: LabeledCheckBoxExample(), theme: ThemeData(useMaterial3: true),
home: const LabeledCheckboxExample(),
); );
} }
} }
...@@ -57,14 +58,14 @@ class LabeledCheckbox extends StatelessWidget { ...@@ -57,14 +58,14 @@ class LabeledCheckbox extends StatelessWidget {
} }
} }
class LabeledCheckBoxExample extends StatefulWidget { class LabeledCheckboxExample extends StatefulWidget {
const LabeledCheckBoxExample({super.key}); const LabeledCheckboxExample({super.key});
@override @override
State<LabeledCheckBoxExample> createState() => _LabeledCheckBoxExampleState(); State<LabeledCheckboxExample> createState() => _LabeledCheckboxExampleState();
} }
class _LabeledCheckBoxExampleState extends State<LabeledCheckBoxExample> { class _LabeledCheckboxExampleState extends State<LabeledCheckboxExample> {
bool _isSelected = false; bool _isSelected = false;
@override @override
......
// Copyright 2014 The Flutter Authors. All rights reserved.
// 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';
void main() => runApp(const LabeledSwitchApp());
class LabeledSwitchApp extends StatelessWidget {
const LabeledSwitchApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('Custom Labeled Switch Sample')),
body: const Center(
child: LabeledSwitchExample(),
),
),
);
}
}
class LinkedLabelSwitch extends StatelessWidget {
const LinkedLabelSwitch({
super.key,
required this.label,
required this.padding,
required this.value,
required this.onChanged,
});
final String label;
final EdgeInsets padding;
final bool value;
final ValueChanged<bool> onChanged;
@override
Widget build(BuildContext context) {
return Padding(
padding: padding,
child: Row(
children: <Widget>[
Expanded(
child: RichText(
text: TextSpan(
text: label,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () {
debugPrint('Label has been tapped.');
},
),
),
),
Switch(
value: value,
onChanged: (bool newValue) {
onChanged(newValue);
},
),
],
),
);
}
}
class LabeledSwitchExample extends StatefulWidget {
const LabeledSwitchExample({super.key});
@override
State<LabeledSwitchExample> createState() => _LabeledSwitchExampleState();
}
class _LabeledSwitchExampleState extends State<LabeledSwitchExample> {
bool _isSelected = false;
@override
Widget build(BuildContext context) {
return LinkedLabelSwitch(
label: 'Linked, tappable label text',
padding: const EdgeInsets.symmetric(horizontal: 20.0),
value: _isSelected,
onChanged: (bool newValue) {
setState(() {
_isSelected = newValue;
});
},
);
}
}
...@@ -2,25 +2,23 @@ ...@@ -2,25 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flutter code sample for [SwitchListTile]. // Flutter code sample for custom labeled switch.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() => runApp(const MyApp()); void main() => runApp(const LabeledSwitchApp());
class MyApp extends StatelessWidget { class LabeledSwitchApp extends StatelessWidget {
const MyApp({super.key}); const LabeledSwitchApp({super.key});
static const String _title = 'Flutter Code Sample';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: _title, theme: ThemeData(useMaterial3: true),
home: Scaffold( home: Scaffold(
appBar: AppBar(title: const Text(_title)), appBar: AppBar(title: const Text('Custom Labeled Switch Sample')),
body: const Center( body: const Center(
child: MyStatefulWidget(), child: LabeledSwitchExample(),
), ),
), ),
); );
...@@ -65,14 +63,14 @@ class LabeledSwitch extends StatelessWidget { ...@@ -65,14 +63,14 @@ class LabeledSwitch extends StatelessWidget {
} }
} }
class MyStatefulWidget extends StatefulWidget { class LabeledSwitchExample extends StatefulWidget {
const MyStatefulWidget({super.key}); const LabeledSwitchExample({super.key});
@override @override
State<MyStatefulWidget> createState() => _MyStatefulWidgetState(); State<LabeledSwitchExample> createState() => _LabeledSwitchExampleState();
} }
class _MyStatefulWidgetState extends State<MyStatefulWidget> { class _LabeledSwitchExampleState extends State<LabeledSwitchExample> {
bool _isSelected = false; bool _isSelected = false;
@override @override
......
...@@ -6,35 +6,33 @@ ...@@ -6,35 +6,33 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() => runApp(const MyApp()); void main() => runApp(const SwitchListTileApp());
class MyApp extends StatelessWidget { class SwitchListTileApp extends StatelessWidget {
const MyApp({super.key}); const SwitchListTileApp({super.key});
static const String _title = 'Flutter Code Sample';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: _title, theme: ThemeData(useMaterial3: true),
home: Scaffold( home: Scaffold(
appBar: AppBar(title: const Text(_title)), appBar: AppBar(title: const Text('SwitchListTile Sample')),
body: const Center( body: const Center(
child: MyStatefulWidget(), child: SwitchListTileExample(),
), ),
), ),
); );
} }
} }
class MyStatefulWidget extends StatefulWidget { class SwitchListTileExample extends StatefulWidget {
const MyStatefulWidget({super.key}); const SwitchListTileExample({super.key});
@override @override
State<MyStatefulWidget> createState() => _MyStatefulWidgetState(); State<SwitchListTileExample> createState() => _SwitchListTileExampleState();
} }
class _MyStatefulWidgetState extends State<MyStatefulWidget> { class _SwitchListTileExampleState extends State<SwitchListTileExample> {
bool _lights = false; bool _lights = false;
@override @override
......
...@@ -4,99 +4,77 @@ ...@@ -4,99 +4,77 @@
// Flutter code sample for [SwitchListTile]. // Flutter code sample for [SwitchListTile].
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() => runApp(const MyApp()); void main() => runApp(const SwitchListTileApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const String _title = 'Flutter Code Sample'; class SwitchListTileApp extends StatelessWidget {
const SwitchListTileApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: _title, theme: ThemeData(useMaterial3: true),
home: Scaffold( home: Scaffold(
appBar: AppBar(title: const Text(_title)), appBar: AppBar(title: const Text('SwitchListTile Sample')),
body: const Center( body: const SwitchListTileExample()),
child: MyStatefulWidget(),
),
),
); );
} }
} }
class LinkedLabelSwitch extends StatelessWidget { class SwitchListTileExample extends StatefulWidget {
const LinkedLabelSwitch({ const SwitchListTileExample({super.key});
super.key,
required this.label, @override
required this.padding, State<SwitchListTileExample> createState() => _SwitchListTileExampleState();
required this.value, }
required this.onChanged,
});
final String label; class _SwitchListTileExampleState extends State<SwitchListTileExample> {
final EdgeInsets padding; bool switchValue1 = true;
final bool value; bool switchValue2 = true;
final ValueChanged<bool> onChanged; bool switchValue3 = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Scaffold(
padding: padding, body: Column(
child: Row(
children: <Widget>[ children: <Widget>[
Expanded( SwitchListTile(
child: RichText( value: switchValue1,
text: TextSpan( onChanged: (bool? value) {
text: label, setState(() {
style: const TextStyle( switchValue1 = value!;
color: Colors.blueAccent, });
decoration: TextDecoration.underline, },
), title: const Text('Headline'),
recognizer: TapGestureRecognizer() subtitle: const Text('Supporting text'),
..onTap = () {
debugPrint('Label has been tapped.');
},
),
),
), ),
Switch( const Divider(height: 0),
value: value, SwitchListTile(
onChanged: (bool newValue) { value: switchValue2,
onChanged(newValue); onChanged: (bool? value) {
setState(() {
switchValue2 = value!;
});
}, },
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.'),
), ),
const Divider(height: 0),
SwitchListTile(
value: switchValue3,
onChanged: (bool? value) {
setState(() {
switchValue3 = value!;
});
},
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."),
isThreeLine: true,
),
const Divider(height: 0),
], ],
), ),
); );
} }
} }
class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({super.key});
@override
State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
}
class _MyStatefulWidgetState extends State<MyStatefulWidget> {
bool _isSelected = false;
@override
Widget build(BuildContext context) {
return LinkedLabelSwitch(
label: 'Linked, tappable label text',
padding: const EdgeInsets.symmetric(horizontal: 20.0),
value: _isSelected,
onChanged: (bool newValue) {
setState(() {
_isSelected = newValue;
});
},
);
}
}
...@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
testWidgets('LinkedLabelCheckbox contains RichText and Checkbox', (WidgetTester tester) async { testWidgets('LinkedLabelCheckbox contains RichText and Checkbox', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const example.LabeledCheckBoxApp(), const example.LabeledCheckboxApp(),
); );
// Label text is in a RichText widget with the correct text. // Label text is in a RichText widget with the correct text.
......
...@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
testWidgets('Tapping LabeledCheckbox toggles the checkbox', (WidgetTester tester) async { testWidgets('Tapping LabeledCheckbox toggles the checkbox', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const example.LabeledCheckBoxApp(), const example.LabeledCheckboxApp(),
); );
// Checkbox is initially unchecked. // Checkbox is initially unchecked.
......
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/material/switch_list_tile/custom_labeled_switch.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('LinkedLabelSwitch contains RichText and Switch', (WidgetTester tester) async {
await tester.pumpWidget(
const example.LabeledSwitchApp(),
);
// Label text is in a RichText widget with the correct text.
final RichText richText = tester.widget(find.byType(RichText).first);
expect(richText.text.toPlainText(), 'Linked, tappable label text');
// Switch is initially off.
Switch switchWidget = tester.widget(find.byType(Switch));
expect(switchWidget.value, isFalse);
// Tap to toggle the switch.
await tester.tap(find.byType(Switch));
await tester.pumpAndSettle();
// Switch is now on.
switchWidget = tester.widget(find.byType(Switch));
expect(switchWidget.value, isTrue);
});
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/material/switch_list_tile/custom_labeled_switch.1.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Tapping LabeledSwitch toggles the switch', (WidgetTester tester) async {
await tester.pumpWidget(
const example.LabeledSwitchApp(),
);
// Switch is initially off.
Switch switchWidget = tester.widget(find.byType(Switch));
expect(switchWidget.value, isFalse);
// Tap to toggle the switch.
await tester.tap(find.byType(example.LabeledSwitch));
await tester.pumpAndSettle();
// Switch is now on.
switchWidget = tester.widget(find.byType(Switch));
expect(switchWidget.value, isTrue);
});
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/material/switch_list_tile/switch_list_tile.0.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('SwitchListTile can be toggled', (WidgetTester tester) async {
await tester.pumpWidget(
const example.SwitchListTileApp(),
);
expect(find.byType(SwitchListTile), findsOneWidget);
SwitchListTile switchListTile = tester.widget(find.byType(SwitchListTile));
expect(switchListTile.value, isFalse);
await tester.tap(find.byType(SwitchListTile));
await tester.pumpAndSettle();
switchListTile = tester.widget(find.byType(SwitchListTile));
expect(switchListTile.value, isTrue);
});
}
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter_api_samples/material/switch_list_tile/switch_list_tile.1.dart' as example;
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Switch aligns appropriately', (WidgetTester tester) async {
await tester.pumpWidget(
const example.SwitchListTileApp(),
);
expect(find.byType(SwitchListTile), findsNWidgets(3));
Offset tileTopLeft = tester.getTopLeft(find.byType(SwitchListTile).at(0));
Offset switchTopLeft = tester.getTopLeft(find.byType(Switch).at(0));
// The switch is centered vertically with the text.
expect(switchTopLeft - tileTopLeft, const Offset(716.0, 16.0));
tileTopLeft = tester.getTopLeft(find.byType(SwitchListTile).at(1));
switchTopLeft = tester.getTopLeft(find.byType(Switch).at(1));
// The switch is centered vertically with the text.
expect(switchTopLeft - tileTopLeft, const Offset(716.0, 30.0));
tileTopLeft = tester.getTopLeft(find.byType(SwitchListTile).at(2));
switchTopLeft = tester.getTopLeft(find.byType(Switch).at(2));
// The switch is aligned to the top vertically with the text.
expect(switchTopLeft - tileTopLeft, const Offset(716.0, 8.0));
});
testWidgets('Switches can be checked', (WidgetTester tester) async {
await tester.pumpWidget(
const example.SwitchListTileApp(),
);
expect(find.byType(SwitchListTile), findsNWidgets(3));
// All switches are on.
expect(tester.widget<Switch>(find.byType(Switch).at(0)).value, isTrue);
expect(tester.widget<Switch>(find.byType(Switch).at(1)).value, isTrue);
expect(tester.widget<Switch>(find.byType(Switch).at(2)).value, isTrue);
// Tap the first switch.
await tester.tap(find.byType(Switch).at(0));
await tester.pumpAndSettle();
// The first switch is off.
expect(tester.widget<Switch>(find.byType(Switch).at(0)).value, isFalse);
expect(tester.widget<Switch>(find.byType(Switch).at(1)).value, isTrue);
expect(tester.widget<Switch>(find.byType(Switch).at(2)).value, isTrue);
// Tap the second switch.
await tester.tap(find.byType(Switch).at(1));
await tester.pumpAndSettle();
// The first and second switches are off.
expect(tester.widget<Switch>(find.byType(Switch).at(0)).value, isFalse);
expect(tester.widget<Switch>(find.byType(Switch).at(1)).value, isFalse);
expect(tester.widget<Switch>(find.byType(Switch).at(2)).value, isTrue);
// Tap the third switch.
await tester.tap(find.byType(Switch).at(2));
await tester.pumpAndSettle();
// All switches are off.
expect(tester.widget<Switch>(find.byType(Switch).at(0)).value, isFalse);
expect(tester.widget<Switch>(find.byType(Switch).at(1)).value, isFalse);
expect(tester.widget<Switch>(find.byType(Switch).at(2)).value, isFalse);
});
}
...@@ -86,8 +86,8 @@ import 'theme_data.dart'; ...@@ -86,8 +86,8 @@ import 'theme_data.dart';
/// {@end-tool} /// {@end-tool}
/// ///
/// {@tool dartpad} /// {@tool dartpad}
/// This sample shows the creation of a [CheckboxListTile] using [ThemeData.useMaterial3] flag, /// This sample demonstrates how [CheckboxListTile] positions the checkbox widget
/// as described in: https://m3.material.io/components/lists/overview. /// relative to the text in different configurations.
/// ///
/// ** See code in examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart ** /// ** See code in examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart **
/// {@end-tool} /// {@end-tool}
......
...@@ -89,6 +89,13 @@ enum _SwitchListTileType { material, adaptive } ...@@ -89,6 +89,13 @@ enum _SwitchListTileType { material, adaptive }
/// ** See code in examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart ** /// ** See code in examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart **
/// {@end-tool} /// {@end-tool}
/// ///
/// {@tool dartpad}
/// This sample demonstrates how [SwitchListTile] positions the switch widget
/// relative to the text in different configurations.
///
/// ** See code in examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart **
/// {@end-tool}
///
/// ## Semantics in SwitchListTile /// ## Semantics in SwitchListTile
/// ///
/// Since the entirety of the SwitchListTile is interactive, it should represent /// Since the entirety of the SwitchListTile is interactive, it should represent
...@@ -113,7 +120,7 @@ enum _SwitchListTileType { material, adaptive } ...@@ -113,7 +120,7 @@ enum _SwitchListTileType { material, adaptive }
/// LinkedLabelRadio, that includes an interactive [RichText] widget that /// LinkedLabelRadio, that includes an interactive [RichText] widget that
/// handles tap gestures. /// handles tap gestures.
/// ///
/// ** See code in examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart ** /// ** See code in examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart **
/// {@end-tool} /// {@end-tool}
/// ///
/// ## SwitchListTile isn't exactly what I want /// ## SwitchListTile isn't exactly what I want
...@@ -129,7 +136,7 @@ enum _SwitchListTileType { material, adaptive } ...@@ -129,7 +136,7 @@ enum _SwitchListTileType { material, adaptive }
/// Here is an example of a custom LabeledSwitch widget, but you can easily /// Here is an example of a custom LabeledSwitch widget, but you can easily
/// make your own configurable widget. /// make your own configurable widget.
/// ///
/// ** See code in examples/api/lib/material/switch_list_tile/switch_list_tile.2.dart ** /// ** See code in examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart **
/// {@end-tool} /// {@end-tool}
/// ///
/// See also: /// See also:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment