TF-1487 Apply linter rule

This commit is contained in:
dab246
2023-02-24 12:12:54 +07:00
committed by Dat Vu
parent 117a8a8fc6
commit 2b71aba278
155 changed files with 798 additions and 1039 deletions
+4 -4
View File
@@ -3,17 +3,17 @@ import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
_Dispatcher logHistory = _Dispatcher("");
final logHistory = _Dispatcher("");
void log(String? value) {
String v = value ?? "";
logHistory.value = v + "\n" + logHistory.value;
if (kReleaseMode == false) {
logHistory.value = "$v\n${logHistory.value}";
if (kDebugMode) {
print(v);
}
}
void logError(String? value) => log("[ERROR] " + (value ?? ""));
void logError(String? value) => log("[ERROR] ${value ?? ""}");
// Take from: https://flutter.dev/docs/testing/errors
void initLogger(VoidCallback runApp) {
+1 -1
View File
@@ -33,4 +33,4 @@ class _Benchmark {
}
}
final _Benchmark bench = _Benchmark();
final bench = _Benchmark();
+6 -5
View File
@@ -1,11 +1,12 @@
import 'package:flutter/foundation.dart' as Foundation;
import 'package:flutter/foundation.dart';
abstract class BuildUtils {
static const bool isDebugMode = Foundation.kDebugMode;
static const bool isDebugMode = kDebugMode;
static const bool isReleaseMode = Foundation.kReleaseMode;
static const bool isReleaseMode = kReleaseMode;
static const bool isWeb = Foundation.kIsWeb;
static const bool isWeb = kIsWeb;
static const bool isProfileMode = Foundation.kProfileMode;
static const bool isProfileMode = kProfileMode;
}
+3 -3
View File
@@ -34,8 +34,8 @@ class FpsManager {
final List<FpsCallback> _fpsCallbacks = [];
/// Temporarily save 120 frames
static const int _queue_capacity = 120;
final ListQueue framesQueue = ListQueue<FrameTiming>(_queue_capacity);
static const int queueCapacity = 120;
final ListQueue framesQueue = ListQueue<FrameTiming>(queueCapacity);
void addFpsCallback(FpsCallback callback) {
_fpsCallbacks.add(callback);
@@ -69,7 +69,7 @@ class FpsManager {
for (FrameTiming timing in timings) {
framesQueue.addFirst(timing);
}
while (framesQueue.length > _queue_capacity) {
while (framesQueue.length > queueCapacity) {
framesQueue.removeLast();
}