flutter/dev/tools
Taha Tesser e1cd7b11f6
Introduce Switch.padding (#149884)
fixes [Switch has some padding that leads to uncentered UI](https://github.com/flutter/flutter/issues/148498)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              ColoredBox(
                color: Colors.amber,
                child: Switch(
                  padding: EdgeInsets.zero,
                  value: true,
                  materialTapTargetSize: MaterialTapTargetSize.padded,
                  onChanged: (bool value) {},
                ),
              ),
              const SizedBox(height: 16),
              ColoredBox(
                color: Colors.amber,
                child: Switch(
                  value: true,
                  materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
                  onChanged: (bool value) {},
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>

### Default Switch size

<img width="476" alt="Screenshot 2024-07-11 at 13 25 05" src="https://github.com/flutter/flutter/assets/48603081/f9f3f6c6-443d-4bd5-81d4-5e314554b032">

### Update Switch size using the new `Switch.padding` to address  [Switch has some padding that leads to uncentered UI](https://github.com/flutter/flutter/issues/148498)

<img width="476" alt="Screenshot 2024-07-11 at 13 24 40" src="https://github.com/flutter/flutter/assets/48603081/aea0717b-e852-4b8d-b703-c8c4999d4863">
2024-07-16 20:25:09 +00:00
..
bin Let the lockfile script generate lockfiles for kotlin gradle files as well (#150471) 2024-06-20 20:22:18 +00:00
gen_defaults Introduce Switch.padding (#149884) 2024-07-16 20:25:09 +00:00
gen_keycodes Roll pub packages (#151816) 2024-07-16 12:34:24 +00:00
localization Use correct locale for CupertinoDatePicker weekday (#151494) 2024-07-11 00:10:17 +00:00
test Remove master from API docs (#144425) 2024-03-01 01:06:56 +00:00
vitool Roll pub packages (#151816) 2024-07-16 12:34:24 +00:00
.gitignore [flutter_conductor] update dev/tools with release tool (#69791) 2020-11-06 11:14:04 -08:00
create_api_docs.dart Move snippets package back into flutter repo (#147690) 2024-05-03 06:09:03 +00:00
dartdoc_checker.dart Add info strings to code blocks. (#146085) 2024-04-01 14:05:16 -07:00
examples_smoke_test.dart Implementing control flow collections (#146601) 2024-04-15 16:06:07 +00:00
find_engine_commit.dart begin migrating //flutter/dev/tools to null-safety (#80834) 2021-04-23 20:24:03 -07:00
mega_gallery.dart Implementing a few switch statements (#150946) 2024-07-01 23:36:32 +00:00
pubspec.yaml Roll pub packages (#151816) 2024-07-16 12:34:24 +00:00
repackage_gradle_wrapper.sh Point to a new artifacts location. (#70673) 2021-02-04 18:44:47 -08:00
update_icons.dart Update old wiki links (#149544) 2024-06-17 17:26:08 +00:00