The highlighting around the slider tick remains visible after the change to the widget completes, same goes for highlighting on dropdown items. The issue was found on a linux desktop app but can be reproduced in dart pad, see code below.
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. 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';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
final String title;
const MyHomePage({
Key? key,
required this.title,
}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
double sliderValue = 0;
String dropdownValue = 'a';
List<DropdownMenuItem> getItems() {
List<DropdownMenuItem> items = [];
for (String label in ['a', 'b', 'c']) {
items.add(
DropdownMenuItem(
value: label,
child: Text(label),
),
);
}
return items;
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
DropdownButton(
value: dropdownValue,
items: getItems(),
onChanged: (value) {
setState(() {
dropdownValue = value;
});
}),
Slider(
value: sliderValue,
min: 0,
max: 10,
onChanged: (value) {
setState(() {
sliderValue = value;
});
},
),
],
),
),
);
}
}
This behavior was implemented based on the Material 3 specification (see #113543)
Owner Name | flutter |
Repo Name | flutter |
Full Name | flutter/flutter |
Language | Dart |
Created Date | 2015-03-06 |
Updated Date | 2023-03-30 |
Star Count | 151602 |
Watcher Count | 3555 |
Fork Count | 25000 |
Issue Count | 11498 |
Issue Title | Created Date | Updated Date |
---|