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'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
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
/* | |
* 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()); |
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() { | |
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; |
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() { | |
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); | |
}; |
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() { | |
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"); |
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
{ | |
"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" | |
}, | |
{ |
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
/* | |
Jorge Wander Santana Urena | |
[email protected] | |
*/ | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
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() => print(List.generate(10, (i) => i).chunk(3)); | |
extension ListChunkerExtension on List { | |
List chunk(int chunkLength) { | |
if ((chunkLength ?? 0) <= 0 || (this ?? []).length == 0) | |
return this; | |
var chunks = []; | |
for (var i = 0; i < this.length; i += chunkLength) { | |
chunks.add(this.sublist( | |
i, i + chunkLength > this.length ? this.length : i + chunkLength)); |
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 'dart:async'; | |
import 'dart:math' as math; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter/widgets.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
/* | |
* Goal: Remove property with null values and null values from list | |
* Author: Jorge Wander Santana Urena | |
* Source: https://gist.github.com/jorwan/52902870f633da8959a39353e96fac25 | |
**/ | |
final data = | |
{ | |
"name": "Carolina Ratliff", | |
"company": null, |
NewerOlder