Skip to content

Expected a value of type 'BorderRadius?', but got one of type 'BorderRadiusDirectional' #88039

Closed

Description

@ahmednfwela

Steps to Reproduce

import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Directionality(
        textDirection: TextDirection.rtl,
        child: Scaffold(
          body: Center(
            child: Container(
              height: 80,
              width: 80,
              clipBehavior: Clip.antiAlias,
              decoration: BoxDecoration(
                border: Border.all(width: 3, color: Colors.black),
                borderRadius: BorderRadiusDirectional.horizontal(
                  start: Radius.circular(35),
                ),
              ),
              child: Text('hello'),
            ),
          ),
        ),
      ),
    ),
  );
}

Expected results:

image

Actual results:

The following TypeErrorImpl was thrown during paint():
Expected a value of type 'BorderRadius?', but got one of type 'BorderRadiusDirectional'

I think the culprit is this line https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/painting/box_decoration.dart#L488

and

https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/painting/box_border.dart#L206

since it should be of type BorderRadiusGeometry

Logs

[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19043.1110], locale en-US)
    • Flutter version 2.2.3 at C:\tools\flutter
    • Framework revision f4abaa0735 (6 weeks 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.2) 
    • Android SDK at 
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = 
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java       
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

Activity

  1. maheshj01 commented on Aug 12, 2021

    @maheshj01
    Member

    reproducible on the latest stable 2.2.3 and the master 2.5.0-6.0.pre.21
    Looks similar to #26468

    flutter doctor -v
    [✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-arm, locale en-GB)
        • Flutter version 2.2.3 at /Users/mahesh/Documents/flutter
        • Framework revision f4abaa0735 (6 weeks 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 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/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 /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5.1, Build version 12E507
        • 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.58.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.25.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-arm64   • macOS 11.4 20F71 darwin-arm
        • Chrome (web)    • chrome • web-javascript • Google Chrome 92.0.4515.131
    
    • No issues found!
    
    [✓] Flutter (Channel master, 2.5.0-6.0.pre.21, on macOS 11.4 20F71 darwin-arm, locale en-GB)
        • Flutter version 2.5.0-6.0.pre.21 at /Users/mahesh/Documents/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 40e8620a27 (4 days ago), 2021-08-06 09:14:50 +0430
        • Engine revision 431ac604da
        • Dart version 2.14.0 (build 2.14.0-383.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/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 /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5.1, Build version 12E507
        • 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.58.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.25.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-arm64   • macOS 11.4 20F71 darwin-arm
        • Chrome (web)    • chrome • web-javascript • Google Chrome 92.0.4515.131
    
    • No issues found!
    

    Originally filed here #24257

  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Aug 12, 2021
  3. added
    r: fixedIssue is closed as already fixed in a newer version
    on Sep 1, 2021
  4. github-actions commented on Sep 15, 2021

    @github-actions

    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.

  5. locked as resolved and limited conversation to collaborators on Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consolefound in release: 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5frameworkflutter/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 version

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions