Skip to content

Instantly share code, notes, and snippets.

View dkbast's full-sized avatar

Damian Bast dkbast

View GitHub Profile
@dkbast
dkbast / main.dart
Created September 7, 2023 09:41
Lifecycle of a StatefulWidget
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatefulWidget {
const MainApp({super.key});
@override
@dkbast
dkbast / rfw_macos_test.sh
Created December 16, 2022 09:54
A shell script to easily setup and test the remote flutter widget WASM example on MacOS
# A shell script which sets everything up to run the rfw wasm example
# Setup Rust:
brew install rustup
rustup-init
source "$HOME/.cargo/env"
# clone the project
git clone https://github.com/flutter/packages.git
cd packages/packages/rfw
// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:english_words/english_words.dart';
import 'package:flutter/material.dart';
// 1) neuen ChangeNotifier mit dem Namen StartupNameProvider anlegen
// Hier ist ein Beispiel das die Counter App auf Provider & ChangeNotifier umstellt
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@dkbast
dkbast / main.dart
Created March 5, 2021 16:04
Optional Widgets with nullable parameter
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@dkbast
dkbast / AllGattCharacteristics.java
Created January 4, 2021 20:03 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@dkbast
dkbast / material_design_card.dart
Last active October 31, 2020 15:14
MaterialDesignCard
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
class MaterialDesignCard extends StatelessWidget {
const MaterialDesignCard({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
//https://stackoverflow.com/questions/49812575/instagram-a-1-not-working-anymore
//https://medium.com/@nickboyce/how-to-track-your-instagram-followers-over-time-with-google-sheets-scripts-bd9f5acf5ede
// the name of the sheet within your document
var sheetName = "FollowerCount";
// the name of the Instagram account you want to track
var instagramAccountName = "ACCOUNTNAMEYOUWANTTOTRACK";
function insertFollowerCount() {
var ss = SpreadsheetApp.getActiveSpreadsheet();