Update date picker examples, remove unused variables and add missing tests (#121528)

Update date picker examples, remove unused variables and add missing tests
This commit is contained in:
Taha Tesser
2023-02-28 10:31:51 +02:00
committed by GitHub
parent e5a382ec92
commit 87679ff1c3
10 changed files with 201 additions and 74 deletions

View File

@@ -14,6 +14,7 @@ class SwitchApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('Switch Sample')),
body: const Center(

View File

@@ -14,6 +14,7 @@ class SwitchApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('Switch Sample')),
body: const Center(

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for Switch
// Flutter code sample for [Switch].
import 'package:flutter/material.dart';
@@ -14,7 +14,7 @@ class SwitchApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4)),
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('Switch Sample')),
body: const Center(
@@ -35,15 +35,14 @@ class SwitchExample extends StatefulWidget {
class _SwitchExampleState extends State<SwitchExample> {
bool light0 = true;
bool light1 = true;
bool light2 = true;
final MaterialStateProperty<Icon?> thumbIcon = MaterialStateProperty.resolveWith<Icon?>((Set<MaterialState> states) {
// Thumb icon when the switch is selected.
if (states.contains(MaterialState.selected)) {
return const Icon(Icons.check);
}
return const Icon(Icons.close);
},
final MaterialStateProperty<Icon?> thumbIcon = MaterialStateProperty.resolveWith<Icon?>(
(Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
return const Icon(Icons.check);
}
return const Icon(Icons.close);
},
);
@override

View File

@@ -3,6 +3,7 @@
// found in the LICENSE file.
// Flutter code sample for [Switch].
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';