Skip to content

Instantly share code, notes, and snippets.

@kentcb
kentcb / reactive_refresh_indicator.dart
Last active February 17, 2021 02:21
A better RefreshIndicator for flutter
// Copyright 2014 The Chromium Authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
final units = InformationUnit.values;
for (var i = 1; i < units.length; ++i) {
final unit = units[i];
final bits = unit.numberOfBitsComprisingUnit;
print("test('${unit.name}s calculates correctly', () {");
print(" final sut = InformationSize.fromBits(BigInt.parse('${bits + (bits >> 1)}'));");
print(" final result = sut.${unit.name}s;");
print(" expect(result, 1.5);");
void main() {
final units = InformationUnit.values;
for (var i = 0; i < units.length; ++i) {
final unit = units[i];
final bits = unit.numberOfBitsComprisingUnit;
print('BigInt.parse(\'$bits\'): $unit,');
if (i > 0) {
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 2.24.0
VS Code: 1.32.3
Platform: win
Workspace type: Dart
Multi-root?: false
Dart SDK:
Loc: C:\Program Files\Dart\dart-sdk
Ver: 2.1.0
Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the NuGet Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
Running restore with 2 concurrent jobs.
Reading project file C:\Users\kent\Repository\<<redacted>>\src\<<redacted>>\MESH\API.Interfaces\API.Interfaces.csproj.
Reading project file C:\Users\kent\Repository\<<redacted>>\src\<<redacted>>\MESH\API\API.csproj.
The restore inputs for 'API.Interfaces' have not changed. No further actions are required to complete the restore.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: C:\Users\kent\Repository\<<redacted>>\src\<<redacted>>\MESH\API.Interfaces\obj\project.assets.json
No-Op restore. The cache will not be updated. Path: C:\Users\kent\Repository\<<redacted>>\src\<<redacted>>\MESH\API.Interfaces\obj\API.Interfaces.csproj.nuget.cache
Restore completed in 6.69 ms for C:\Users\kent\Repository\<<redacted>>\
Module directory does not exist.
NuGet.config not found.
Analyzing build script...
Analyzing /bitrise/src/build.cake...
Processing build script...
Installing addins...
Found package 'Cake.Git 0.19.0' in '/bitrise/src/tools/Addins'.
Package Cake.Git.0.19.0 has already been installed.
Successfully installed 'Cake.Git 0.19.0' to /bitrise/src/tools/Addins
Executing nuget actions took 34.16 ms
[09:05:34]: Spawning C:\Users\kent\Repository\flutter\bin\cache\dart-sdk\bin\dart.exe with args ["C:\\Users\\kent\\Repository\\flutter\\bin\\cache\\dart-sdk\\bin\\snapshots\\analysis_server.dart.snapshot","--client-id=Dart-Code.dart-code","--client-version=2.11.2"]
[09:05:34]: ==> {"id":"1","method":"server.setSubscriptions","params":{"subscriptions":["STATUS"]}}
[09:05:34]: ==> {"id":"2","method":"analysis.setAnalysisRoots","params":{"excluded":[],"included":["c:\\Users\\Kent\\Repository\\<<redacted>>\\src"]}}
[09:05:34]: ==> {"id":"3","method":"analysis.updateContent","params":{"files":{"c:\\Users\\Kent\\Repository\\<<redacted>>\\src\\lib\\features\\timesheet\\ui.dart":{"content":"import 'dart:async';\r\nimport 'dart:core';\r\nimport 'dart:core' as core;\r\n\r\nimport 'package:flutter/material.dart';\r\nimport 'package:flutter_redux/flutter_redux.dart';\r\nimport 'package:meta/meta.dart';\r\nimport 'package:redux/redux.dart';\r\nimport 'package:<<redacted>>/features/login/actions.dart';\r\nimport 'package:<
@kentcb
kentcb / main.log
Last active January 17, 2018 11:00
Latexmk: This is Latexmk, John Collins, 12 Dec. 2017, version: 4.54c.
Rule 'pdflatex': File changes, etc:
Changed files, or newly in use since previous run(s):
'03_Getting_Started.tex'
'codeblocks.tex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex -synctex=1 -interaction=nonstopmode -file-line-error -recorder "c:\Users\Kent\Repository\ReactiveUIBook\LaTeX\main.tex"'
@kentcb
kentcb / ItemsFailing.txt
Created December 22, 2017 11:34
Failing Items List
This file has been truncated, but you can view the full file.
Compile: Academic\AcademicWeekItemViewModel.cs
Compile: ActivatableReactiveObject.cs
Compile: Calculator\GPACalculatorViewModel.cs
Compile: Calendar\AllDayEventViewModel.cs
Compile: Calendar\AssignmentEventViewModel.cs
Compile: Calendar\CalendarEventViewModel.cs
Compile: Calendar\CalendarMode.cs
Compile: Calendar\CalendarViewModel.cs
Compile: Calendar\DateViewModel.cs
Compile: Calendar\EditAssignmentEventViewModel.cs
@kentcb
kentcb / ItemsWorking.txt
Created December 22, 2017 11:32
Working Items List
Compile: Academic\AcademicWeekItemViewModel.cs
Compile: ActivatableReactiveObject.cs
Compile: Calculator\GPACalculatorViewModel.cs
Compile: Calendar\AllDayEventViewModel.cs
Compile: Calendar\AssignmentEventViewModel.cs
Compile: Calendar\CalendarEventViewModel.cs
Compile: Calendar\CalendarMode.cs
Compile: Calendar\CalendarViewModel.cs
Compile: Calendar\DateViewModel.cs
Compile: Calendar\EditAssignmentEventViewModel.cs