Skip to content

Instantly share code, notes, and snippets.

View ashishkarki's full-sized avatar
🎯
Focusing

Ashish Karki ashishkarki

🎯
Focusing
View GitHub Profile
@ashishkarki
ashishkarki / keybase.md
Created October 12, 2020 14:13
keybase.md

Keybase proof

I hereby claim:

  • I am ashishkarki on github.
  • I am ashishkarki (https://keybase.io/ashishkarki) on keybase.
  • I have a public key ASCaoPvC91bmG7yfUfwg5AQF_8eR77o4o8f0T4G1TqxnIAo

To claim this, I am signing this object:

void main() {
runApp(
MaterialApp(
home: Center(
child: Text('Hello there ashish'),
),
routes: {
WidgetA.routeName: (context) => WidgetA(),
WidgetB.routeName: (context) => WidgetB(),
},
@ashishkarki
ashishkarki / dart-fold-1-example.dart
Last active May 8, 2020 03:29
Showing how fold operator works in Dart language
void sum(List<int> list){
int sum = 0;
// 1. first use a for loop to print the sum
for(int element in list) {
sum += element;
}
print('sum using for loop is: $sum');
// 2. second use fold to print sum
@ashishkarki
ashishkarki / dart-mixin-example1.dart
Created April 29, 2020 11:22
dart-mixin-example1.dart
import 'dart:math';
mixin Area {
double getSquareArea(double side) {
return side * side;
}
double getCircleArea(double radius) {
return pi * radius * radius;
}