Skip to content

Instantly share code, notes, and snippets.

Avatar
👾
focusing on flutter cross platform mobile dev

Fred Grott fredgrott

👾
focusing on flutter cross platform mobile dev
View GitHub Profile
@fredgrott
fredgrott / my_main.dart
Created Mar 7, 2021
showing how to use fimber for logging
View my_main.dart
void main() async {
// timing and colors defined in function
plantMeDebug();
// ignore: no-empty-block
if (kIsWeb) {
// running on the web!
} else {
await plantFileTree();
@fredgrott
fredgrott / my_log_setup.dart
Created Mar 7, 2021
showing how to use fimber plugin
View my_log_setup.dart
import 'package:fimber/fimber.dart';
import 'package:fimber_io/fimber_io.dart';
import 'package:flutter/widgets.dart';
import 'package:path_provider/path_provider.dart';
// setting tag for the whole app
FimberLog logger = FimberLog("flutter_log_fimber");
Fimber plantMeDebug() {
Fimber.plantTree(DebugTree.elapsed(useColors: true));
@fredgrott
fredgrott / flutter_setup-test.xml
Created Feb 25, 2021
flutter test xml report example
View flutter_setup-test.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite errors="0" failures="0" tests="2" skipped="0" name="D:.fredgrttsstuff.ForkProjects.flutter_setup.test.app_title" timestamp="2021-02-24T20:52:39">
<properties>
<property name="platform" value="vm"/>
</properties>
<testcase classname="D:.fredgrttsstuff.ForkProjects.flutter_setup.test.app_title" name="Basic App Chrome Title test Specified title and color are used to build a Title" time="0.473"/>
<testcase classname="D:.fredgrttsstuff.ForkProjects.flutter_setup.test.app_title" name="Basic App Chrome Title test onGenerateTitle handles changing locales" time="0.063"/>
</testsuite>
<testsuite errors="0" failures="0" tests="2" skipped="0" name="D:.fredgrttsstuff.ForkProjects.flutter_setup.test.golden_widget" timestamp="2021-02-24T20:52:39">
@fredgrott
fredgrott / lcov.info
Created Feb 25, 2021
lcov.info example
View lcov.info
SF:lib\main.dart
DA:3,0
DA:4,0
DA:9,2
DA:11,2
DA:13,2
DA:27,2
DA:35,0
DA:48,3
DA:49,3
@fredgrott
fredgrott / dartdoc_options_base.yaml
Created Feb 16, 2021
dartdoc options yaml file base
View dartdoc_options_base.yaml
# This file is used by dartdoc when generating API documentation for Flutter.
dartdoc:
# Before you can run dartdoc, the snippets tool needs to have a snapshot built.
# The dev/tools/dartdoc.dart script does this automatically.
errors:
# Default errors of dartdoc:
- duplicate-file
- invalid-parameter
- no-defining-library-found
View my_home_page_test.dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:golden_toolkit/golden_toolkit.dart';
import 'package:karma/main.dart';
// ignore: long-method
void main() {
testGoldens('DeviceBuilder - one scenario - default devices', (tester) async {
final builder = DeviceBuilder()
..addScenario(
View golden_widget_test.dart
import 'package:flutter_test/flutter_test.dart';
import 'package:golden_toolkit/golden_toolkit.dart';
import 'package:karma/main.dart';
void main() {
group('Basic Golden Tests ', () {
testWidgets('Golden test', (WidgetTester tester) async {
await tester.pumpWidget(MyApp());
await expectLater(find.byType(MyApp), matchesGoldenFile('main.png'));
});
View flutter_test_config.dart
import 'dart:async';
import 'package:golden_toolkit/golden_toolkit.dart';
Future<void> main(FutureOr<void> Function() testMain) async {
return GoldenToolkit.runWithConfiguration(
() async {
await loadAppFonts();
await testMain();
View keybase.md

Keybase proof

I hereby claim:

  • I am fredgrott on github.
  • I am fredgrott (https://keybase.io/fredgrott) on keybase.
  • I have a public key whose fingerprint is B2F2 0535 43DC 4FD2 ED45 272D 4DCE 5BB1 58BC EAA1

To claim this, I am signing this object:

@fredgrott
fredgrott / SubscribersExt.kt
Created Nov 5, 2018
better way to log RxJava without the callstack and only appears in debug logs
View SubscribersExt.kt
/* Copyright 2018 Fred Grott
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,