A dart package for pattern matching.

Related tags

Templates match_case
Overview

A dart package for pattern matching. Inspired by match in Rust and when in Kotlin

Usage

var x = 2;
var result = match(
  x,
  {
    1: () => "Its a one",
    () => x == 2 || x == 3: () => "Its a $x",
  },
  "Error!!", // (Optional) default value in case nothing is matched
);

// Output
$ "Its a 2"

match Definition

U match<T, U>(
  T value, // Value that needs to be matched
  Map<T, U Function()> fns, // T -> Any primitive values or a function that returns true or false
  U defaultValue, // Optional value that is returned when nothing is matched
)
You might also like...

A simple pair game made with Flutter, a custom library, BLoC and tunnel pattern.

A simple pair game made with Flutter, a custom library, BLoC and tunnel pattern.

Pair game A simple pair game created with Flutter. Article on Medium here: https://medium.com/@frmineoapps/a-simple-pair-game-made-with-flutter-a-cust

Jun 28, 2022

Demonstrates BLoC pattern in Flutter

Demonstrates BLoC pattern in Flutter

bloc_test A real-world example of using the BLoC pattern in Flutter. This app features a searchable list of users and demonstrates an elegant way to k

Jul 1, 2019

Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern.

Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern.

Karee Another way to build Flutter applications for mobile, web and desktop using the powerful of MVC Design Pattern. + = About Karee Karee is a frame

Sep 29, 2022

Clonning TIX ID with flutter with BLoC Pattern and RxDart

Clonning TIX ID with flutter with BLoC Pattern and RxDart

tix_app Cloning TIX ID in Flutter (Currently design only, next i will grab the movies from IMDB api for free) Feature Movies Movies Detail Ticket List

Aug 23, 2021

A reference app in flutter using the BLoC pattern.

A reference app in flutter using the BLoC pattern.

flutter_dice A sample Flutter app that shows how to manage responsive state using the provider pattern. Concepts Illustrated Provider pattern Using a

Nov 18, 2022

Screener: a sample application Uses MVVM pattern

screener This is a sample application. Uses MVVM pattern Tries to encourage the use of boundaries (by using the concept of packages) Getting Started ?

Dec 27, 2021

Flutter web example with Firebase Authentication, Firestore Collection, BloC Pattern

flutter_auth_web Flutter Firebase auth. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Feb 26, 2022

Bloc Pattern based weather app.

flutter_weather_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Dec 29, 2021

A shopper Flutter app that use BloC pattern and CRUD operations with different ways(memory/sqlite/http)

A shopper Flutter app that use BloC pattern and CRUD operations with different ways(memory/sqlite/http)

The project is maintained by a non-profit organisation, along with an amazing collections of Flutter samples. We're trying to make continuous commits

Nov 10, 2022
Owner
Sabin
Loading...
Sabin
Ruqe brings the convenient types and methods found in Rust into Dart, such as the Result, Option, pattern-matching, etc.

ruqe Ruqe brings the convenient types and methods found in Rust into Dart, such as the Result, Option, pattern-matching, etc. Additionally, the librar

Alexander Nitiola 12 Dec 28, 2022
Petrus Nguyễn Thái Học 193 Dec 29, 2022
Immutable Dart collections via the builder pattern.

Built Collections for Dart Introduction Built Collections are immutable collections using the builder pattern. Each of the core SDK collections is spl

Google 250 Dec 20, 2022
A starter kit for beginner learns with Bloc pattern, RxDart, sqflite, Fluro and Dio to architect a flutter project. This starter kit build an App Store app as a example

Flutter Starter Kit - App Store Example A starter kit for beginner learns with Bloc pattern, RxDart, sqflite, Fluro and Dio to architect a flutter pro

kw101 678 Jan 8, 2023
constructing... Flutter, Ganache, Truffle, Remix, Getx Pattern, Infura, GetX, Blockchain

constructing... Flutter, Ganache, Truffle, Remix, Getx Pattern, Infura, GetX, Blockchain

Kauê Murakami 20 Dec 20, 2022
Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Jibran Ahmed SiddiQui 9 Oct 29, 2022
Flutter plugin to rapidly create a Page with MVVM design pattern

mvvm_builder mvvm_builder is a Flutter plugin to help you implement MVVM design pattern with flutter. MVVM = Model - View - ViewModel Installation To

Gautier 21 Jun 4, 2021
👑 The lightweight design pattern for small management applications.

Store Pattern ?? The lightweight design pattern for small management applications. Features | Structure | Install | Usage | Documents | Technologies |

UITers 71 Sep 26, 2022
Easy Form State Management using BLoC pattern

?? Dart and Flutter Package ?? Easy Form State Management using BLoC pattern ?? Wizard/stepper forms, asynchronous validation, dynamic and conditional fields, submission progress, serialization and more! ??

GiancarloCode 406 Jan 8, 2023
News app in Flutter with BLOC pattern

NewsApp News app in Flutter with BLOC pattern This example uses a CustomScrollView, JSON Rest API, BottonNavigationBar,SliverList, ClipRRect, Card, Pr

Kirill 298 Dec 25, 2022