Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Jun 17, 2024
1 parent fa37092 commit 9585041
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
16 changes: 8 additions & 8 deletions lib/Backend/Definitions/Action/base_action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ class CommandAction extends BaseAction with _$CommandAction {
@Implements<BaseAction>()
factory CommandAction({
required String command,
final String? response,
required String name,
required final String uuid,
required List<DeviceType> deviceCategory,
required final ActionCategory actionCategory,
final String? response,
@Default({}) final Map<DeviceType, String> nameAlias,
}) = _CommandAction;

Expand All @@ -106,10 +106,10 @@ class AudioAction extends BaseAction with _$AudioAction {
@Implements<BaseAction>()
factory AudioAction({
@HiveField(5) required String file,
@HiveField(2) @Default(DeviceType.values) final List<DeviceType> deviceCategory,
@HiveField(3) @Default(ActionCategory.audio) final ActionCategory actionCategory,
@HiveField(1) required String name,
@HiveField(4) required final String uuid,
@HiveField(2) @Default(DeviceType.values) final List<DeviceType> deviceCategory,
@HiveField(3) @Default(ActionCategory.audio) final ActionCategory actionCategory,
@Default({}) final Map<DeviceType, String> nameAlias,
}) = _AudioAction;
}
Expand All @@ -121,10 +121,10 @@ class MoveList extends BaseAction with _$MoveList {

@Implements<BaseAction>()
factory MoveList({
@HiveField(2) @Default(DeviceType.values) List<DeviceType> deviceCategory,
@HiveField(3) @Default(ActionCategory.sequence) final ActionCategory actionCategory,
@HiveField(1) required String name,
@HiveField(4) required final String uuid,
@HiveField(2) @Default(DeviceType.values) List<DeviceType> deviceCategory,
@HiveField(3) @Default(ActionCategory.sequence) final ActionCategory actionCategory,
@HiveField(5) @Default([]) List<Move> moves,
@HiveField(6) @Default(1) double repeat,
}) = _MoveList;
Expand All @@ -136,11 +136,11 @@ class EarsMoveList extends BaseAction with _$EarsMoveList {

@Implements<BaseAction>()
factory EarsMoveList({
@HiveField(2) @Default([DeviceType.ears]) List<DeviceType> deviceCategory,
@HiveField(3) @Default(ActionCategory.ears) final ActionCategory actionCategory,
@HiveField(1) required String name,
@HiveField(4) required final String uuid,
@Default({}) final Map<DeviceType, String> nameAlias,
required final List<Object> commandMoves,
@HiveField(2) @Default([DeviceType.ears]) List<DeviceType> deviceCategory,
@HiveField(3) @Default(ActionCategory.ears) final ActionCategory actionCategory,
@Default({}) final Map<DeviceType, String> nameAlias,
}) = _EarsMoveList;
}
1 change: 1 addition & 0 deletions lib/Backend/dynamic_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Future<void> getRemoteDynamicConfigInfo() async {
Response<String> response = await dio.get('https://raw.githubusercontent.com/OpenTails/tail_app/master/assets/dynamic_config.json', options: Options(contentType: ContentType.json.mimeType, responseType: ResponseType.json));
if (response.statusCode! < 400) {
String jsonData = response.data!;
// ignore: unused_local_variable
DynamicConfigInfo dynamicConfigInfo = DynamicConfigInfo.fromJson(const JsonDecoder().convert(jsonData)); //Throws if config invalid
HiveProxy.put(settings, dynamicConfigJsonString, jsonData); //store it for next app launch

Expand Down
1 change: 1 addition & 0 deletions lib/Backend/logging_wrappers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:sentry_hive/sentry_hive.dart';

import '../constants.dart';

// ignore: library_private_types_in_public_api
_HiveProxyImpl HiveProxy = _HiveProxyImpl();
List<String> genericBoxes = [settings, notificationBox];

Expand Down
1 change: 1 addition & 0 deletions lib/Frontend/Widgets/back_button_to_close.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class _BackButtonToCloseState extends ConsumerState<BackButtonToClose> {
super.dispose();
}

// ignore: avoid_positional_boolean_parameters
bool myInterceptor(bool stopDefaultButtonEvent, RouteInfo info) {
if (info.currentRoute(context)!.isFirst && info.currentRoute(context)!.isCurrent) {
if (isAnyGearConnected.value) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Frontend/Widgets/scan_for_new_device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _ScanForNewDevice extends ConsumerState<ScanForNewDevice> {
),
),
),
]
],
],
)
: Container(),
Expand Down
1 change: 0 additions & 1 deletion lib/Frontend/pages/html_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class _HtmlPageState extends State<HtmlPage> {
class MyWidgetFactory extends WidgetFactory {
@override
Widget? buildImageWidget(BuildMetadata tree, ImageSource src) {
final url = src.url;
return LoadImage(url: src.url);
}
}
Expand Down
26 changes: 13 additions & 13 deletions lib/Frontend/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ Future<Dio> initDio({skipSentry = false}) async {
if (_dio != null) {
return _dio!;
}
final Dio dio = Dio();
dio.httpClientAdapter = NativeAdapter();
dio.interceptors.add(
LogInterceptor(
requestBody: false,
requestHeader: false,
responseBody: false,
responseHeader: false,
request: true,
logPrint: (o) => dioLogger.finer(o.toString()),
),
);
dio.interceptors.add(LogarteDioInterceptor(logarte));
final Dio dio = Dio()
..httpClientAdapter = NativeAdapter()
..interceptors.add(
LogInterceptor(
requestBody: false,
requestHeader: false,
responseBody: false,
responseHeader: false,
request: true,
logPrint: (o) => dioLogger.finer(o.toString()),
),
)
..interceptors.add(LogarteDioInterceptor(logarte));
dio.interceptors.add(
RetryInterceptor(
dio: dio,
Expand Down

0 comments on commit 9585041

Please sign in to comment.