我正在从另一个班级开始一个新班级,并且在使用扑滑拼图时遇到错误。从主类中启动它可以正常工作,但从另一类中调用它可以使用一个图块而不是15个图块来打开拼图。
我从这里Slide Puzzle下载了项目
我尝试启动状态但失败了
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:pazo/src/core/puzzle_animator.dart';
import 'package:pazo/src/flutter.dart';
import '../src/puzzle_home_state.dart';
class PuzzlePage extends StatefulWidget {
final int rows, columns;
PuzzlePage({int columns = 3, int rows = 3})
: columns = columns ?? 3,
rows = rows ?? 3;
@override
_PuzzlePageState createState() => _PuzzlePageState();
}
class _PuzzlePageState extends State<PuzzlePage> {
Widget build(BuildContext context) {
return _PuzzleHome(widget.rows, widget.rows);
}
}
class _PuzzleHome extends StatefulWidget {
final int _rows, _columns;
const _PuzzleHome(this._rows, this._columns, {Key key}) : super(key: key);
@override
PuzzleHomeState createState() =>
PuzzleHomeState(PuzzleAnimator(_columns, _rows));
}