Skip to content

Instantly share code, notes, and snippets.

View aloisdeniel's full-sized avatar
🤘
Flutter / Figma / Firebase rock!

Aloïs Deniel aloisdeniel

🤘
Flutter / Figma / Firebase rock!
View GitHub Profile
@aloisdeniel
aloisdeniel / slide.dart
Last active December 19, 2023 10:13
FittedBox
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
const availableSizes = <Size?>[
null,
Size(1920, 1080),
Size(720, 480),
];
@aloisdeniel
aloisdeniel / flutter_custom_layout.dart
Last active October 2, 2023 22:00
Flutter custom layout
import 'dart:math' as math;
import 'package:flutter/material.dart';
const darkBlue = Color.fromARGB(255, 18, 32, 47);
const barBackground = Color(0xFFE9EAF6);
const barForeground = Color(0xFF0B0B10);
void main() {
runApp(MyApp());
@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);
}
@aloisdeniel
aloisdeniel / text_style.dart
Created May 17, 2023 12:42
Flutter Text Style
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
@aloisdeniel
aloisdeniel / Animation Fade
Last active October 11, 2022 19:10
Xamarin.iOS view common animations
public static void Fade (this UIView view, bool isIn, double duration = 0.3, Action onFinished = null)
{
var minAlpha = (nfloat)0.0f;
var maxAlpha = (nfloat)1.0f;
view.Alpha = isIn ? minAlpha : maxAlpha;
view.Transform = CGAffineTransform.MakeIdentity ();
UIView.Animate (duration, 0, UIViewAnimationOptions.CurveEaseInOut,
() => {
view.Alpha = isIn ? maxAlpha : minAlpha;
@aloisdeniel
aloisdeniel / vector_heart.dart
Created August 9, 2022 08:09
Flutter vector graphics - Custom painter example
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@aloisdeniel
aloisdeniel / bastiui_challenge.dart
Created April 23, 2022 14:57
BastiUI - Challenge
import 'dart:math';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
abstract class Colors {
static const bg1 = Color(0xFF00232B);
static const content1 = Color(0xFFFFFFFF);
static const content2 = Color(0xAAFFFFFF);
static const shadow3d1 = Color(0xFF000000);
@aloisdeniel
aloisdeniel / main.dart
Created February 9, 2022 16:29
Flutter - Separation of concern - #4
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:http/http.dart';
// main.dart
void main() {
runApp(const MyApp());
@aloisdeniel
aloisdeniel / main.dart
Last active February 9, 2022 16:26
Flutter - Separation of concern - #3
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:http/http.dart';
// main.dart
void main() {
runApp(const MyApp());
@aloisdeniel
aloisdeniel / main.dart
Created February 9, 2022 10:52
Flutter - Separation of concern - #1
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {