From 35e9920b516440ece0f2ed47f747ce7874b9ee2a Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Wed, 13 Mar 2024 14:34:51 +0600 Subject: [PATCH] chore: add riverpod lint --- analysis_options.yaml | 2 ++ lib/main.dart | 29 ++++++++++---------- pubspec.lock | 64 +++++++++++++++++++++++++++++++++++++++++++ pubspec.yaml | 2 ++ 4 files changed, 83 insertions(+), 14 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 5f2cbbe1..748fc015 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -34,3 +34,5 @@ analyzer: - patterns errors: invalid_annotation_target: ignore + plugins: + - custom_lint diff --git a/lib/main.dart b/lib/main.dart index 01e418dd..3281f85f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,6 +8,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_desktop_tools/flutter_desktop_tools.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:hive/hive.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:media_kit/media_kit.dart'; @@ -135,21 +136,21 @@ Future main(List rawArgs) async { ), runAppFunction: () { runApp( - DevicePreview( - availableLocales: L10n.all, - enabled: false, - data: const DevicePreviewData( - isEnabled: false, - orientation: Orientation.portrait, - ), - builder: (context) { - return ProviderScope( - child: QueryClientProvider( + ProviderScope( + child: DevicePreview( + availableLocales: L10n.all, + enabled: false, + data: const DevicePreviewData( + isEnabled: false, + orientation: Orientation.portrait, + ), + builder: (context) { + return QueryClientProvider( staleDuration: const Duration(minutes: 30), child: const Spotube(), - ), - ); - }, + ); + }, + ), ), ); }, @@ -157,7 +158,7 @@ Future main(List rawArgs) async { } class Spotube extends StatefulHookConsumerWidget { - const Spotube({Key? key}) : super(key: key); + const Spotube({super.key}); @override SpotubeState createState() => SpotubeState(); diff --git a/pubspec.lock b/pubspec.lock index cc69663d..4485b118 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -17,6 +17,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.13.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: c1d5f167683de03d5ab6c3b53fc9aeefc5d59476e7810ba7bbddff50c6f4392d + url: "https://pub.dev" + source: hosted + version: "0.11.2" ansicolor: dependency: transitive description: @@ -313,6 +321,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" cli_util: dependency: transitive description: @@ -401,6 +417,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.3" + custom_lint: + dependency: "direct dev" + description: + name: custom_lint + sha256: "22bd87a362f433ba6aae127a7bac2838645270737f3721b180916d7c5946cb5d" + url: "https://pub.dev" + source: hosted + version: "0.5.11" + custom_lint_builder: + dependency: transitive + description: + name: custom_lint_builder + sha256: "0d48e002438950f9582e574ef806b2bea5719d8d14c0f9f754fbad729bcf3b19" + url: "https://pub.dev" + source: hosted + version: "0.5.14" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "2952837953022de610dacb464f045594854ced6506ac7f76af28d4a6490e189b" + url: "https://pub.dev" + source: hosted + version: "0.5.14" dart_des: dependency: transitive description: @@ -1098,6 +1138,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.10" + hotreloader: + dependency: transitive + description: + name: hotreloader + sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e + url: "https://pub.dev" + source: hosted + version: "4.2.0" html: dependency: "direct main" description: @@ -1752,6 +1800,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.5.0" + riverpod_analyzer_utils: + dependency: transitive + description: + name: riverpod_analyzer_utils + sha256: d72d7096964baf288b55619fe48100001fc4564ab7923ed0a7f5c7650e03c0d6 + url: "https://pub.dev" + source: hosted + version: "0.3.4" + riverpod_lint: + dependency: "direct dev" + description: + name: riverpod_lint + sha256: "70198738c3047ae4f6517ef1a2011a8514a980a52576c7f629a3a08810319a02" + url: "https://pub.dev" + source: hosted + version: "2.1.1" rxdart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 04d3f1a4..e055c9d7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -143,6 +143,8 @@ dev_dependencies: pub_api_client: ^2.4.0 pubspec_parse: ^1.2.2 freezed: ^2.4.6 + custom_lint: ^0.5.11 + riverpod_lint: ^2.1.1 dependency_overrides: system_tray: 2.0.2