Skip to content

Instantly share code, notes, and snippets.

View Arashf's full-sized avatar

Arash Farahmandi Arashf

View GitHub Profile
@Arashf
Arashf / single_top.dart
Last active November 24, 2019 11:52 — forked from slightfoot/single_top.dart
Recreating Android Single-Top Activity behaviour with Flutter Route's - by Simon Lightfoot
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
class _ShimmerState extends State<Shimmer> with TickerProviderStateMixin {
AnimationController controller;
@override
void initState() {
super.initState();
controller = AnimationController(vsync: this, duration: widget.period)
..addListener(() {
setState(() {});
})
import 'package:flutter/material.dart';
import 'dart:math';
class DotsIndicator extends AnimatedWidget {
DotsIndicator({
Key key,
this.controller,
this.itemCount,
this.onPageSelected,
this.color: Colors.white,
@Arashf
Arashf / rsa_pem.dart
Created September 15, 2019 04:13 — forked from hnvn/rsa_pem.dart
How to encode/decode RSA private/public keys to PEM format in Dart with asn1lib and pointycastle
import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
import "package:pointycastle/export.dart";
import "package:asn1lib/asn1lib.dart";
List<int> decodePEM(String pem) {
var startsWith = [
"-----BEGIN PUBLIC KEY-----",
"-----BEGIN PRIVATE KEY-----",
import 'package:flutter/material.dart';
import 'dart:math' as math;
import 'dart:async';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@Arashf
Arashf / nextField.dart
Created September 15, 2019 04:03 — forked from escamoteur/nextField.dart
So easy is it now to implement a next field behavior for forms, meaning that the focus is moved as soon the user tabs the next button on the keyboard
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
TabController _tabController;
FocusScopeNode _node = FocusScopeNode(); /// <-----------------
@override
void initState() {
_tabController = TabController(length: 3, vsync: this);
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
class AirHockey extends StatefulWidget {
@override
_AirHockeyState createState() => _AirHockeyState();
}
@Arashf
Arashf / page_turn.dart
Created September 11, 2019 13:52 — forked from slightfoot/page_turn.dart
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Arashf
Arashf / Rewrite Ruls for Vue.js SPA on IIS
Created September 4, 2019 06:00 — forked from wushan/Rewrite Ruls for Vue.js SPA on IIS
Rewrite Ruls for Vue.js SPA on IIS
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="backend" stopProcessing="true">
<match url="^(backend)(.*)$" />
<action type="None" />
</rule>
<rule name="Vuejs rules" stopProcessing="true">
<match url="(.*)" />