Skip to content

Instantly share code, notes, and snippets.

@malinkaphann
malinkaphann / singleton.dart
Last active November 24, 2020 09:36
how to create singleton in dart
/**
* author: malinkaphann@gmail.com
* how to create singleton class
*/
// singleton class
class MySingleton {
MySingleton._privateConstructor();
@malinkaphann
malinkaphann / static_class.dart
Last active November 24, 2020 09:36
how to create class with static methods in dart
/**
* author: malinkaphann@gmail.com
* how to create class with static and non-static methods
*/
class MyClass {
static staticMethod() {
print('hello I am static method');
}
@malinkaphann
malinkaphann / api_service.dart
Last active November 24, 2020 09:35
sample flutter api manager
/**
* author: bunrin
* ....
* ......
*/
enum STATUS_CODE {
};
@malinkaphann
malinkaphann / main.dart
Last active November 16, 2020 12:17
Alert Manager
/*
* author: malinkaphann@gmail.com
* create an alert widget
* */
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());