Skip to content

Instantly share code, notes, and snippets.

Flutter Application Deployment Guide

Prerequisites

  • Flutter SDK installed on your local machine
  • A code editor of your choice (e.g. Visual Studio Code)
  • Familiarity with the terminal or command line
  • A remote repository for your code (e.g. GitHub, GitLab)

Building the Flutter Application

  1. Clone your Flutter project from your remote repository to your local machine
void main() {
Test();
}
class Test {
static late final TestInstance staticLateFinal = TestInstance('static late final');
static final TestInstance staticFinal = TestInstance('static final');
static TestInstance static = TestInstance('static');
Test() {
@Maistho
Maistho / main.dart
Last active May 7, 2022 22:01
Crash reproduction for flutter bug
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@Maistho
Maistho / main.dart
Created April 10, 2022 19:26
Dart mapWithIndex()
typedef _Transformation<S, T> = T Function(S value, int index);
abstract class EfficientLengthIterableWithIndex<T> extends Iterable<T> {
const EfficientLengthIterableWithIndex();
/**
* Returns the number of elements in the iterable.
*
* This is an efficient operation that doesn't require iterating through
* the elements.
*/
@Maistho
Maistho / Format-String-Ics.ps1
Created February 16, 2022 02:29
Powershell scripts to export calendar events from outlook to ics
function Format-String-Ics([string] $Body) {
$Str = $Body.Replace("`n", "\n").Replace("`r", "")
$Result = ""
[Int]$i = 0
while (($Str.Length - $i) -gt 60) {
$next = [math]::Min($i + 60, $Str.Length - 1)
$Result = "$Result$($Str.Substring($i, $next - $i))`r`n "
$i = $next
}
if ($i -eq 0) {
@Maistho
Maistho / datetime_iso_week_of_year.dart
Last active March 22, 2023 21:52
Calculate the iso week of year in dart
extension DateWeekExtensions on DateTime {
int get isoWeekOfYear {
// Get the monday of week 1
final DateTime mondayWeek1 = _isoWeek1Monday();
// If this date is before the first week of the year, it is the same week as the last week of the previous year.
if (isBefore(mondayWeek1)) {
return DateTime(year - 1, 12, 31).isoWeekOfYear;
}

import { Layout } from '../components/layout.tsx' export default Layout import { WordCloudComponent as WordCloud } from '../components/WordCloud' import { words } from '../wordcloudWords'

Hi!

I'm a developer from Linköping, Sweden. I love web development and have been building rich web and mobile applications for around 6 years now. It's amazing how much there is to learn and do in this space.

Recently I've been building a mobile app for selling fishing permits, an app for getting notifications during GDQ, and an Inbox by GMail replacement.

javascript:var CsgoMap;!function(t){t.de_mirage="Mirage",t.de_dust2="Dust II",t.de_subzero="Subzero",t.de_train="Train",t.de_nuke="Nuke",t.de_inferno="Inferno",t.de_cache="Cache",t.de_overpass="Overpass"}(CsgoMap||(CsgoMap={}));class MinMaxAvg{constructor(){this.min=1/0,this.max=-1/0,this.avg=0,this.total=0}append(t,e){this.min=Math.min(t,this.min),this.max=Math.max(t,this.max),this.total+=t,this.avg=this.total/e}}class PlayerStats{constructor(t){this.timesPlayed=0,this.roundsPlayed=0,this.ping=new MinMaxAvg,this.kills=new MinMaxAvg,this.assists=new MinMaxAvg,this.deaths=new MinMaxAvg,this.mvps=new MinMaxAvg,this.headshotRate=new MinMaxAvg,this.score=new MinMaxAvg,this.link=t.link,this.image=t.image,this.name=t.name}add(t,e){this.roundsPlayed+=e,this.timesPlayed+=1,this.ping.append(t.ping,this.timesPlayed),this.kills.append(t.kills,this.timesPlayed),this.assists.append(t.assists,this.timesPlayed),this.deaths.append(t.deaths,this.timesPlayed),this.mvps.append(t.mvps,this.timesPlayed),this.headshotRate.append(N
@Maistho
Maistho / bookmarklet.js
Last active July 9, 2019 02:44
CSGO stats bookmarklet
javascript:(function () {
let CsgoMap;
(function (CsgoMap) {
CsgoMap["de_mirage"] = "Mirage";
CsgoMap["de_dust2"] = "Dust II";
CsgoMap["de_subzero"] = "Subzero";
CsgoMap["de_train"] = "Train";
CsgoMap["de_nuke"] = "Nuke";
CsgoMap["de_inferno"] = "Inferno";
CsgoMap["de_cache"] = "Cache";
javascript:
(function () {
let CsgoMap;
(function (CsgoMap) {
CsgoMap["de_mirage"] = "Mirage";
CsgoMap["de_dust2"] = "Dust II";
CsgoMap["de_subzero"] = "Subzero";
CsgoMap["de_train"] = "Train";
CsgoMap["de_nuke"] = "Nuke";
CsgoMap["de_inferno"] = "Inferno";