Skip to content

Instantly share code, notes, and snippets.

View jxstxn1's full-sized avatar
πŸ‘¨β€πŸ’»
Fluttering

Justin Baumann jxstxn1

πŸ‘¨β€πŸ’»
Fluttering
  • GoLeasy
  • North-Rhine-Westphalia
  • 18:45 (UTC +02:00)
  • X @jxstxn_____
View GitHub Profile
import 'package:flutter_test/flutter_test.dart';
void main() {
test('should round 0.145 to 0.15', () {
const value = 0.145;
final rounded = value.toStringAsFixed(2);
expect(rounded, '0.15'); // actual 0.14
});
test('should round 0.145 to 0.15', () {
@jxstxn1
jxstxn1 / main.dart
Created March 1, 2024 08:39
Pattern Matching
void main() {
final Map<String, dynamic> json = {
"adult": false,
"backdrop_path": '/8Y43POKjjKDGI9MH89NW0NAzzp8.jpg',
"genre_ids": [28, 12, 14, 878],
"id": 140607,
"release_date": '2015-12-18',
};
final {
@jxstxn1
jxstxn1 / cube.dart
Created January 18, 2023 14:35
Flutter 3D Cube Widget
import 'package:flutter/material.dart';
const double boxSize = 65;
class CubeAnimation extends StatefulWidget {
const CubeAnimation();
@override
_CubeAnimationState createState() => _CubeAnimationState();
}