`edge_insets.dart` should be reviewed

This issue has been created since 2022-11-23.

Here is the link to the file: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/painting/edge_insets.dart#L23

Some things found about the classes in this file.

-In edge_insets.dart on lines 894 and 997 the assert(direction != null); is called even tho on lines 893 and 996 we accept a nullable parameter. These assertion is redundant or we shouldn't accept a nullable parameter.

-The constructor EdgeInsetsDirectional.all is more expensive than EdgeInsets to resolve and this hasn't been documented. Also I don't think there's a proper reason for EdgeInsetsDirectional.all to exist in the codebase.
I propose that EdgeInsetsDirectional.all is removed. Same goes for EdgeInsetsDirectional.symmetrical.

-The way inheritance is used here could be argued as bad practice. Every sibling class(whose parent is EdgeInsetsGeometry) has to be aware of the EdgeInsets class.
I propose that someone with deeper knowledge of the framework or the file itself would review the file with this thought in their mind.

-Someone experienced should review the whole file imo

exaby73 wrote this answer on 2022-11-24

Hello @patrikheinonen. Could you include permalinks to the code in question for easier reference? You could also include the changes you would expect or better yet, file a PR if you want :)

patrikheinonen wrote this answer on 2022-11-24

Yeah @exaby73. I have now updated my initial comment.

I just tried to point someones attention to the file. I will read the contributor rules etc and try to make a PR 👍
what comes to the third point in my initial comment. The refactoring should prob be discussed about before deciding actions.

exaby73 wrote this answer on 2022-11-24

Thanks for the information :) I'll label this issue for further discussion from the team. Thank you

More Details About Repo
Owner Name flutter
Repo Name flutter
Full Name flutter/flutter
Language Dart
Created Date 2015-03-06
Updated Date 2022-12-10
Star Count 147243
Watcher Count 3561
Fork Count 23950
Issue Count 11325

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
TypeError: GObject_Object.prototype.toString called on incompatible Object 2 2022-04-07 2022-11-09
Does "multinerf" work on windows 10/11 3 2022-08-04 2022-11-24
UnicodeDecodeError occured when training Tanks and Temples dataset processed by the NeRF++ 4 2022-08-05 2022-11-24
Revisit the set of disallowed characters in a file type indicator 4 2022-09-01 2022-11-21
如何根据,元素的边线,进行元素大小的调整 1 2022-09-19 2022-12-08
Nasa is in my device list 1 2019-12-05 2022-10-05
Option to "remove" devices 2 2018-10-16 2022-09-23
Fix infinite redirect and get site back online 9 2022-04-13 2022-12-09
Hyperlink in table cell causes page to be offset vertically. 0 2021-07-07 2022-07-17
Sega mini consoles on ESP32 0 2022-11-28 2022-12-02
Pytest --strict option is deprecated 1 2022-08-06 2022-08-07
Drawing in canvas is error when use touchHandler 4 2022-12-06 2022-12-09
negativa value issue still exists in BoxShadow 0 2022-12-08 2022-12-09
Configuration with decimal-point numbers 2 2022-09-12 2022-11-21
is.edge() returns false in edge (tested on windows and mac os) 3 2020-06-30 2022-10-11
License error using .apk file.. 2 2021-02-27 2022-06-29
Add a CommandKit::FS or CommandKit::FileSystem module 2 2021-07-26 2022-10-30
RFC 9266: Channel Bindings for TLS 1.3 support 2 2022-07-27 2022-12-09
登录后后台面板无法进入,显示当前主题不支持小工具功能 2 2022-05-21 2022-11-28
Unable to make Pygments work 2 2021-10-23 2022-11-20
Feed in the settings file as a command line argument 3 2018-05-28 2022-11-18
sfdx force:source:push failing since the latest stable update 7.144.2 21 2022-04-04 2022-12-04
Update Https.Web.live.xdt.config 1 2021-09-07 2022-09-29
Vulkan validation error after a change 0 2022-09-25 2022-11-06
kctrl: Comment the package-build and package-resources.yml 0 2022-10-27 2022-12-03
fetch fail 6 2021-06-07 2022-01-16
Scalene won't run on Mac M1 and MacPorts' Python: ImportError and incompatible architecture 7 2022-01-19 2022-12-08
Command `blitz generate` does not exist on canary. 1 2020-04-20 2022-09-14
Inconsistent documentation around dynamic CF template values 0 2021-08-27 2022-12-03
Kicked right after login 2 2022-04-13 2022-11-18
Problem with add Google Chat Service 3 2021-10-26 2022-03-20
Support React v17 2 2021-01-04 2022-01-14
Confusing error message with `--constraint` and `--only-binary` when a binary package is not available? 1 2022-01-06 2022-11-11
[V5] Custom validation rule return undefined for validator.helpers.getFieldValue 5 2021-06-11 2022-11-28
i got a problom when catkin_make robot_pose_ekf package 1 2022-07-28 2022-11-26
TJpgDec R0.03 has been released 4 2021-07-24 2022-12-03
Evaluate STIGging VM images for compliance 0 2021-08-05 2022-10-29
Query parameters overwritten by default values in relative URLs 7 2022-03-18 2022-11-23
DeprecationWarnings from test_distutils 0 2022-09-06 2022-09-02
python -m test test_unitttest -R3:3 fails 6 2022-09-06 2022-09-02
[HOLD for payment 2022-04-13] [HOLD for payment 2022-03-22] Android - Picture looks smaller in Preview page 45 2022-02-05 2022-10-05
Modernize and consolidate JDKs usage across all stages of the build 3 2021-10-08 2022-10-29
Linking against static library that uses SwiftProtobuf causes linker errors 34 2020-12-23 2022-11-29
[rush] Cloud build cache errors the build when credentials fail 3 2022-03-09 2022-11-19
[BUG][task execute fail] shell/python script execute,report (No such file or directory) 9 2022-02-19 2022-11-14
开启自定义顶栏后,主站下的“番剧”按钮指向的页面不存在 1 2022-01-01 2022-02-26
Shelly plus login 0 2022-01-06 2022-01-19
Error during startup 11 2021-05-12 2022-11-28
MT7615D STA+AP not working 2 2022-03-15 2022-11-27
API 2.9 disable in a few days. No release working with 2.10 0 2019-06-26 2022-12-06