-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework team
Description
Steps to reproduce
- Run the code sample
- Press the menu button (upper left corner)
- Press/long-press the second destination
- Note that the interaction states in the second destination are not visible
- Remove the
backgroundColorfrom theNavigationDrawerDestination - Note that the interaction states are present again
Expected results
Interaction states (for example a touch ripple, hover state and focused state) should be present when interacting with the NavigationDrawerDestination after having specified backgroundColor.
Actual results
The background color obscures interaction states.
Since the NavigationDrawerDestination uses navigationDrawerTheme.backgroundColor when backgroundColor is null, specifying backgroundColor in NavigationDrawerThemeData also causes this issue.
Additionally, the background color extends outside of the shape of the NavigationDrawerDestination, all the way to the edges of the NavigationDrawer which is surprising.
Code sample
Code sample
// ignore_for_file: prefer_const_constructors
// ignore_for_file: prefer_const_literals_to_create_immutables
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(),
drawer: NavigationDrawer(
children: [
NavigationDrawerDestination(
icon: Icon(Icons.home),
label: Text('First destination'),
),
NavigationDrawerDestination(
backgroundColor: Colors.grey.shade300,
icon: Icon(Icons.bug_report),
label: Text('Second destination'),
),
],
),
),
);
}
}Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.27.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-SE)
• Flutter version 3.27.0 on channel stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8495dee1fd (25 hours ago), 2024-12-10 14:23:39 -0800
• Engine revision 83bacfc525
• Dart version 3.6.0
• DevTools version 2.40.2Metadata
Metadata
Assignees
Labels
f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework team
Type
Projects
Status
Done (PR merged)