Skip to content

[bug] Appearance of [NavigationRailDestination] while disabled not coherent, the label is ignoring the attribute and not being darkened #132344

@matheus-kirchesch

Description

@matheus-kirchesch

Is there an existing issue for this?

Steps to reproduce

  1. Instatiate a NavigationRail with two destinations and extended attribute set to true

Thats all you need, you will see that the label doesn't get affected.

I have fixed it, but I need to open an Issue before opening a PR, will link it soon

Expected results

Expect for it to have a coherent look with both icon and label affected by the disabled attribute.

Actual results

Only the icon gets affected

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Navigation rail destination disabled label problem',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Scaffold(
        body: NavigationRail(
          extended: true,
          destinations: const [
            NavigationRailDestination(
              icon: Icon(Icons.abc),
              label: Text('Active'),
              disabled: false,
            ),
            NavigationRailDestination(
              icon: Icon(Icons.ac_unit),
              label: Text('Disabled'),
              disabled: true,
            ),
          ],
          selectedIndex: 0,
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

how_it_is_how_it_should_be

Logs

No response

Flutter Doctor output

Doctor output

NOTE: This is a fork of the master branch, updated right now

[!] Flutter (Channel [user-branch], 3.14.0-3.0.pre.14, on Microsoft Windows [Version 10.0.22631.2129],
    locale en-GB)
    ! Flutter version 3.14.0-3.0.pre.14 on channel [user-branch] at C:\dev-apps\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at
      https://flutter.dev/docs/get-started/install.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.5)
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.81.1)
[✓] Connected device (4 available)
[✓] Network resources

! Doctor found issues in 1 category.

Metadata

Metadata

Labels

P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.found in release: 3.10Found to occur in 3.10found in release: 3.14Found to occur in 3.14frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions