Skip to content

Instantly share code, notes, and snippets.

View JoeCodeswell's full-sized avatar

Joe Dorocak aka Joe Codeswell JoeCodeswell

View GitHub Profile
@JoeCodeswell
JoeCodeswell / dartlistInit.dart
Last active July 2, 2020 15:02
DartPad Dart List initialization
// on dartpad: https://dartpad.dev/cfded55df52dd2bb37228d12c7ef049c
void main() {
Co co = Co();
print(co.getTag1()); //Out: profitable
print(co.getMgr1().fn); //Out: null
}
class Co {
List<String> _tags = ['profitable', '1999', 'public', 'NYSE'];
String getTag1() {
@JoeCodeswell
JoeCodeswell / FlutterColumnOfExpandeds.dart
Last active July 12, 2020 13:46
Flutter Column Of Expanded Widgets
// on dartpad: https://dartpad.dev/391f0c9c13d49962573a83b0ce9fc305
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@JoeCodeswell
JoeCodeswell / dartFinalConst.dart
Last active July 14, 2020 17:02
Dart Final vs. Const
// https://dartpad.dev/e31c87278033dbaf3bb4d55bfa8fd721
// e31c87278033dbaf3bb4d55bfa8fd721
// [Dart Final vs. Const](https://www.appbrewery.co/courses/548873/lectures/9988849)
void main() {
// int myNumber = 1; // if we want no change after this
// use `const` OR `final`
// const int myConst = 2;
// final int myFinal = 3;
@JoeCodeswell
JoeCodeswell / DartDataTableExp1.dart
Last active July 26, 2020 15:58
DartDataTableExp1
void main() {
// DartDataTableExp1
// https://gist.github.com/JoeCodeswell/34f5fca2d4e3df65155189b3be033da3
// https://dartpad.dev/34f5fca2d4e3df65155189b3be033da3
JoesDataList jdl = JoesDataList();
print(jdl.listOfDataItems[0].name); // Sarah
print(' ');
// jdl.Map(); // The method 'Map' isn't defined for the type 'JoesDataList' - line 4
@JoeCodeswell
JoeCodeswell / ListComprehensionsInDart.dart
Last active July 26, 2020 18:53
List Comprehensions in Dart
/// [List Comprehensions in Dart](https://medium.com/@DavidMPotter/list-comprehensions-in-dart-a57d3a06b703)
/// https://gist.github.com/JoeCodeswell/ListComprehensionsInDart.dart
/// /// https://dartpad.dev/18472e3fc8e84ed7ece391b8dc6a3ced
///
void main() {
var intList = [1, 2, 3, 4];
// py [x + 1 for x in intList]
@JoeCodeswell
JoeCodeswell / JSONplay.dart
Last active October 5, 2020 15:55
Playing with JSON in dart. :)
/// JSONplay.dart
/// Playing with JSON in dart. :)
/// https://gist.github.com/JoeCodeswell/864394a7d86087113a7ad2ef2d80d542
/// https://dartpad.dev/864394a7d86087113a7ad2ef2d80d542
/// google: dart json
/// [Using JSON](https://dart.dev/guides/json)
/// [dart:convert - decoding and encoding JSON, UTF-8, and more](https://dart.dev/guides/libraries/library-tour#dartconvert---decoding-and-encoding-json-utf-8-and-more)
/// [dart:convert library](https://api.dart.dev/stable/2.8.4/dart-convert/dart-convert-library.html)
/// [How to parse Json in Flutter for Beginners](https://medium.com/flutter-community/how-to-parse-json-in-flutter-for-beginners-8074a68d7a79)
/// [JSON and serialization](https://flutter.dev/docs/development/data-and-backend/json)
@JoeCodeswell
JoeCodeswell / AsyncAwaitPlay.dart
Last active August 1, 2020 20:32
Playing with AsyncAwait in dart. :)
/// AsyncAwaitPlay.dart
/// Playing with AsyncAwait in dart. :)
/// https://gist.github.com/JoeCodeswell/04689586c58fca438a3906796463e719
/// https://dartpad.dev/04689586c58fca438a3906796463e719
void main() { }
void aFunction(){
//
}
@JoeCodeswell
JoeCodeswell / dartTypicodeJsonDecodeProblem.dart
Last active October 5, 2020 15:54
dart problem typicode jsonDecode with \n
/// zoldCode\dartTypicodeJsonDecodeProblem.dart
/// https://gist.github.com/JoeCodeswell/a565c505e8244bf9105048e874a6adc8
/// https://dartpad.dev/a565c505e8244bf9105048e874a6adc8
///
/// dart fails to jsonDecode valid json string from typicode Posts with \n in it
/// https://github.com/dart-lang/convert/issues/10
///
/// to see non error behaviour comment out lines 29 & 30
///
///
@JoeCodeswell
JoeCodeswell / TimeSeriesC19.dart
Last active October 7, 2020 14:33
TimeSeriesC19
/// TimeSeriesC19.dart
/// C19app1Pj\jchart_c19\lib\c19_data.dart
/// [gist](https://gist.github.com/JoeCodeswell/cdff0e68ae266fa624eaac5c286f20b2)
/// https://dartpad.dev/cdff0e68ae266fa624eaac5c286f20b2
/// See VERY HELPFUL ANSWERS IN [Mapping JSON into Class Objects](https://stackoverflow.com/a/45189401/601770)
/// [HTML - Using getString() to load a file](https://dart.dev/tutorials/web/fetch-data#using-getString-function)
/// google: dart await result
/// [Asynchronous programming: futures, async, await](https://dart.dev/codelabs/async-await)
///
///
@JoeCodeswell
JoeCodeswell / C19data.dart
Last active October 7, 2020 20:02
C19data.dart
/// C19data.dart
/// [gist](https://gist.github.com/JoeCodeswell/2f492c65c15a299f3176b06b0d178d5c)
/// [Dartpad](https://dartpad.dev/2f492c65c15a299f3176b06b0d178d5c)
/// Predecessor TimeSeriesC19.dart
/// C19app1Pj\jchart_c19\lib\c19_data.dart
/// [gist](https://gist.github.com/JoeCodeswell/cdff0e68ae266fa624eaac5c286f20b2)
/// https://dartpad.dev/cdff0e68ae266fa624eaac5c286f20b2
///
/// Because of the limitations of DartPad, this has moved to
/// jchart_c19\C19DataSets.dart