Skip to content

Instantly share code, notes, and snippets.

View ElforL's full-sized avatar

Laith Shono ElforL

View GitHub Profile
@ElforL
ElforL / EnumToShortString.dart
Last active January 23, 2022 16:44
An extension that adds `toShortString()` method to enums.
/// Adds `toShortString()` method to [Enum].
extension EnumToShortString on Enum {
/// Returns the string of the **value**.
///
/// For example,
/// ```dart
/// var enum1 = MyEnum.val1;
/// print(enum1.toString()); /// 'MyEnum.val1'
/// print(enum1.toShortString()); /// 'val1'
/// ```
@ElforL
ElforL / main.dart
Created February 23, 2021 11:21
showDatePicker()
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(