Skip to content

Instantly share code, notes, and snippets.

View HelloCore's full-sized avatar

Core HelloCore

  • Bangkok, Thailand
View GitHub Profile
import 'package:fizz_buzz_golden/fizz_buzz_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:golden_toolkit/golden_toolkit.dart';
void main() {
group('fizz_buzz_page', () {
Widget page;
setUp(() {
page = FizzBuzzPage();
import 'package:fizz_buzz_golden/widgets/fizz_buzz_button.dart';
import 'package:flutter/material.dart';
class FizzBuzzPage extends StatefulWidget {
@override
_FizzBuzzPageState createState() => _FizzBuzzPageState();
}
class _FizzBuzzPageState extends State<FizzBuzzPage> {
var _score = 0;
import 'package:fizz_buzz_golden/widgets/fizz_buzz_button.dart';
import 'package:flutter/material.dart';
import 'package:golden_toolkit/golden_toolkit.dart';
void main() {
testGoldens('fizz_buzz_button', (tester) async {
final builder = GoldenBuilder.column(bgColor: Colors.white)
..addScenario(
'number', FizzBuzzButton(type: FizzBuzzButtonType.number, number: 1))
..addScenario('other number',
import 'package:flutter/material.dart';
enum FizzBuzzButtonType {
fizz,
buzz,
number,
fizzBuzz,
}
class FizzBuzzButton extends StatelessWidget {
@HelloCore
HelloCore / launch.json
Created May 23, 2020 15:29
launch.json compounds
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
},
{
"name": "Flutter: old ios binary",
@HelloCore
HelloCore / launch.json
Created May 23, 2020 15:22
launch.json multiple devices
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
},
{
"name": "Flutter: old ios binary",
@HelloCore
HelloCore / tasks.json
Last active May 23, 2020 15:05
task.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Generate Code",
"type": "shell",
"command": "flutter packages pub run build_runner build --delete-conflicting-outputs"
},
{
"label": "Force build iOS simulator",
@HelloCore
HelloCore / launch.json
Created May 23, 2020 14:35
Flutter launch old application
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
},
{
"name": "Flutter: old ios binary",
@HelloCore
HelloCore / svg.js
Last active January 15, 2020 11:45
Animate-path-curve
import React, { memo, useMemo } from 'react';
import { Animated, StyleSheet, View, Button } from 'react-native';
import { Path, Svg } from 'react-native-svg';
const AnimatedPath = Animated.createAnimatedComponent(Path);
function ReproduceIssue() {
const animatedValue = useMemo(() => new Animated.Value(0), []);
return (
@HelloCore
HelloCore / svg.js
Created January 14, 2020 05:27
animated-stroke
// https://github.com/react-native-community/react-native-svg/issues/951#issuecomment-487986226
import { arc } from 'd3-shape';
import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { Animated, Button, StyleSheet, View } from 'react-native';
import { Circle, G, Path, Svg } from 'react-native-svg';
const AnimatedPath = Animated.createAnimatedComponent(Path);
const arcGenerator = arc();