Skip to content

Instantly share code, notes, and snippets.

View mhmadip's full-sized avatar

Mohammad Salim mhmadip

View GitHub Profile
@mhmadip
mhmadip / main.dart
Created February 21, 2023 09:40
This example for OOP2 class, showing how async functions are working on Dart
void main(){
performTasks();
}
void performTasks () async{
task1();
String task2Result= await task2();
task3(task2Result);
}
@AlexVegner
AlexVegner / dart_lexical_scope​.dart
Created January 24, 2020 08:37
dart_lexical_scope​.dart
/// Dart is a lexically scoped language, which means that the scope of variables is determined statically, simply by the layout of the code. You can “follow the curly braces outwards” to see if a variable is in scope.
// example
bool topLevel = true;
void main() { //
var insideMain = true;
void myFunction() {
var insideFunction = true;
void nestedFunction() {
var insideNestedFunction = true;
@devkabiir
devkabiir / dart_generics_issue.dart
Last active August 23, 2021 12:48
dart_generics_issue.dart
mixin IModel {
int get field1;
}
mixin IWidget<Model extends IModel> {
///
Model get model;
}
mixin IState<W extends IWidget<M>, M extends IModel> {