Skip to content

Instantly share code, notes, and snippets.

View talamaska's full-sized avatar

Zlati Pehlivanov talamaska

View GitHub Profile
import 'package:flutter/material.dart';
void main() async {
runApp(const DynamicHeader());
}
class DynamicHeader extends StatelessWidget {
const DynamicHeader({Key? key}) : super(key: key);
@override
@talamaska
talamaska / counter_button.dart
Created August 31, 2021 10:36 — forked from xsahil03x/counter_button.dart
Simple counter button
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:rxdart/rxdart.dart';
typedef CounterEdit = Future<bool> Function(int);
/// Returns true if the [valueBeforeZero] is handled by user.
typedef OnValueZero = Future<bool> Function(int valueBeforeZero);
@talamaska
talamaska / bottom_sheet_fix.dart
Created August 2, 2021 19:47 — forked from crimsonsuv/bottom_sheet_fix.dart
Flutter Modal bottom sheet whith input fix and full screen sheet
//Flutter Modal Bottom Sheet
//Modified by Suvadeep Das
//Based on https://gist.github.com/andrelsmoraes/9e4af0133bff8960c1feeb0ead7fd749
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
const Duration _kBottomSheetDuration = const Duration(milliseconds: 200);
@talamaska
talamaska / bottom_sheet_fix_status_bar.dart
Created August 2, 2021 19:47
Flutter Modal bottom sheet that supports full screen height
//Flutter Modal Bottom Sheet
//Modified by Giorgio Bertolotti
//Based on https://gist.github.com/crimsonsuv/b25d5ebd04236f9be2aa66accba19446
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
const Duration _kBottomSheetDuration = const Duration(milliseconds: 200);
@talamaska
talamaska / bottom_sheet.dart
Created August 2, 2021 19:46 — forked from andrelsmoraes/bottom_sheet.dart
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss) - Flutter Version: Channel beta, v0.5.1
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
@talamaska
talamaska / bottom_sheet.dart
Created August 2, 2021 18:26 — forked from slightfoot/bottom_sheet.dart
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss)
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
@talamaska
talamaska / adaptive_scaffold.dart
Created July 7, 2021 20:28 — forked from rodydavis/adaptive_scaffold.dart
Flutter Adaptive Scaffold
import 'package:flutter/material.dart';
const kTabletBreakpoint = 720.0;
const kDesktopBreakpoint = 1200.0;
const kSideMenuWidth = 250.0;
class AdaptiveScaffold extends StatelessWidget {
final List<TabItem> tabs;
final int selectedIndex;
final ValueChanged<int> onSelectionChanged;
@talamaska
talamaska / dart.yml
Created March 12, 2021 12:09 — forked from lukepighetti/dart.yml
Flutter Web + GitHub Actions + Firebase Hosting Preview Channels
# .github/workflows/dart.yml
name: build
on:
push:
branches: [master]
pull_request:
branches: [master]
@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 {
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;
}