Skip to content

Instantly share code, notes, and snippets.

View Jouby's full-sized avatar
🏠
Working from home

Aurelien Joubert Jouby

🏠
Working from home
View GitHub Profile
@Jouby
Jouby / helios_test.dart
Created March 16, 2022 12:39
Helios Algo Test
String package(String input) {
var output = '';
var currentPackageWeight = 0;
for (var rune in input.runes) {
var character = String.fromCharCode(rune);
var currentValue = int.parse(character);
if (currentPackageWeight + currentValue > 10) {
output += '/';
@Jouby
Jouby / flutter_mock_i18nomatic.dart
Last active February 12, 2021 23:11
Flutter Mock I18nOMatic
import 'package:i18n_omatic/i18n_omatic.dart';
import 'package:mockito/mockito.dart';
class MockI18nOMatic extends Mock implements I18nOMatic {}
class MockSetUp {
static void mockI18nOMatic() {
I18nOMatic.instance = MockI18nOMatic();
when(I18nOMatic.instance.tr(any, any)).thenAnswer((realInvocation) {
var strTranslated = realInvocation.positionalArguments[0].toString();