Skip to content

Instantly share code, notes, and snippets.

View jorwan's full-sized avatar

Jorge Wander Santana Ureña jorwan

View GitHub Profile
/*
Jorge Wander Santana Urena
[email protected]
*/
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@jorwan
jorwan / project_list_data.json
Created July 25, 2021 02:17
Project List Data - This data feeds project list page in https://jorwan.github.io/
{
"projects": [
{
"title": "CAT FACTS",
"subtitle": "VIEW RANDOM PICTURES AND FACTS ABOUT CATS",
"description": "Flutter Mobile App that make a request to third-party api to get a cat picture and a request to another third-party api to get a cat fact.",
"repositoryUrl": "https://github.com/jorwan/cat-facts",
"previewUrl": "https://res.cloudinary.com/dufbnf0ov/image/upload/v1624586236/jorwan.github.io/preview_cat_fact.gif"
},
{
@jorwan
jorwan / main.dart
Last active December 31, 2023 15:23
Sort list with nulls
void main() {
print("Current list");
var l = [1,5,2,null,0];
print(l);
print("sort it asc with nulls at the beginning");
sortIt(l, asc:true, nullAtEnding: false);
print(l);
print("sort it asc with nulls at the end");
@jorwan
jorwan / main.dart
Created December 31, 2023 15:27
Test - Calling multiple times keep same result
void main() {
print("Current list");
var l = [1,5,2,null,0];
print(l);
print("Sorted List");
for(int i=0;i<10;i++){
sortIt(l);
print(l);
};
@jorwan
jorwan / main.dart
Last active December 31, 2023 15:31
sort list with nulls at the end in dart
void main() {
print("Current list");
var l = [1,5,2,null,0];
print(l);
print("Sorted List");
l.sort((a, b) {
int result;
if (a == null) {
result = 1;
@jorwan
jorwan / main.dart
Last active October 3, 2024 18:42
flutter-bloc-call-event-just-once.dart
/*
* Goal:
* Call event only on first time by bloc state
* */
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
void main() => runApp(const MyApp());
@jorwan
jorwan / main.dart
Created October 5, 2024 16:27
dashed line example
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override