Skip to content

Instantly share code, notes, and snippets.

View long1eu's full-sized avatar
🎯
Focusing

Razvan Lung long1eu

🎯
Focusing
  • România
View GitHub Profile
@long1eu
long1eu / gist:e59e3674871d3d63c9fe7b177fe43ca8
Last active April 11, 2024 07:58
InteractiveViewer with CustomMultiChildLayout
import 'dart:convert';
import 'dart:io';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:image_size_getter/file_input.dart' as image_size;
import 'package:image_size_getter/image_size_getter.dart' as image_size;
void main() {
runApp(const MyApp());
@long1eu
long1eu / main.dart
Created November 6, 2019 13:04
AES/CBC/PKCS7Padding for dart using pointycastle
import 'dart:convert';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:pointycastle/api.dart';
import 'package:pointycastle/block/aes_fast.dart';
import 'package:pointycastle/block/modes/cbc.dart';
import 'package:pointycastle/padded_block_cipher/padded_block_cipher_impl.dart';
import 'package:pointycastle/paddings/pkcs7.dart';
// File created by
// Lung Razvan <long1eu>
// on 2019-01-01
import 'dart:io';
import 'package:pub_semver/pub_semver.dart';
import 'package:yaml/yaml.dart';
void main() {
@long1eu
long1eu / color_matrix.dart
Created January 14, 2019 17:44
ColorMatrix
import 'dart:math' as math;
import 'package:collection/collection.dart';
/// 4x5 matrix for transforming the color and alpha components of a Bitmap.
/// The matrix can be passed as single array, and is treated as follows:
///
/// <pre>
/// [ a, b, c, d, e,
/// f, g, h, i, j,
import 'package:engine_io_client/engine_io_client.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
final RegExp urlRegEx = new RegExp(r'(https?://)?(www\.)?([\w]+\.)+[‌​\w]{2,63}/?');
final RegExp phoneRegEx =
new RegExp(r'(([(]?(\d{2,4})[)]?)|(\d{2,4})|([+1-9]+\d{1,2}))?[-\s]?(\d{2,3})?[-\s]?((\d{7,8})|(\d{3,4}[-\s]\d{3,4}))');
RegExp emailRegEx = new RegExp(r'[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+');
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
static MyAppState of(BuildContext context) => (context.inheritFromWidgetOfExactType(AppState) as AppState).data;
@override
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(home: new BottomSheetColor()));
}
class BottomSheetColor extends StatelessWidget {
@override
Widget build(BuildContext context) {
import 'dart:async';
import 'package:rxdart/src/streams/utils.dart';
typedef Stream<T> RetryWhenStreamFactory<T>(dynamic error, StackTrace s);
class RetryWhenStream<T> extends Stream<T> {
final StreamFactory<T> streamFactory;
final RetryWhenStreamFactory<T> retryWhenFactory;
StreamController<T> controller;
@long1eu
long1eu / retry_when.dart
Last active May 30, 2018 13:42
Dart retryWhen transformer
// File created by
// long1eu <[email protected]>
// on 30/05/2018
import 'dart:async';
typedef Stream<T> RetryWhenStreamFactory<T>(Stream<Object> error);
class RetryWhenStreamTransformer<T> extends StreamTransformerBase<T, T> {
final StreamTransformer<T, T> transformer;
import 'dart:math' as math;
import 'dart:math';
import 'package:flutter/foundation.dart';
import 'package:color/color.dart';
import 'dart:ui' as ui;
Map<String, ColorDefinition> _kColorDictionary = {
Hue.monochrome.name:
const ColorDefinition(hue: Hue.monochrome, lowerBounds: const [