Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendJanKramer committed Jan 22, 2025
1 parent 98be817 commit 2d99e21
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
3 changes: 2 additions & 1 deletion lib/pages/download_model/download_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class _DownloadModelPageState extends State<DownloadModelPage> {
}

Future<void> onClose() async {
final navigator = Navigator.of(context);
final result = await showDialog<bool>(context: context, builder: (BuildContext context) => ContentDialog(
title: const Text("Download in progress"),
content: const Text("Press 'continue' to keep downloading the model"),
Expand All @@ -117,7 +118,7 @@ class _DownloadModelPageState extends State<DownloadModelPage> {
);

if (result == true && context.mounted) {
GoRouter.of(context).pop();
navigator.pop();
}
}

Expand Down
4 changes: 0 additions & 4 deletions lib/pages/text_to_image/playground.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import 'package:inference/providers/text_to_image_inference_provider.dart';
import 'package:inference/theme_fluent.dart';
import 'package:inference/widgets/device_selector.dart';
import 'package:inference/widgets/toolbar_text_input.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';

class TTIPlayground extends StatefulWidget {
Expand Down Expand Up @@ -89,9 +88,6 @@ class _TTIPlaygroundState extends State<TTIPlayground> {

@override
Widget build(BuildContext context) {
Locale locale = Localizations.localeOf(context);
final nf = NumberFormat.decimalPatternDigits(
locale: locale.languageCode, decimalDigits: 2);
final theme = FluentTheme.of(context);

return Row(
Expand Down
1 change: 0 additions & 1 deletion lib/pages/vlm/live_inference_pane.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'package:inference/providers/vlm_inference_provider.dart';
import 'package:inference/theme_fluent.dart';
import 'package:inference/widgets/device_selector.dart';
import 'package:inference/widgets/grid_container.dart';
import 'package:inference/widgets/horizontal_rule.dart';
import 'package:provider/provider.dart';

class VLMPlayground extends StatefulWidget {
Expand Down
3 changes: 0 additions & 3 deletions lib/pages/vlm/widgets/image_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ class _ImageGridState extends State<ImageGrid> {

@override
Widget build(BuildContext context) {
var width = MediaQuery.of(context).size.width;
var height = MediaQuery.of(context).size.height;

return DropArea(
showChild: galleryData.isNotEmpty,
onUpload: onDrop,
Expand Down
8 changes: 8 additions & 0 deletions lib/project.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ class GetiProject extends Project {

return !checks.contains(false);
}

@override

Check warning on line 320 in lib/project.dart

View check run for this annotation

Codecov / codecov/patch

lib/project.dart#L320

Added line #L320 was not covered by tests
int get hashCode{
return Object.hash(
id,
const ListEquality().hash(tasks.map((m) => m.id).toList()),

Check warning on line 324 in lib/project.dart

View check run for this annotation

Codecov / codecov/patch

lib/project.dart#L322-L324

Added lines #L322 - L324 were not covered by tests
);
}
}

class PublicProject extends Project {
Expand Down
1 change: 0 additions & 1 deletion lib/providers/vlm_inference_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// SPDX-License-Identifier: Apache-2.0

import 'dart:async';
import 'dart:isolate';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:fluent_ui/fluent_ui.dart';
Expand Down
2 changes: 0 additions & 2 deletions lib/widgets/controls/drop_area.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class _DropAreaState extends State<DropArea> {

@override
Widget build(BuildContext context) {
final theme = FluentTheme.of(context);

return DropTarget(
onDragDone: handleDrop,
onDragExited: (_) => hideReleaseMessage(),
Expand Down
8 changes: 4 additions & 4 deletions lib/widgets/toolbar_text_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class _ToolbarTextInputState extends State<ToolbarTextInput> {
if (!_focusNode.hasFocus) {
// When the TextBox loses focus, round and update
final inputValue = int.tryParse(_controller.text.replaceAll(RegExp(r'[^0-9]'), '')) ?? 0;
// final rounded = _nearestPowerOfTwo(inputValue);
//
// _controller.text = rounded.toString();
widget.onChanged!(inputValue);
final rounded = _nearestPowerOfTwo(inputValue);

_controller.text = rounded.toString();
widget.onChanged!(rounded);

}
}
Expand Down

0 comments on commit 2d99e21

Please sign in to comment.