Skip to content

Instantly share code, notes, and snippets.

View letsar's full-sized avatar
🦋
Flutter forever

Romain Rastel letsar

🦋
Flutter forever
View GitHub Profile
@praeclarum
praeclarum / Layout.cs
Created March 16, 2013 05:23
A C# syntax for NSLayoutConstraints.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using MonoTouch.UIKit;
namespace Async.iOS
{
public static class Layout
{
@parmentf
parmentf / GitCommitEmoji.md
Last active July 4, 2024 06:07
Git Commit message Emoji
@joncardasis
joncardasis / Storing-Images-On-Github.md
Last active June 25, 2024 16:30
Storing Images and Demos in your Repo

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets

The pull request empoji code

  • 👍 This is great!
  • ❓ I have a question / can you clarify?
  • ❌ This has to change. It’s possibly an error or strongly violates existing conventions.
  • 🔧 This is a well meant suggestion. Take it or leave it.
  • 🙃 This is a nitpick.
  • 🤔 I have some serious concerns about this particular piece of code, we should think about it/discuss it further.
  • 🤡 This is a complaint about something we don’t have an obvious answer to and that is not necessarily a problem originating from your changes.
@aloisdeniel
aloisdeniel / flutter_spanablegrid.dart
Last active August 10, 2023 11:27
Custom GridView with various cell sizes in Flutter
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/src/rendering/sliver.dart';
import 'package:flutter/src/rendering/sliver_grid.dart';
class _CoordinateOffset {
final double main, cross;
_CoordinateOffset(this.main, this.cross);
}
@letsar
letsar / variable_sized_grid_view.dart
Last active January 31, 2023 22:54
VariableSizedGridView for Flutter (Masonry style)
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
/// Signature for a function that creates a [TileSize] for a given index.
typedef TileSize IndexedTileSizeBuilder(int index);
/// Creates grid layouts with a fixed number of spans in the cross axis.
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@slightfoot
slightfoot / squircle.dart
Last active June 21, 2024 17:06
Flutter Squircle Shape
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Squircle',
home: new Scaffold(
import 'package:flutter/material.dart';
class NewsCardLayout extends MultiChildLayoutDelegate {
NewsCardLayout();
static const String title = 'title';
static const String description = 'description';
static const String source = 'source';
@override
@rodydavis
rodydavis / dragable_slidable.dart
Last active August 8, 2018 20:08
flutter_slidable and flutter_list_drag_and_drop using cloud_firestore in Flutter
import 'dart:async';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_firebase_ui/flutter_firebase_ui.dart';