Skip to content

BorderRadius.circular constructor should be const #146681

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
mschlegelaware opened this issue Apr 12, 2024 · 3 comments
Closed

BorderRadius.circular constructor should be const #146681

mschlegelaware opened this issue Apr 12, 2024 · 3 comments
Labels
r: duplicate Issue is closed as a duplicate of an existing issue

Comments

@mschlegelaware
Copy link

Steps to reproduce

The named constructor BorderRadius.circular is not marked as const (even though it could be) and therefore it can not be used as default value in other constructors.

Expected results

BorderRadius.circular is marked as const as the other constructors (.vertical, .horizontal, .all etc.) and can be used for default values in other constructors.

Actual results

BorderRadius.circular can not be used as default value in other constructors.

Code sample

Code sample
  const WhiteTile({
    super.key,
    this.borderRadius = const BorderRadius.circular(8),
  });

/// Dart analyzer output:
/// The constructor being called isn't a const constructor. Try removing 'const' from the constructor invocation.
/// The default value of an optional parameter must be constant.

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.13.9, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
    • Flutter version 3.13.9 on channel stable at /Users/XXX/fvm/versions/3.13.9
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d211f42860 (6 months ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/XXX/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/XXX/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.2

[✓] Android Studio (version 2023.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 17.0.9+0-17.0.9b1087.7-11185874)

[✓] Connected device (2 available)
    • XXX’s iPhone (mobile)            • 00008110-001264242178401E            • ios • iOS 17.2.1 21C66
    • iPhone SE (3rd generation) (mobile) • 44047583-196A-476F-8493-910D1FBBF8AE • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)

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

• No issues found!
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Apr 12, 2024
@darshankawar
Copy link
Member

@mschlegelaware Thanks for the report.
Check #28535 with underlying issues.
And #5191 with dart-lang/language#823

Will close this in favor of the linked issues. If you disagree, write in comments and I'll reopen it.

@darshankawar darshankawar closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2024
@darshankawar darshankawar added r: duplicate Issue is closed as a duplicate of an existing issue and removed in triage Presently being triaged by the triage team labels Apr 12, 2024
@mschlegelaware
Copy link
Author

@darshankawar thank you! Sorry that I did not double check for already existing similar issues, maybe it was mentioned before opening a ticket, but I missed to read that if there was a hint.

Copy link

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 flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: duplicate Issue is closed as a duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

2 participants