Skip to content

Instantly share code, notes, and snippets.

View fardhanardhi's full-sized avatar
🛰️
Out of range

ΛDΛN fardhanardhi

🛰️
Out of range
  • Majoo Indonesia (SaaS POS Apps)
  • Malang, Indonesia
View GitHub Profile
@fardhanardhi
fardhanardhi / dart-enum-when-maybe-when-and-when-or-null-example-with-dartz.md
Last active May 13, 2024 12:31
Dart enum when, maybeWhen & whenOrNull example with dartz

Dart Enum Dartz

Enum when, maybeWhen & whenOrNull example with dartz

This is the boilerplate or example of the enum when method helper like generated freezed result using dartz package

Warning

This snippet uses dartz package, so make sure you have already imported it.

import 'package:dartz/dartz.dart';
@fardhanardhi
fardhanardhi / dartz-applicatives-curried-addition-ap.md
Last active May 13, 2024 12:06
dartz applicatives curried addition (.ap)

Dart Dartz Functional Programming Applicative Currying

Dartz applicatives curried addition (.ap)

The practical example of applicative and curry function using dartz

Warning

This snippet uses dartz package, so make sure you have already imported it.

import 'package:dartz/dartz.dart';
@fardhanardhi
fardhanardhi / multiple-generic-abstraction.md
Last active May 13, 2024 12:20
Multiple-generic abstraction

Dart Generic Type OOP

Multiple generic abstraction

This code structure promotes flexibility and code reusability. By using abstract classes and generics, you can create an executor for different types of calculations while ensuring type safety and consistency.

Declaration

import 'dart:async';
@fardhanardhi
fardhanardhi / .screenutil-responsive-demo.md
Last active May 13, 2024 12:59
Screenutil responsive demo

Dart Flutter ScreenUtil

Screenutil responsive demo

The workaround is to demonstrate correct usage of flutter_screenutil package. The code is runnable in DartPad by mimicking the actual package code implementation since flutter_screenutil isn't supported in DartPad yet.

Note

To see the result you can resizing the running result window to see the sizing behavior. You can run this demo on DartPad, here.