Skip to content

Instantly share code, notes, and snippets.

View talamaska's full-sized avatar

Zlati Pehlivanov talamaska

View GitHub Profile
@slightfoot
slightfoot / nested_tabs.dart
Created February 17, 2019 02:43
Example Nested Tab Layout - 17th Feburary 2019
import 'package:flutter/material.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Example Nested Tab Layout',
theme: ThemeData(
@slightfoot
slightfoot / nav.dart
Last active April 16, 2020 18:43
Advanced Nav Demo - 7th November 2018 - #HumpdayQandA https://twitter.com/i/status/1060322027993776128
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
// -----------------------------------------------------------------------------
void main() => runApp(NavApp());
class NavApp extends StatefulWidget {
@override
@slightfoot
slightfoot / transitions_fun.dart
Created January 8, 2020 21:31
Fun with Route Animations - by Simon Lightfoot - #HumpDayQandA - 8th Janurary 2020
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@ccnokes
ccnokes / preload-example.js
Created February 1, 2017 03:03
Electron preload script
// in preload scripts, we have access to node.js and electron APIs
// the remote web app will not have access, so this is safe
const { ipcRenderer: ipc, remote } = require('electron');
init();
function init() {
// Expose a bridging API to by setting an global on `window`.
// We'll add methods to it here first, and when the remote web app loads,
// it'll add some additional methods as well.
@jfsiii
jfsiii / index.html
Last active January 4, 2021 18:11
Full-Screen Layout using Flexbox
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Holy Grail</title>
<style>
/* some basic styles. nothing to do with flexbox */
header, footer,
nav, article, aside {
border: 1px solid black;
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
@vincevargadev
vincevargadev / i-have-no-idea-what-i-am-doing.sh
Last active December 27, 2021 20:34
Fix all Flutter issues ever!
rm -f ios/Podfile ios/Podfile.lock pubspec.lock && rm -rf ios/Runner.xcworkspace/xcshareddata/ &&
flutter clean &&
flutter pub cache repair &&
rm -f ios/Podfile ios/Podfile.lock pubspec.lock &&
flutter pub get &&
flutter pub run build_runner clean
@dahabit
dahabit / ios_clean.sh
Last active February 26, 2022 23:03
Shell file that clean any Pods or Flutter dependencies before build
#!/bin/sh
echo "========== Cleanup start =========="
rm -Rf ios/Pods
rm -Rf ios/.symlink
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm -rf ios/Podfile.lock
rm -rf ~/Library/Developer/Xcode/DerivedData/* -y
rm -rf pubspec.lock
flutter clean
@tomastrajan
tomastrajan / app.component.ts
Last active May 2, 2022 06:02
Angular Material Theming - overlay handling
import { OverlayContainer } from '@angular/cdk/overlay';
export class AppComponent implements OnInit {
// use this to set correct theme class on app holder
// eg: <div [class]="themeClass">...</div>
themeClass: string;
constructor(
private overlayContainer: OverlayContainer
@lukepighetti
lukepighetti / implicitly_animated_builder.dart
Created May 17, 2020 20:08
ImplicitlyAnimatedBuilder
import 'package:flutter/material.dart';
/// An implicitly animated builder that tweens from 0.0 to 1.0 based on `isActive` property
class ImplicitlyAnimatedBuilder extends ImplicitlyAnimatedWidget {
ImplicitlyAnimatedBuilder({
Key key,
@required Curve curve,
@required Duration duration,
@required this.isActive,
@required this.builder,