Comments (7)
@BirjuVachhani
I think the last one doesn't show an error because the extension is on Iterable?
while the others are part of the Dart language and it is not an extension.
I think this is also the case with strings but i'm not sure.
from screwdriver.
@naamapps I have added these extensions back for now.
dependencies:
screwdriver: ^2.1.0
from screwdriver.
@BirjuVachhani Thank you, much appreciated!
from screwdriver.
@naamapps I am working it. Will publish it soon.
from screwdriver.
Null-safe version has been released. Please check CHANGELOG before upgrading.
https://pub.dev/packages/screwdriver
from screwdriver.
Hi, thanks for the update.
Why did you remove the extensions Iterable.isNullOrEmpty, Iterable.isNotNullOrEmpty, String.isNullOrEmpty, String.isNotNullOrEmpty, String.isNullOrBlank ,String.isNotNullOrBlank?
Even when there is null safety it is still required to do null checks..
for the collections it can be done like so:
extension NullableIterableScrewDriver<E> on Iterable<E>? {
bool get isNullOrEmpty => this == null || this!.isEmpty;
bool get isNotNullOrEmpty => this != null && this!.isNotEmpty;
}
What do you think about adding new extensions only for nullable collections or strings?
from screwdriver.
String? testing;
testing.substring(5); // This shows error
List<int>? list2;
print(list2.first); // This also shows error
List<int>? list3;
print(list3.isNullOrEmpty); // But this doesn't :(
I thought it would show error when accessing nullable types and we would need to use ?
for null safety but now it seems that extensions doesn't respect whether the receiver is null or not.
Seems that I need to add those extensions back but for Iterable?
type.
from screwdriver.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from screwdriver.