View main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math' as math; | |
Future<void> main() async { | |
final program = '(begin (define circle-area (lambda (r) (* pi (* r r)))) (circle-area 10))'; | |
print(eval(parse(program), standardEnv)); | |
} | |
dynamic parse(String program) => parseTokens(tokenize(program)); | |
List<String> tokenize(String program) => program |
View main.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> main() async { | |
// final program = '(define x 42)'; | |
final program = '(begin (define circle-area (lambda (r) (* pi (* r r)))) (circle-area 10))'; | |
print(parse(program)); | |
} | |
dynamic parse(String program) => parseTokens(tokenize(program)); | |
List<String> tokenize(String program) => program | |
.replaceAll('(', ' ( ') |
View maybe_dart.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// Functor | |
num plus3(num x) => x + 3; | |
print(Just(2).fmap(plus3)); // Just 5 | |
print(Nothing<num>().fmap(plus3)); | |
print([1,2,3].map((x) => x + 2)); // (3, 4, 5) | |
final foo = fmap((x) => x + 3, (x) => x + 2); |
View code_generation.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flutter pub run build_runner build - delete-conflicting-outputs | |
# or | |
flutter pub run build_runner watch - delete-conflicting-outputs |
View counter.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Counter | |
Scenario: Initial counter value is 0 | |
Given the app is running | |
Then I see {'0'} text | |
Scenario: Tap the Plus icon increments the counter | |
Given the app is running | |
When I tap {Icons.add} icon | |
Then I see {'1'} text |
View counter_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GENERATED CODE - DO NOT MODIFY BY HAND | |
// ignore_for_file: unused_import, directives_ordering | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import './step/the_app_is_running.dart'; | |
import './step/i_see_text.dart'; | |
void main() { |
View counter.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Counter | |
Scenario: Initial counter value is 0 | |
Given the app is running | |
Then I see {'0'} text |
View ScaryService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IProfileApi | |
{ | |
Task<Profile> GetProfile(int id); | |
Task<Profile> GetMyProfile(); | |
Task UpdateMyProfile(Profile profile); | |
Task<IEnumerable<Post>> GetPosts(int profile); | |
… | |
} |
View TransitionAnimator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TransitionAnimator : UIViewControllerAnimatedTransitioning | |
{ | |
private const double _duration = 0.5; | |
public CGRect ThumbnailFrame { get; set; } | |
public UINavigationControllerOperation Operation { get; set; } | |
public override void AnimateTransition(IUIViewControllerContextTransitioning transitionContext) | |
{ | |
var presenting = Operation == UINavigationControllerOperation.Push; |
View opendetails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Task OpenDetails(BeatleModel beatle) | |
{ | |
MessagingCenter.Send<object, int>(this, "TransitionId", beatle.Id); | |
... | |
} |
NewerOlder