Skip to content

Instantly share code, notes, and snippets.

View g-apparence's full-sized avatar

Gautier g-apparence

View GitHub Profile
@g-apparence
g-apparence / pendulum.dart
Last active October 30, 2024 15:10
Create a basic pendulum with flutter
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:vector_math/vector_math.dart' as v;
import 'model.dart';
void main() {
runApp(const MyApp());
@g-apparence
g-apparence / responsive_layout.dart
Created July 2, 2024 17:10
A responsive flutter builder
import 'package:flutter/widgets.dart';
enum DeviceType {
small(0),
medium(768),
large(1024),
xlarge(1280);
final int breakpoint;
@g-apparence
g-apparence / responsive_layout.dart
Last active November 8, 2023 14:43
Flutter responsive layout
import 'package:flutter/widgets.dart';
import 'package:universal_io/io.dart';
enum DeviceType {
small,
medium,
large,
xlarge,
}
// ignore_for_file: prefer_const_constructors
// ignore_for_file: prefer_const_literals_to_create_immutables
import 'package:flutter/material.dart';
void main() async {
// Ensure bindings are initialized otherwise we can't user rootBundle.
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
@g-apparence
g-apparence / rust_cheatsheat.md
Last active February 24, 2022 15:18
rust cheatsheat

Run and install

Run src.main.rs or src.lib

cargo run

Run from examples folder

add my_file.rs in examples/my_file.rs

cargo run --example my_file

@g-apparence
g-apparence / pal-setup.dart
Last active January 29, 2021 07:14
Pal setup instructions
import 'package:flutter/material.dart';
import 'package:pal/pal.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final _navigatorKey = GlobalKey<NavigatorState>();