Skip to content

Instantly share code, notes, and snippets.

View bambinoua's full-sized avatar

BambinoUA bambinoua

  • Ukraine
View GitHub Profile
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
@bambinoua
bambinoua / image_remove_backgroun.dart
Created September 2, 2022 12:32 — forked from plateaukao/image_remove_backgroun.dart
image remove background in flutter
Future<Uint8List> _downloadImage() async {
String dir = (await getApplicationDocumentsDirectory()).path;
File file = new File('$dir/$_filename');
if (file.existsSync()) {
var image = await file.readAsBytes();
return image;
} else {
var response = await http.get(_url,);
var bytes = response.bodyBytes;
@bambinoua
bambinoua / OverlayableContainerOnLongPress_sample.dart
Created December 1, 2022 13:22 — forked from boeledi/OverlayableContainerOnLongPress_sample.dart
How to display an overlay on top of a particular item, present in a Scroll Area, on longPress?
import 'package:flutter/material.dart';
import 'dart:math';
void main() {
///
/// Launch the application
///
runApp(Application());
}
@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));
@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 / 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 / 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 / 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 / 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