Skip to content

Instantly share code, notes, and snippets.

View pishguy's full-sized avatar
✍️
Focusing

Mahdi Pishguy pishguy

✍️
Focusing
View GitHub Profile
@slightfoot
slightfoot / sliver_scroll.dart
Last active October 22, 2022 11:54
Example of having a layout with nested scrolling tabs with Slivers.
// 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:
@slightfoot
slightfoot / single_top.dart
Last active June 19, 2022 11:15
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:
@slightfoot
slightfoot / page_turn.dart
Created September 9, 2019 21:28
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:
@slightfoot
slightfoot / multi_select.dart
Last active August 3, 2023 18:10
Multi Select GridView in Flutter - by Simon Lightfoot (Drag to select multiple items) Try now here: https://dartpad.dev/?id=a002dd1e031f5f012f810c6d5da14a11
// 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:
@kherel
kherel / elastic.dart
Last active September 1, 2019 03:33
For DolDurma
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
import 'dart:math';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@slightfoot
slightfoot / split_bar.dart
Last active March 8, 2022 14:06
Split Bar in Flutter. Lets you touch between two horizontal sections to resize the split point.
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(
primaryColor: Colors.indigo,
accentColor: Colors.pinkAccent,
),
@slightfoot
slightfoot / MainActivity.java
Created August 7, 2019 13:25
Transparent Navigation in Flutter on Android.
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
@slightfoot
slightfoot / nested_scroll.dart
Last active April 16, 2020 18:05
Custom nested scroll thingy
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override
@slightfoot
slightfoot / photo_border.dart
Created June 15, 2019 15:26
Example of how to add a vignette style border to any widget using a CustomPainter and magical BlendMode's.
import 'package:flutter/material.dart';
void main() => runApp(PhotoTestApp());
class PhotoTestApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Container(
color: Colors.red,
@Abdullamhd
Abdullamhd / resizing_animation.dart
Created June 3, 2019 11:00
circle resizing animation in flutter
import 'package:flutter/material.dart';
import 'dart:math' as Math;
class AnimationTest extends StatefulWidget {
@override
_AnimationTestState createState() => _AnimationTestState();
}
class _AnimationTestState extends State<AnimationTest>
with SingleTickerProviderStateMixin {