Skip to content

Link widget misaligns IconButtons in AppBar actions for Flutter Web #70053

@Wikiwix

Description

@Wikiwix

Steps to Reproduce

For Flutter Web, for the AppBar actions, if you wrap an IconButton into the url_launcher's Link widget, it does not get centred vertically.

The same code works for Android with the expected alignment.

Expected results:
Screenshot 2020-11-08 135109

Actual results:
Screenshot 2020-11-08 134705

Code:

import 'package:flutter/material.dart';
import 'package:url_launcher/link.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          actions: [
            Link(
              uri: Uri.parse('https://google.com'),
              target: LinkTarget.blank,
              builder: (context, onPressed) => IconButton(
                icon: Icon(Icons.info_outlined),
                onPressed: onPressed,
              ),
            ),
            IconButton(
              icon: Icon(Icons.info),
              onPressed: () {},
            ),
          ],
        ),
        body: Container(),
      ),
    );
  }
}

Flutter doctor:

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.23.0-18.1.pre, on Microsoft Windows [Version 10.0.19041.572], locale de-DE)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1.0)
[✓] VS Code, 64-bit edition (version 1.51.0)
[✓] Connected device (4 available)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listfound in release: 1.24Found to occur in 1.24has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: url_launcherPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.platform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions