Skip to content

Instantly share code, notes, and snippets.

View bambinoua's full-sized avatar

BambinoUA bambinoua

  • Ukraine
View GitHub Profile
@bambinoua
bambinoua / shapes_4.dart
Last active October 17, 2024 09:28
Shapes with drag&drop
import 'dart:math';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
class Foo5 extends StatefulWidget {
const Foo5({super.key, required this.image});
final ImageProvider image;
@bambinoua
bambinoua / scrollable_debounce.dart
Created September 4, 2024 06:37
ScrollableDebouce
class ScrollableDebounce extends StatefulWidget {
const ScrollableDebounce({
Key? key,
required this.controller,
required this.onScroll,
this.debounceTime = const Duration(milliseconds: 200),
required this.child,
}) : super(key: key);
/// An object that can be used to control the position to which this scroll
@bambinoua
bambinoua / toggle_buttons_fill_colors.dart
Last active March 28, 2024 12:08
`ToggleButtons` fill color switcher
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
enum Buttons {
android,
iOS,
}
@bambinoua
bambinoua / Flutter Clean.md
Created March 21, 2023 11:18 — forked from minhcasi/Flutter Clean.md
These are common issues on Flutter and solutions to fix

Quick Clean Cache

  1. Open android studio Tools->Flutter->Clean
  2. Go to File -> Invalidate Caches / Restart
  3. Or open terminal run "flutter clean"
  4. Remove pubspec.lock
  5. Double check the Flutter SDK Path config correcty - https://tppr.me/qn6dP

Or open the terminal and try this script:

flutter clean
@bambinoua
bambinoua / image_size_data.dart
Created February 23, 2023 15:23 — forked from dnfield/image_size_data.dart
Image size parsing in Dart
import 'dart:typed_data';
import 'package:meta/meta.dart';
/// Image formats supported by Flutter.
enum ImageFormat {
/// A Portable Network Graphics format image.
png,
/// A JPEG format image.
///
@bambinoua
bambinoua / formProgress.js
Created February 16, 2023 09:38 — forked from adactio/formProgress.js
Show a progress bar with every form that has a method of POST. Particularly nice if there's a file upload involved.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function (win, doc) {
'use strict';
if (!win.XMLHttpRequest || !win.FormData || !win.addEventListener || !doc.querySelectorAll) {
// doesn't cut the mustard.
return;
}
function hijaxForm (formElement) {
var progressBar;
@bambinoua
bambinoua / my_scrollbar_example.dart
Created January 10, 2023 12:41
Example of using ScrollbarPainter
import 'package:flutter/material.dart';
const double _kScrollbarThickness = 6.0;
class MyScrollbar extends StatefulWidget {
final ScrollableWidgetBuilder builder;
final ScrollController scrollController;
const MyScrollbar({
Key key,
@bambinoua
bambinoua / always_scrollbar.dart
Created January 10, 2023 12:38 — forked from slightfoot/always_scrollbar.dart
Always Visible Scrollbar for Flutter - 4th March 2019
import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Colors.indigo,
@bambinoua
bambinoua / downloadFile.dart
Created January 4, 2023 17:19 — forked from ajmaln/downloadFile.dart
Download file with progress in Dart/Flutter using 'http' package
import 'dart:typed_data';
import 'dart:io';
import 'package:http/http.dart';
import 'package:path_provider/path_provider.dart';
downloadFile(String url, {String filename}) async {
var httpClient = http.Client();
var request = new http.Request('GET', Uri.parse(url));
// Main video widget.
class VideoState extends State {
Widget build(...) {
return Row(
childred: [
SideBar(), // can be hidden (depending on this overlay which can be created deeper should change its sze as VideoMonitor widget will also be resized.
VideoMonitor(), // contains VideoMonitorGrid
],
);
}