You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
🔧 nullx: A Dart toolkit designed to enhance handling of nullable types, providing utilities for null-checking, navigating nullable structures, and ensuring safer, more robust code.
nullx is adart toolkit that enhances handling of nullable types, providing utilities for null-checking, navigating nullable structures, and robust error handling, for cleaner and more resilient code.
Features
Provides utilities for null-checking
Helps in navigating nullable structures
Offers robust error handling
Nullable types extensions
Getting started 🎉
To use this package, addnullx as a dependency in your pubspec.yaml file.
import'package:nullx/nullx.dart';voidmain() {constint userAge=20;executeIf( ()=> userAge>=18, onConditionMet: () {// prints 'You are an adult.' }, onConditionNotMet: () {// prints 'You are not an adult.' }, );}
import'package:nullx/nullx.dart';voidmain() {var userAge=20;final result=executeIfAs<String>( ()=> userAge>=18, onConditionMet: ()=>'You are an adult.', onConditionNotMet: ()=>'You are not an adult.', );}
import'package:nullx/nullx.dart';voidmain() {voidprintValue(String value) {// prints 'The value is: $value' }notEmpty(nullableString, printValue);}
import'package:nullx/nullx.dart';voidmain() {constint userAge=20;// Unwraps the nullable string and performs an operation on itcallWhen( condition: ()=> userAge>=18, onMet: () {// prints 'You are an adult.' }, onNotMet: () {// prints 'You are not an adult.' }, );}
Contributions are welcome! Please read the contributing guide to learn how to contribute to the project and set up a development environment.
License
Copyright 2024 Oleksii ShtankoLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
About
🔧 nullx: A Dart toolkit designed to enhance handling of nullable types, providing utilities for null-checking, navigating nullable structures, and ensuring safer, more robust code.