mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
chore: Fix some of the remaining lint problems (#1706)
Fix warnings raised by the avoid_void_async lint rule; Remove rule use_enums, which is not available in Dart 2.16
This commit is contained in:
@ -17,7 +17,7 @@ import 'package:examples/stories/utils/utils.dart';
|
||||
import 'package:examples/stories/widgets/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
final dashbook = Dashbook(
|
||||
title: 'Flame Examples',
|
||||
theme: ThemeData.dark(),
|
||||
|
||||
@ -5,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../game/flame_game_test.dart';
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
group('ButtonComponent', () {
|
||||
testWithGame<GameWithTappables>(
|
||||
'correctly registers taps', GameWithTappables.new, (game) async {
|
||||
|
||||
@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../game/flame_game_test.dart';
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
group('HudButtonComponent', () {
|
||||
testWithGame<GameWithTappables>(
|
||||
'correctly registers taps', GameWithTappables.new, (game) async {
|
||||
|
||||
@ -3,7 +3,7 @@ import 'package:flame_test/flame_test.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
group('HudMarginComponent test', () {
|
||||
flameGame.test(
|
||||
'position set from margin should change onGameResize',
|
||||
|
||||
@ -2,7 +2,7 @@ import 'package:flame/components.dart';
|
||||
import 'package:flame_test/flame_test.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
// Generate an image
|
||||
final image = await generateImage();
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ enum _AnimationState {
|
||||
running,
|
||||
}
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
// Generate a image
|
||||
final image = await generateImage();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import 'package:flame/components.dart';
|
||||
import 'package:flame_test/flame_test.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
final image = await generateImage();
|
||||
|
||||
group('SpriteComponent', () {
|
||||
|
||||
@ -7,7 +7,7 @@ enum _SpriteState {
|
||||
running,
|
||||
}
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
// Generate a image
|
||||
final image = await generateImage();
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ class _GamePage extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
final size = Vector2(1.0, 1.0);
|
||||
|
||||
testWidgets('adds focus', (tester) async {
|
||||
|
||||
@ -6,7 +6,7 @@ import 'package:flame_test/flame_test.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
final image = await generateImage();
|
||||
|
||||
group('NineTileBoxWidget', () {
|
||||
|
||||
@ -5,7 +5,7 @@ import 'package:flame_test/flame_test.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
final image = await generateImage();
|
||||
|
||||
group('SpriteAnimationWidget', () {
|
||||
|
||||
@ -4,7 +4,7 @@ import 'package:flame_test/flame_test.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
final image = await generateImage();
|
||||
|
||||
group('SpriteButton', () {
|
||||
|
||||
@ -4,7 +4,7 @@ import 'package:flame_test/flame_test.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() async {
|
||||
Future<void> main() async {
|
||||
final image = await generateImage();
|
||||
|
||||
group('SpriteWidget', () {
|
||||
|
||||
@ -7,7 +7,7 @@ import 'package:flame_audio/audio_pool.dart';
|
||||
import 'package:flame_audio/flame_audio.dart';
|
||||
import 'package:flutter/widgets.dart' hide Animation;
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
runApp(GameWidget(game: AudioGame()));
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import 'package:flame/input.dart';
|
||||
import 'package:flame_fire_atlas/flame_fire_atlas.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() async {
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final game = ExampleGame();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
void main() async {
|
||||
void main() {
|
||||
// There will be a new example in here after Google I/O, stay tuned!
|
||||
// If you want to see the previous examples, go to the flame_forge2d section
|
||||
// of https://examples.flame-engine.org
|
||||
|
||||
@ -142,7 +142,6 @@ linter:
|
||||
- unnecessary_this
|
||||
- unrelated_type_equality_checks
|
||||
- unsafe_html
|
||||
- use_enums
|
||||
- use_full_hex_values_for_flutter_colors
|
||||
- use_function_type_syntax_for_parameters
|
||||
- use_if_null_to_convert_nulls_to_bools
|
||||
|
||||
Reference in New Issue
Block a user