Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Doc Samples For CheckboxListTile, RadioListTile and SwitchListTile #32703

Merged
merged 35 commits into from May 17, 2019
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
367d837
Moved Radio documentation line to be above sample
shihaohong May 14, 2019
43db79b
Added LabeledRadio sample
shihaohong May 14, 2019
83f3d97
Improve sentence in doc
shihaohong May 14, 2019
9fe9216
Add missing comma
shihaohong May 14, 2019
64911ae
Add LabeledCheckbox sample
shihaohong May 14, 2019
402a7ac
Add LabeledSwitch sample
shihaohong May 14, 2019
314cb54
Update doc wording
shihaohong May 14, 2019
39d29f7
Switch Container to Padding in examples
shihaohong May 14, 2019
432cee6
Update SwitchListTile to include tappable RichText
shihaohong May 14, 2019
6c3f736
Refactor LabeledRadio to be LabeledLinkedRadio
shihaohong May 14, 2019
b438f3d
Remove InkWell from SwitchListTile example
shihaohong May 14, 2019
9c13cb0
Update to Checkbox RichText Example
shihaohong May 14, 2019
b42e570
Fix incorrect usage of checkbox widgets in switch sample
shihaohong May 14, 2019
c8bc7fd
Update helper widget references
shihaohong May 14, 2019
db8f0d1
Fix sample code import block
shihaohong May 15, 2019
2b7e669
Improve code sample class names
shihaohong May 15, 2019
b4edf2d
Added explanation to Semantics samples
shihaohong May 15, 2019
f420964
Fix accidental paragraph deletion
shihaohong May 15, 2019
5661391
Added second example to RadioListTile
shihaohong May 15, 2019
0ffd80e
Added second example to CheckboxListTile
shihaohong May 15, 2019
ca040d9
Fix location of tool sample starting point
shihaohong May 15, 2019
787b9cf
Added second example to SwitchListTile
shihaohong May 15, 2019
89247b6
Fix CustomLabeledRadio Example
shihaohong May 15, 2019
582f83e
Fix LabeledRadio example to use groupValue correctly on InkWell tap
shihaohong May 15, 2019
62d3cb0
Update description of linked label widgets
shihaohong May 16, 2019
8271570
Update print string in linked label examples
shihaohong May 16, 2019
8f1094e
Added reference to Semantics docs
shihaohong May 16, 2019
693f3ba
Update wording of RichText reference in sample
shihaohong May 16, 2019
73a26f8
Update semantics paragraph explanation
shihaohong May 16, 2019
c3ff428
Reverse order of switch/checkbox with label in samples
shihaohong May 16, 2019
cd1488d
increased padding, made const padding
shihaohong May 16, 2019
61542ba
code cleanup
shihaohong May 16, 2019
64f3519
Improve semantics section description
shihaohong May 16, 2019
a965b2b
Improve simple Switch/Radio/CheckboxListTile samples
shihaohong May 16, 2019
4eba4dc
Added assets to samples
shihaohong May 16, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Update SwitchListTile to include tappable RichText

  • Loading branch information...
shihaohong committed May 14, 2019
commit 432cee664b640e19e197ee34c07f3f9e4086724d
@@ -76,44 +76,57 @@ enum _SwitchListTileType { material, adaptive }
///
/// {@tool snippet --template=stateful_widget_scaffold}
///
/// Here is an example of a custom LabeledSwitch widget, but you can easily
/// make your own configurable widget.
/// Here is an example of a custom LabeledLinkedCheckbox widget, but you can
/// easily make your own configurable widget.
///
/// ```dart code-imports
/// import 'package:flutter/gestures.dart';
/// ```
/// ```dart preamble
/// class LabeledSwitch extends StatelessWidget {
/// const LabeledSwitch({
/// class LabeledLinkedCheckbox extends StatelessWidget {
/// const LabeledLinkedCheckbox({
/// this.label,
/// this.padding,
/// this.groupValue,
/// this.value,
/// this.onChanged,
/// });
///
/// final String label;
/// final EdgeInsets padding;
/// final bool groupValue;
/// final bool value;
/// final Function onChanged;
///
/// @override
/// Widget build(BuildContext context) {
/// return InkWell(
/// onTap: () {
/// onChanged(!value);
/// },
/// child: Padding(
/// padding: padding,
/// child: Row(
/// children: <Widget>[
/// Switch(
/// return Padding(
/// padding: padding,
/// child: Row(
/// children: <Widget>[
/// InkWell(
/// onTap: () {
/// onChanged(!value);
/// },
/// child: Checkbox(
/// value: value,
/// onChanged: (bool newValue) {
/// onChanged(newValue);
/// },
/// )
/// ),
/// RichText(
/// text: TextSpan(
/// text: label,
/// style: TextStyle(
/// color: Colors.blueAccent,
/// decoration: TextDecoration.underline,
/// ),
/// recognizer: TapGestureRecognizer()
/// ..onTap = () {
/// print('Link has been tapped.');
/// },
/// ),
/// Text(label),
/// ],
/// ),
/// ),
/// ],
/// ),
/// );
/// }
@@ -126,8 +139,8 @@ enum _SwitchListTileType { material, adaptive }
/// Widget build(BuildContext context) {
/// return Scaffold(
/// body: Center(
/// child: LabeledSwitch(
/// label: 'This is the label text',
/// child: LabeledLinkedCheckbox(
/// label: 'Linked, tappable label text',
/// padding: EdgeInsets.symmetric(horizontal: 5.0),
/// value: isSelected,
/// onChanged: (bool newValue) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.