Skip to content

Instantly share code, notes, and snippets.

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

Aloïs Deniel aloisdeniel

🤘
Flutter / Figma
View GitHub Profile
@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 {
@aloisdeniel
aloisdeniel / Solution.dart
Last active August 30, 2021 12:15
Expand padding while scroll
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(

Test

Create file

pubspec.yaml

Open file

pubspec.yaml

import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@aloisdeniel
aloisdeniel / stream_vs_valuelistenable.dart
Last active April 17, 2021 20:14
This example shows how, in a majority of cases, Streams cause unnecessary rebuilds in initial state.
import 'package:flutter/material.dart';
import 'package:rxdart/rxdart.dart';
// Global application configuration and navigation
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(home: Home());
@aloisdeniel
aloisdeniel / build.dart
Last active April 5, 2019 04:55
Removing depdencies to flutter SDK into path_drawing
// Example of using parsed command to generate flutter code
var result = List<Code>();
final SvgPathStringSource parser = new SvgPathStringSource(svg);
final SvgPathNormalizer normalizer = new SvgPathNormalizer();
var segments = parser.parseSegments();
for (PathSegmentData seg in segments) {
result.addAll(normalizer.emitSegment(seg).map((c) => Code(_generateCommand(c).toString() + ";")));
}
@aloisdeniel
aloisdeniel / Battery.standard.cs
Created March 8, 2018 07:40
Caboodle mock example
namespace Microsoft.Caboodle
{
public interface IBattery
{
void StartBatteryListeners();
void StopBatteryListeners();
double ChargeLevel { get; }