1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-03 02:02:27 +00:00

update slide_puzzle (#420)

* update slide_puzzle

* run createThumbnails before build-release grind task

* add license headers
This commit is contained in:
John Ryan
2020-04-29 13:41:36 -07:00
committed by GitHub
parent ddf610d682
commit 9a464fad00
24 changed files with 241 additions and 33 deletions

View File

@@ -1,3 +1,7 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math' show Point;
const zeroPoint = Point<double>(0, 0);

View File

@@ -1,3 +1,7 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math' as math;
class Point extends math.Point<int> {

View File

@@ -1,3 +1,7 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:collection';
import 'dart:convert';
import 'dart:math' show Random, max;

View File

@@ -1,3 +1,7 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'dart:math' show Point, Random;

View File

@@ -0,0 +1,25 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math' show Point;
enum PuzzleEvent { click, random, reset, noop }
abstract class PuzzleProxy {
int get width;
int get height;
int get length;
bool get solved;
void clickOrShake(int tileValue);
int get tileCount;
Point<double> location(int index);
bool isCorrectPosition(int value);
}

View File

@@ -1,3 +1,7 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of 'puzzle.dart';
class _PuzzleSimple extends Puzzle {

View File

@@ -1,3 +1,7 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of 'puzzle.dart';
mixin _SliceListMixin on ListMixin<int> {

View File

@@ -1,3 +1,7 @@
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
void requireArgument(bool truth, String argName, [String message]) {
if (!truth) {
if (message == null || message.isEmpty) {