Skip to content

Instantly share code, notes, and snippets.

View talamaska's full-sized avatar

Zlati Pehlivanov talamaska

View GitHub Profile
@talamaska
talamaska / main.dart
Created February 1, 2021 22:11 — forked from av/main.dart
Flutter: texture generator playground
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() async => runApp(MaterialApp(home: Root()));
/// Waits till [ui.Image] is generated and renders
/// it using [CustomPaint] to render it. Allows use of [MediaQuery]
class Root extends StatelessWidget {
@talamaska
talamaska / text_gradient.dart
Last active November 24, 2020 16:08
text with gradient
final colors = [
Color(0xffff0000), Color(0xffffff00), Color(0xff00ff00),
Color(0xff00ffff), Color(0xff0000ff), Color(0xffff00ff), Color(0xffff0000),
];
final colorStops = [0 / 6, 1 / 6, 2 / 6, 3 / 6, 4 / 6, 5 / 6, 6 / 6];
final gradient = new ui.Gradient.linear(
Offset(0.0, 0.0),
Offset(0.0, size.height),
colors,
colorStops,
@talamaska
talamaska / Flutter Vikings Logo Contest
Created November 18, 2020 14:05
Flutter Vikings Logo Contest
// 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 'dart:ui' as ui;
void main() => runApp(FlutterVikingsLogoApp());
class FlutterVikingsLogoApp extends StatelessWidget {
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.index, this.title, this.icon, this.color);
final int index;
final String title;
final IconData icon;
final MaterialColor color;
}
@talamaska
talamaska / gist:f537d2fcfcab249efc2dd3893d310a97
Created November 11, 2020 15:35 — forked from wshaddix/gist:8797934
Gets the week number for a given date
main () {
// get today's date
var now = new DateTime.now();
// set it to feb 10th for testing
//now = now.add(new Duration(days:7));
int today = now.weekday;
import 'package:flutter/material.dart';
class CustomBarItem {
const CustomBarItem({
this.icon,
this.title,
});
final Icon icon;
final String title;
@talamaska
talamaska / app.component.ts
Created May 24, 2020 18:30 — forked from ElisePatrikainen/app.component.ts
Simple form with focus and keyboard interaction
import { Component, ViewChild, ViewChildren, ElementRef, QueryList, HostListener, AfterViewInit } from '@angular/core';
import { FocusTrapFactory, FocusMonitor, ListKeyManager} from '@angular/cdk/a11y'
@Component({
selector: 'app-root',
template: `
<button (click)="testA11y()"> Test A11y! </button>
<div #element role="dialog" hidden=true>
<label>Sample field</label>
<input #elementChild>
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
void main() => runApp(MaterialApp(home: WebViewExample()));
const String kNavigationExamplePage = '''
<!DOCTYPE html><html>
<head><title>Navigation Delegate Example</title></head>
@talamaska
talamaska / main.dart
Created April 7, 2020 20:35 — forked from joramkimata/main.dart
Draggable Scrollbar App
import 'package:draggable_scrollbar/draggable_scrollbar.dart';
import 'package:flutter/material.dart';
main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _MyApp();
}
@talamaska
talamaska / main.dart
Created February 21, 2020 10:45 — forked from av/main.dart
Flutter: neu
import 'package:flutter/material.dart';
void main() => runApp(NeumorphicApp());
class NeumorphicApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Neumorphic App',
theme: ThemeData(