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:
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flutter code sample for [Switch].
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user