-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
RaisedButton disabled style has two states #38602
Comments
Issue still exist if you change null code sampleimport 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
void main() {
timeDilation = 5;
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool enabled = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
home: Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: Center(
child: RaisedButton(
shape: StadiumBorder(),
color: Theme.of(context).primaryColor,
onPressed: enabled ? () {} : null,
child: Text(
'Enviar e-mail',
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary,
fontSize: 20,
),
),
),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.touch_app),
onPressed: () {
setState(() {
enabled = !enabled;
});
},
),
),
);
}
}
flutter doctor -v
|
Previewcode sampleimport 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
void main() {
timeDilation = 5;
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
bool enabled = false;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
home: Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: Center(
child: RaisedButton(
shape: StadiumBorder(),
color: Theme.of(context).primaryColor,
onPressed: enabled ? () {} : null,
child: Text(
'Enviar e-mail',
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary,
fontSize: 20,
),
),
),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.touch_app),
onPressed: () {
setState(() {
enabled = !enabled;
});
},
),
),
);
}
}
multiple flutter doctor -v[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale
en-GB)
• Flutter version 1.22.5 at /Users/tahatesser/Code/flutter_stable
• Framework revision 7891006299 (12 days ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/tahatesser/Code/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/tahatesser/Code/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.0
[!] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.17.0
[✓] Connected device (2 available)
• RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android
10 (API 29)
• Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS
14.3
! Doctor found issues in 1 category. [✓] Flutter (Channel dev, 1.26.0-1.0.pre, on macOS 11.1 20C69 darwin-x64, locale
en-GB)
• Flutter version 1.26.0-1.0.pre at /Users/tahatesser/Code/flutter_dev
• Framework revision 63062a6443 (9 days ago), 2020-12-13 23:19:13 +0800
• Engine revision 4797b06652
• Dart version 2.12.0 (build 2.12.0-141.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/tahatesser/Code/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/tahatesser/Code/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• 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
1.8.0_242-release-1644-b3-6915495)
[!] Android Studio
• Android Studio at /Applications/Android/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
✗ Android Studio not found at /Applications/Android/Contents
• Try updating or re-installing Android Studio.
[✓] VS Code (version 1.52.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.17.0
[✓] Connected device (4 available)
• RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 •
Android 10 (API 29)
• Taha’s iPad (mobile) • 00008020-000255113EE8402E • ios • iOS
14.3
• macOS (desktop) • macos • darwin-x64 • macOS
11.1 20C69 darwin-x64
• Chrome (web) • chrome • web-javascript • Google
Chrome 87.0.4280.88
! Doctor found issues in 1 category. |
RaisedButton has been removed from the framework now, and has been been replaced by ElevatedButton. Does this issue still persist in the new API? |
No, it's fixed, thanks for point it out @Piinks :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I have this
RaisedButton
:When the
onPressed
isnull
and theRaisedButton
becomes disabled I expected it to just go light gray, but it instead goes to dark gray and then light gray, as the slowed-down video here shows.Which are basically this steps:
Enabled:
Going Disabled (dark gray):
Disabled (light gray):
I couldn't find this defined at the Material Design specs, and honestly I thing this looks weird, is this intended behavior?
The text was updated successfully, but these errors were encountered: