Skip to content

Instantly share code, notes, and snippets.

View Shreemanarjun's full-sized avatar

Shreeman Arjun Sahu Shreemanarjun

View GitHub Profile
@ShashankSMayya
ShashankSMayya / mapping_hooks.dart
Created May 30, 2025 02:31
Some of the mapping hooks that can be used with the dart mappable (which I currently use)
import 'package:dart_mappable/dart_mappable.dart';
import 'package:intl/intl.dart';
class DateTimeHook extends MappingHook {
const DateTimeHook();
@override
Object? beforeEncode(Object? value) {
if (value is DateTime) {
//return in yyyy-MM-dd format