Skip to content

Button behaves differently in Web/Desktop and Mobile #85729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bernaferrari opened this issue Jul 1, 2021 · 7 comments · Fixed by #168062
Closed

Button behaves differently in Web/Desktop and Mobile #85729

bernaferrari opened this issue Jul 1, 2021 · 7 comments · Fixed by #168062
Labels
d: api docs Issues with https://api.flutter.dev/ f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 found in release: 2.3 Found to occur in 2.3 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project platform-android Android applications specifically platform-ios iOS applications specifically team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@bernaferrari
Copy link
Contributor

bernaferrari commented Jul 1, 2021

[Expected] Flutter Web (beta and dartpad):
image

[Weird] Android (tested on beta):

return Column(
          children: [
            for (int i = 0; i < 5; i++)
              ElevatedButton(
                style: ElevatedButton.styleFrom(
                  primary: Colors.red,
                  padding: EdgeInsets.zero,
                  minimumSize: Size.zero,
                  visualDensity: VisualDensity.standard,
                  fixedSize: const Size(100, 8),
                  shape: const RoundedRectangleBorder(),
                  elevation: 0,
                ),
                onPressed: () {},
                child: Container(),
              )
          ],
        );

Possible fix: wrap ElevatedButton in SizedBox. This, however, shouldn't be necessary with the fixedSize property.

[✓] Flutter (Channel beta, 2.3.0-24.1.pre, on macOS 11.4 20F71 darwin-x64,
    locale en-BR)
    • Flutter version 2.3.0-24.1.pre at /usr/local/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 615957513e (6 days ago), 2021-06-25 09:24:44 -0700
    • Engine revision 9d517f475b
    • Dart version 2.14.0 (build 2.14.0-188.5.beta)
@TahaTesser TahaTesser added the in triage Presently being triaged by the triage team label Jul 2, 2021
@TahaTesser
Copy link
Member

Hi @bernaferrari
Thanks for filing the issue

The issue reproduces on both mobile platforms, while web and desktop have the expected behavior

Used the following minimal code sample

minimal code sample
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Material App Bar'),
      ),
      body: Column(
          children: [
            for (int i = 0; i < 5; i++)
              ElevatedButton(
                style: ElevatedButton.styleFrom(
                  primary: Colors.red,
                  padding: EdgeInsets.zero,
                  minimumSize: Size.zero,
                  visualDensity: VisualDensity.standard,
                  fixedSize: const Size(100, 8),
                  shape: const RoundedRectangleBorder(),
                  elevation: 0,
                ),
                onPressed: () {},
                child: Container(),
              )
          ],
        ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.add),
        onPressed: () {},
      ),
    );
  }
}

Preview

Screen Shot 2021-07-02 at 19 39 09

logs

