8000 `NavigationDrawer` active indicator offset with `SvgPicture` · Issue #169436 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
NavigationDrawer active indicator offset with SvgPicture #169436
Closed
@ferraridamiano

Description

@ferraridamiano

Steps to reproduce

In the latest flutter stable release when there is a SvgPicture as a header of a NavigationDrawer the active indicator is shifted by some pixels. The result is as expected as soon as you interact with the UI

  1. Copy the code below
  2. Include whatever svg in the asset folder of your pubspec.yaml
  3. Run the app (tested both android and linux)

Expected results

No offset of the active indicator

Actual results

Offset of the active indicator

Code sample

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

void main() => runApp(const NavigationDrawerApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Navigation Drawer')),
        drawer: NavigationDrawer(
          selectedIndex: 0,
          children: [
            SvgPicture.asset('assets/star.svg', width: 150),
            NavigationDrawerDestination(
              icon: Icon(Icons.inbox_outlined),
              label: const Text('Inbox'),
            ),
            NavigationDrawerDestination(
              icon: Icon(Icons.send_outlined),
              label: const Text('Outbox'),
            ),
            NavigationDrawerDestination(
              icon: Icon(Icons.favorite_border),
              label: const Text('Favorites'),
            ),
          ],
        ),
        body: SizedBox(),
      ),
    );
  }
}
pubspec.yaml
name: mysample
description: "A new Flutter project."
version: 1.0.0+1
environment:
  sdk: ^3.8.0

dependencies:
  flutter:
    sdk: flutter
  flutter_svg: ^2.1.0

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true
  assets:
    - assets/

Screenshots or Video

Video (android)
document_5884126004636556425.mp4
Video (linux)
Screencast.From.2025-05-26.20-24-02.mp4

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.32.0, on EndeavourOS 6.14.6-arch1-1, locale en_US.UTF-8) [98ms]
    • Flutter version 3.32.0 on channel stable at /usr/bin/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision be698c48a6 (6 days ago), 2025-05-19 12:59:14 -0700
    • Engine revision 1881800949
    • Dart version 3.8.0
    • DevTools version 2.45.1

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,511ms]
    • Android SDK at /home/damiano/Android/Sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /usr/lib/jvm/java-17-openjdk/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 17.0.15+6)
    • All Android licenses accepted.

[✓] Chrome - develop for the web [18ms]
    • CHROME_EXECUTABLE = /var/lib/flatpak/app/com.google.Chrome/current/active/files/extra/chrome

[✓] Linux toolchain - develop for Linux desktop [307ms]
    • clang version 19.1.7
    • cmake version 3.28.1
    • ninja version 1.11.1
    • pkg-config version 2.4.3
    • OpenGL core renderer: AMD Radeon Graphics (radeonsi, renoir, ACO, DRM 3.61, 6.14.6-arch1-1)
    • OpenGL core version: 4.6 (Core Profile) Mesa 25.1.1-arch1.1
    • OpenGL core shading language version: 4.60
    • OpenGL ES renderer: AMD Radeon Graphics (radeonsi, renoir, ACO, DRM 3.61, 6.14.6-arch1-1)
    • OpenGL ES version: OpenGL ES 3.2 Mesa 25.1.1-arch1.1
    • OpenGL ES shading language version: OpenGL ES GLSL ES 3.20
    • GL_EXT_framebuffer_blit: yes
    • GL_EXT_texture_format_BGRA8888: yes

[!] Android Studio (version unknown) [16ms]
    • Android Studio at /opt/android-studio/
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • android-studio-dir = /opt/android-studio/
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)

[!] Android Studio (version unknown) [14ms]
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine Android Studio version.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)

[✓] Connected device (3 available) [314ms]
    • Pixel 7a (mobile) • 37281JEHN00912 • android-arm64  • Android 15 (API 35)
    • Linux (desktop)   • linux          • linux-x64      • EndeavourOS 6.14.6-arch1-1
    • Chrome (web)      • chrome         • web-javascript • Google Chrome 136.0.7103.113

[✓] Network resources [277ms]
    • All expected network resources are available.

Metadata

Metadata

Assignees

Labels

c: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.found in release: 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33frameworkflutter/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 team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0