Skip to content

Instantly share code, notes, and snippets.

@minikin
minikin / main.dart
Created December 16, 2019 08:18
Experiment to implement SwiftUI style transformations on Flutter Widgets using extensions.
// Copyright (c) 2019, Sasha Prokhorenko.
// Use of this source code is governed by a MIT license.
import 'package:flutter/material.dart';
import 'dart:math';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
import 'dart:convert';
import 'dart:io';
import 'dart:math' as math;
import 'dart:ui';
import 'package:async/async.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@minikin
minikin / clean_code.md
Created December 26, 2020 17:02 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@minikin
minikin / framework.dart
Created November 29, 2020 22:10 — forked from guidezpl/framework.dart
Modified Flutter framework.dart to print widget counts (generic version)
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'dart:async';
import 'dart:collection';
import 'dart:developer';
@minikin
minikin / main.dart
Last active November 20, 2020 10:52
Types Promotion: Dart vs Swift
void main() {}
abstract class Shape {}
class Square implements Shape {
String? id;
}
class Circle implements Shape {
String? name;
@minikin
minikin / Coffee.swift
Last active November 20, 2020 08:41
Working with optional fields in Swift vs Dart
struct Coffee {
var temperature: String?
mutating func heat() {
temperature = "hot"
}
mutating func chill() {
temperature = "iced"
}
@minikin
minikin / example.md
Created November 16, 2020 08:17 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@minikin
minikin / main.dart
Created September 29, 2020 09:18
Flutter Widgets: Classes vs Methods
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
Launching lib/main_development.dart on iPhone SE (2nd generation) in debug mode...
CocoaPods' output:
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
- Flutter
- agora_rtc_engine
@minikin
minikin / models.md
Last active September 14, 2020 11:38
Models
auth_service:
  provider [string] (e.g. slack, google)
  id [RFC4122 v4]
  authorizedAt [string] (ISO8601)
  photoUrl [string]
  realName [string]

device:
 id [string] (device udid or e.g. 'Chrome')