logs
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftFoundation.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftFoundation.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreMedia.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreMedia.dylib
[   +2 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftAppKit.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftAppKit.dylib
[   +2 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftos.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftos.dylib
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftFoundation.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftFoundation.dylib
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreData.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreData.dylib
[   +1 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftIOKit.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftIOKit.dylib
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftQuartzCore.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftQuartzCore.dylib
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCore.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCore.dylib
[   +1 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreMedia.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreMedia.dylib
[  +44 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreData.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreData.dylib
[   +7 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreMedia.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreMedia.dylib
[   +2 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftos.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftos.dylib
[   +1 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftAppKit.dylib
[   +3 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftAppKit.dylib
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreData.dylib is unchanged; keeping original
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreAudio.dylib
[   +1 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreAudio.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftIOKit.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftIOKit.dylib
[   +1 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftQuartzCore.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftQuartzCore.dylib
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreMedia.dylib is unchanged; keeping original
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftos.dylib is unchanged; keeping original
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreLocation.dylib
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftAppKit.dylib is unchanged; keeping original
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftMetal.dylib
[   +3 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftMetal.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreGraphics.dylib
[   +2 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreGraphics.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreLocation.dylib
[        ] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftQuartzCore.dylib is unchanged; keeping original
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftIOKit.dylib is unchanged; keeping original
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCloudKit.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCloudKit.dylib
[   +3 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreAudio.dylib
[   +1 ms] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreAudio.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftContacts.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftContacts.dylib
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftMetal.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftMetal.dylib
[   +1 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreLocation.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreLocation.dylib
[   +3 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftContacts.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftContacts.dylib
[   +1 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreGraphics.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreGraphics.dylib
[   +1 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCloudKit.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCloudKit.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftFoundation.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftFoundation.dylib
[  +11 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftFoundation.dylib is unchanged; keeping original
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftXPC.dylib
[   +2 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftXPC.dylib
[   +6 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftXPC.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftXPC.dylib
[   +4 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreAudio.dylib
[   +1 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreAudio.dylib
[   +5 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreAudio.dylib is unchanged; keeping original
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftDispatch.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftDispatch.dylib
[   +1 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftContacts.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftContacts.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftMetal.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftMetal.dylib
[   +4 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreGraphics.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreGraphics.dylib
[   +1 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCloudKit.dylib
[   +1 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCloudKit.dylib
[   +2 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreLocation.dylib
[   +1 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreLocation.dylib
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftContacts.dylib is unchanged; keeping original
[   +2 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftMetal.dylib is unchanged; keeping original
[   +1 ms] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftDispatch.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftDispatch.dylib
[   +1 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftObjectiveC.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftObjectiveC.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreImage.dylib
[   +1 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreImage.dylib
[        ] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCloudKit.dylib is unchanged; keeping original
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreGraphics.dylib is unchanged; keeping original
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreFoundation.dylib
[   +2 ms] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreFoundation.dylib
[        ] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreLocation.dylib is unchanged; keeping original
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftObjectiveC.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftObjectiveC.dylib
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreImage.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreImage.dylib
[        ] Codesigning
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreFoundation.dylib
[        ] /usr/bin/codesign --force --sign - --verbose
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreFoundation.dylib
[   +3 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftXPC.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftXPC.dylib
[  +10 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftXPC.dylib is unchanged; keeping original
[  +14 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftDispatch.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftDispatch.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreImage.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreImage.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftObjectiveC.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftObjectiveC.dylib
[   +4 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreImage.dylib is unchanged; keeping original
[        ] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftDispatch.dylib is unchanged; keeping original
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftObjectiveC.dylib is unchanged; keeping original
[   +1 ms] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreFoundation.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreFoundation.dylib
[        ] Probing signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCore.dylib
[        ] /usr/bin/codesign -r- --display
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCore.dylib
[   +4 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCoreFoundation.dylib is unchanged; keeping original
[   +1 ms] Code signature of
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Frameworks/
libswiftCore.dylib is unchanged; keeping original
[   +2 ms] CodeSign /Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app
(in target 'Runner' from project 'Runner')
[        ]     cd /Users/tahatesser/StudioProjects/stable_flutter/macos
[        ]     export
CODESIGN_ALLOCATE\=/Volumes/Extreme/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_al
locate
[        ]     Signing Identity:     "-"
[        ]     /usr/bin/codesign --force --sign - --entitlements
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Intermediates.noindex/Runner.build/Debug/Runner.build/
stable_flutter.app.xcent --timestamp\=none
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app
[  +66 ms] Validate /Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app
(in target 'Runner' from project 'Runner')
[        ]     cd /Users/tahatesser/StudioProjects/stable_flutter/macos
[        ]     builtin-validationUtility
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app
-no-validate-extension
[        ] RegisterWithLaunchServices
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app (in target 'Runner'
from project 'Runner')
[        ]     cd /Users/tahatesser/StudioProjects/stable_flutter/macos
[        ]
/System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Versions/Current/
Support/lsregister -f -R -trusted
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app
[ +176 ms] ** BUILD SUCCEEDED **
[  +56 ms] Building macOS application... (completed in 21.1s)
[   +4 ms] executing: /usr/bin/plutil -convert json -o -
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Info.plist
[  +15 ms] Exit code 0 from: /usr/bin/plutil -convert json -o -
/Users/tahatesser/StudioProjects/stable_flutter/build/macos/Build/Products/Debug/stable_flutter.app/Contents/Info.plist
[        ]
{"CFBundleName":"stable_flutter","DTXcode":"1250","DTSDKName":"macosx11.3","NSHumanReadableCopyright":"Copyright © 2021
com.example. All rights
reserved.","DTSDKBuild":"20E214","CFBundleDevelopmentRegion":"en","CFBundleVersion":"1","BuildMachineOSBuild":"20F71","N
SPrincipalClass":"NSApplication","CFBundleIconName":"AppIcon","CFBundlePackageType":"APPL","CFBundleIconFile":"AppIcon",
"CFBundleSupportedPlatforms":["MacOSX"],"DTPlatformName":"macosx","CFBundleShortVersionString":"1.0.0","NSMainNibFile":"
MainMenu","CFBundleInfoDictionaryVersion":"6.0","CFBundleExecutable":"stable_flutter","DTCompiler":"com.apple.compilers.
llvm.clang.1_0","CFBundleIdentifier":"com.example.stableFlutter","DTPlatformVersion":"11.3","DTXcodeBuild":"12E262","LSM
inimumSystemVersion":"10.11","DTPlatformBuild":"12E262"}
[+1403 ms] Observatory URL on device: http://127.0.0.1:53350/TJJRH7ArpoY=/
[  +18 ms] Caching compiled dill
[ +112 ms] Connecting to service protocol: http://127.0.0.1:53350/TJJRH7ArpoY=/
[ +243 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at
http://127.0.0.1:53350/TJJRH7ArpoY=/.
[ +123 ms] DDS is listening at http://127.0.0.1:53353/bnCrmAM9gvA=/.
[  +93 ms] Successfully connected to service protocol: http://127.0.0.1:53350/TJJRH7ArpoY=/
[  +30 ms] DevFS: Creating new filesystem on the device (null)
[  +70 ms] DevFS: Created new filesystem on the device
(file:///var/folders/ml/gl4d5v8n2rn6qpd8yf3t7tl40000gn/T/com.example.stableFlutter/stable_flutterTUEsR4/stable_flutter/)
[   +4 ms] Updating assets
[ +118 ms] Syncing files to device macOS...
[   +1 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[   +3 ms] <- recompile package:stable_flutter/main.dart 66336299-fb69-4f29-a063-e1ce69b7a923
[        ] <- 66336299-fb69-4f29-a063-e1ce69b7a923
[ +115 ms] Updating files.
[        ] DevFS: Sync finished
[   +2 ms] Syncing files to device macOS... (completed in 122ms)
[        ] Synced 0.0MB.
[   +1 ms] <- accept
[   +2 ms] Connected to _flutterView/0x7fb14a0cf820.
[   +3 ms] Flutter run key commands.
[   +2 ms] r Hot reload. 🔥🔥🔥
[   +1 ms] R Hot restart.
[        ] h List all available interactive commands.
[        ] d Detach (terminate "flutter run" but leave application running).
[        ] c Clear the screen
[        ] q Quit (terminate the application on the device).
[        ] 💪 Running with sound null safety 💪
[   +1 ms] An Observatory debugger and profiler on macOS is available at: http://127.0.0.1:53353/bnCrmAM9gvA=/
[ +292 ms] DevTools activation throttled until 2021-07-03 00:57:16.875746.
[ +622 ms] The Flutter DevTools debugger and profiler on macOS is available at:
                    http://127.0.0.1:9101?uri=http://127.0.0.1:53353/bnCrmAM9gvA=/
stable master

Check flutter doctor -v outputs for each channel below

flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale
    en-US)
    • Flutter version 2.2.3 at /Users/tahatesser/Code/flutter_stable
    • Framework revision f4abaa0735 (21 hours ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
      • iOS 14.6
    • iPhone 12 Pro (mobile) • 4819C924-80DB-4DE5-9093-71A234590ABB • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 11.4 20F71 darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 91.0.4472.114

• No issues found!
[✓] Flutter (Channel master, 2.3.0-17.0.pre.631, on macOS 11.4 20F71 darwin-x64,
    locale en-US)
    • Flutter version 2.3.0-17.0.pre.631 at
      /Users/tahatesser/Code/flutter_master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 63f13df4c9 (7 hours ago), 2021-07-02 05:01:06 -0400
    • Engine revision afa3f47115
    • Dart version 2.14.0 (build 2.14.0-269.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Volumes/Extreme/SDK
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /Volumes/Extreme/SDK
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
      • iOS 14.6 18F72
    • iPhone 12 Pro (mobile) • 4819C924-80DB-4DE5-9093-71A234590ABB • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
    • macOS (desktop)        • macos                                • darwin-x64
      • macOS 11.4 20F71 darwin-x64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 91.0.4472.114

• No issues found!

✅ : No Issue ❌: Issue reproduced

@bernaferrari bernaferrari changed the title Button behaves differently in Android Button behaves differently in Web/Desktop and Mobile Jul 2, 2021
@TahaTesser TahaTesser added f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 2.3 Found to occur in 2.3 platform-android Android applications specifically platform-ios iOS applications specifically and removed in triage Presently being triaged by the triage team labels Jul 2, 2021
@HansMuller HansMuller self-assigned this Jul 2, 2021
@HansMuller
Copy link
Contributor

What you're seeing here is the effect of the button style's tapTargetSize parameter. By default it overrides the button's minimum size on mobile devices to ensure that the button is at least 48x48, which makes it accessible.

Here's a slightly simplified version of the sample that demonstrates how to configure a column of 100x8 buttons that are as tightly packed as in the original. The results are the same on mobile, desktop, and dartpad.

import 'package:flutter/material.dart';

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final style = ElevatedButton.styleFrom(
      primary: Colors.red,
      tapTargetSize: MaterialTapTargetSize.shrinkWrap,
      minimumSize: Size.zero,
      fixedSize: const Size(100, 8),
      shape: RoundedRectangleBorder(),
    );
    return Scaffold(
      body: Container(
        padding: EdgeInsets.all(16),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            for (int i = 0; i < 5; i += 1)
              ElevatedButton(
                style: style,
                onPressed: () {},
                child: SizedBox(),
              )
          ],
        ),
      ),
    );
  }
}

void main() {
  runApp(MaterialApp(home: Home()));
}

I'm going to close this issue. If you feel that I've overlooked something, please reopen it.

@bernaferrari
Copy link
Contributor Author

Thanks. I didn't know about that parameter. My question is: shouldn't fixedSize overwrite that? I always thought fixedSize would be equivalent to SizedBox(child: ElevatedButton()) and not min(width, tapTarget). Maybe you could update fixedSize documentation to mention tapTarget?

This is false in this specific case.
image

@HansMuller HansMuller reopened this Jul 14, 2021
@HansMuller
Copy link
Contributor

@bernaferrari - Good point; will do.

@bernaferrari
Copy link
Contributor Author

What if we made the Button stop adding this padding as part of Material 3? It wouldn't be "that breaking". I can't use VisualDensity because changing spacing is much different than adding/removing spacing. The layout breaks between devices due to visual density.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team and removed triaged-design Triaged by Design Languages team labels Jul 8, 2023
@flutter-triage-bot
Copy link

This issue is assigned but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

@flutter-triage-bot flutter-triage-bot bot added the Bot is counting down the days until it unassigns the issue label Jul 30, 2023
@flutter-triage-bot
Copy link

This issue was assigned to @HansMuller but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

@flutter-triage-bot flutter-triage-bot bot removed the Bot is counting down the days until it unassigns the issue label Sep 26, 2023
@HansMuller HansMuller added P3 Issues that are less important to the Flutter project triaged-design Triaged by Design Languages team labels Sep 27, 2023
github-merge-queue bot pushed a commit that referenced this issue May 22, 2025
## Description

This PR updates `ButtonStyle.minimumSize` and `ButtonStyle.fixedSize`
documentation.

It updates the documentation in order to describe the current behavior
as it might be surprising.
I have considered changing the behavior related to
`ButtonStyle.minimumSize` but while experimenting I noticed that several
widgets in the framework (and several tests) use
`ButtonStyle.minimumSize` with the expectation that the given size is
adjusted based on the ambient visual density (and there are probably
several similar usages outside of the framework in Google and non-Google
apps).

## Related Issue

ButtonStyle.minimumSize : Fixes [minimumSize not respected properly when
visual density is not
standard](#123528)
ButtonStyle.fixedSize : Fixes [Button behaves differently in Web/Desktop
and Mobile](#85729)

## Tests

Documentation only

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d: api docs Issues with https://api.flutter.dev/ f: material design flutter/packages/flutter/material repository. found in release: 2.2 Found to occur in 2.2 found in release: 2.3 Found to occur in 2.3 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P3 Issues that are less important to the Flutter project platform-android Android applications specifically platform-ios iOS applications specifically team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy