Skip to content

Instantly share code, notes, and snippets.

View Headmast's full-sized avatar

Kirill Klebanov Headmast

  • Agro.Club
  • Voronezh, Russia
View GitHub Profile
import 'package:http/http.dart' as http;
import 'dart:io';
void main(List<String> arguments) async {
try {
var resp = await fetchJson(url:'https://jsonplaceholder.typicode.com/posts');
fetchJson(url:'https://i.pinimg.com/564x/e6/57/1a/e6571a6c62fb2615c741a8fcf32aef49.jpg');
print('Print json \n${resp.body}');
void main() {
final p = SuperPrinter<int>(1);
p.doPrint();
final pString = SuperPrinter<String>('Awesome dart');
pString.doPrint();
var st = Student(2020);
st.name = 'Stas';
void main() {
var sh = CustomShape();
sh.getBorder(sh.borders);
}
class CustomShape extends Shape with BorderHelper {
CustomShape(): super([1.0, 2.0]);
}
main() {
var userMain = User();
userMain.name = 'Boris';
print('Your name: ${userMain.name}');
var st = Student(2020);
st.name = 'Stas';
st.surname = 'Konovalov';
print('New student: $st');
}
import 'dart:math';
String solve({double ax, double bx, double cx}) {
double discriminant({double a, double b, double c}) {
return (b*b - 4*a*c);
}
double calculateX({double a, double b, double c, int xType = 1}) {
double singDiscr;
final sqrtD = sqrt(discriminant(a: a, b:b, c:c));
if (xType == 1) {
// 1
void reverse([String text = '']) {
print('New line: ${text.split(' ').reversed.join(' ')}');
}
void main() {
var a = 'hello world';
reverse();
}
double average(List <double> darray) {
  double sum = 0;
  darray.forEach((value) 
                 {sum += value;}
                );
  return sum/darray.length;
  
}
void reverse(String text) {
  print('New line: ${text.split(' ').reversed.join(' ')}');
}

void main() {
  var a = 'hello world';
  reverse(a);
 }
import 'dart:io';

void addUp() {
  var input = '';
  double sum = 0;

   do {
     input = stdin.readLineSync();
 double value = double.tryParse(input);
void evenNumbers() {
  print('Print all even number');
  for (int i = 0; i <= 100; i = i+2) {
    print(i);
  }
}