Skip to content

Instantly share code, notes, and snippets.

View talamaska's full-sized avatar

Zlati Pehlivanov talamaska

View GitHub Profile
@talamaska
talamaska / app_colors.dart
Created December 6, 2021 13:25 — forked from fredgrott/app_colors.dart
app colors md3 scheme
// Copyright 2021 Fredrick Allan Grott. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// ignore_for_file: type_annotate_public_apis
import 'package:flutter/cupertino.dart';
import 'package:material_color_utilities/material_color_utilities.dart';
import 'package:material_color_utilities/scheme/scheme.dart';
// Copyright 2021 Fredrick Allan Grott. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// ignore_for_file: prefer_initializing_formals, unnecessary_this, avoid_init_to_null
import 'package:flutter/material.dart';
// Gist: At end of ThemeData ffunc declaration these fields are added to the
// the colorScheme instance.
@talamaska
talamaska / app_colorschemes.dart
Created December 6, 2021 13:25 — forked from fredgrott/app_colorschemes.dart
app color schemes
// Copyright 2021 Fredrick Allan Grott. 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:flutter_starterapp_raw/src/domain/infrastructure/app_vars.dart';
import 'package:flutter_starterapp_raw/src/presentation/themes/app_colors.dart';
// Gist: colors derive from the individual MD3 colors
// defiend in app colors. Other new MD3 fields used
ThemeData appMaterialLightThemeData = ThemeData(
typography: appTypography,
colorScheme: appMaterialLightColorScheme,
brightness: Brightness.light,
visualDensity: VisualDensity.adaptivePlatformDensity,
primaryColor: appMaterialLightColorScheme.primary,
primaryColorBrightness: Brightness.light,
primaryColorLight: appMaterialLightColorScheme.primary,
primaryColorDark: appMaterialDarkColorScheme.primary,
//accentColor:
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,
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 — forked from GiorgioBertolotti/bottom_sheet_fix_status_bar.dart
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';