This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main(List<String> arguments) { | |
var a1 = Storage(); | |
var a2 = Storage(); | |
print(a1.hashCode); | |
print(a2.hashCode); | |
print(a1==a2); | |
} | |
class Storage { | |
static final Storage _singleton = Storage._internal(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
import 'package:intl/intl.dart'; | |
void main(List<String> arguments) { | |
// Intl.defaultLocale = 'es_AR'; | |
Intl.defaultLocale = 'en_US'; | |
// Should be calculated only on locale change to modify the separators. | |
// -- start static implementation. | |
var base = NumberFormat.currency(decimalDigits: 1, symbol: ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> main(List<String> arguments) async { | |
var a = Contacto('Mati'); | |
var b = Contacto('Mati'); | |
print('Contact son iguales? ${a == b}'); // false | |
var a2 = const Contacto('Mati'); | |
var b2 = const Contacto('Mati'); | |
print('const Contact son iguales? ${a2 == b2}'); // true | |
var a3 = Contacto2('Mati'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// roipeker©2020 | |
// demo codepen : https://codepen.io/roipeker/pen/oNbXRQz | |
// demo web : https://dev.roipeker.website/flutter_demos/textcontroller_currency/ | |
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'text_controller_format.dart'; | |
void main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// roipeker 2020 | |
// sample using ValueBuilder. Generic Dropdown wrapper with basic styling. | |
import 'package:flutter/material.dart'; | |
import 'valuebuilder.dart'; | |
class CommonDropDown<T> extends StatelessWidget { | |
final double height; | |
final List<T> listData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// roipeker 2020. | |
// Challenge from | |
// https://www.youtube.com/watch?v=HjJHO0NXI10&feature=share | |
// | |
// Demo screencast (macOS): | |
// https://giphy.com/gifs/WoG8316gEYY2EC1KRA | |
// Key code to use a shader mask in the widget tree: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:get/get.dart'; | |
import 'package:http/http.dart' as http; | |
class PostController extends GetxController { | |
final _postList = <PostModel>[].obs; | |
List<PostModel> get postList => _postList.value; | |
final _isLoading = false.obs; | |
bool get isLoading => _isLoading.value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:get/get.dart'; | |
class SampleTodoDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return GetMaterialApp( | |
home: TodoPage(), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppGetUtils { | |
static bool isPreloading = false; | |
static Future<void> hidePreloader() async { | |
if (!isPreloading) return; | |
isPreloading = false; | |
if (!Get.isSnackbarOpen) { | |
Get.close(1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:get/get.dart'; | |
class SampleBottomNavDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return GetMaterialApp( | |
themeMode: ThemeMode.dark, | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData.light(), |