style: Migrate to very_good_analysis

This commit is contained in:
PapaTutuWawa 2022-07-27 22:13:33 +02:00
parent 288aae97f2
commit bfeb9858e3
4 changed files with 20 additions and 24 deletions

View File

@ -1,4 +1,8 @@
include: package:flutter_lints/flutter.yaml include: package:very_good_analysis/analysis_options.yaml
linter:
# Additional information about this file can be found at rules:
# https://dart.dev/guides/language/analysis-options public_member_api_docs: false
lines_longer_than_80_chars: false
use_setters_to_change_properties: false
avoid_positional_boolean_parameters: false
avoid_bool_literals_in_conditional_expressions: false

View File

@ -1,6 +1,6 @@
// ignore_for_file: avoid_print
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:moxdns/moxdns.dart';
import "package:moxdns/moxdns.dart";
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
@ -50,8 +50,6 @@ class MyHomePage extends StatefulWidget {
} }
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
Future<void> _query() async { Future<void> _query() async {
final results = await MoxdnsPlugin.srvQuery("_xmpps-client._tcp.polynom.me", false); final results = await MoxdnsPlugin.srvQuery("_xmpps-client._tcp.polynom.me", false);
for (final r in results) { for (final r in results) {
@ -100,7 +98,7 @@ class _MyHomePageState extends State<MyHomePage> {
'You have pushed the button this many times:', 'You have pushed the button this many times:',
), ),
Text( Text(
'$_counter', '0',
style: Theme.of(context).textTheme.headline4, style: Theme.of(context).textTheme.headline4,
), ),
], ],

View File

@ -1,6 +1,5 @@
import "package:moxdns_platform_interface/moxdns_platform_interface.dart"; import 'package:moxdns_platform_interface/moxdns_platform_interface.dart';
export 'package:moxdns_platform_interface/moxdns_platform_interface.dart' show SrvRecord;
export "package:moxdns_platform_interface/moxdns_platform_interface.dart" show SrvRecord;
class MoxdnsStubPlugin extends MoxdnsPlatform { class MoxdnsStubPlugin extends MoxdnsPlatform {
@override @override
@ -8,17 +7,11 @@ class MoxdnsStubPlugin extends MoxdnsPlatform {
} }
abstract class MoxdnsPlugin { abstract class MoxdnsPlugin {
static MoxdnsPlatform _platform = MoxdnsStubPlugin(); static MoxdnsPlatform platform = MoxdnsStubPlugin();
static MoxdnsPlatform get platform => _platform;
static set platform(MoxdnsPlatform platform) {
_platform = platform;
}
/// Perform a DNS SRV query for [domain], optionally using DNSSEC if [dnssec] is true. /// Perform a DNS SRV query for [domain], optionally using DNSSEC if [dnssec] is true.
/// The order of the results is abitrary. /// The order of the results is abitrary.
static Future<List<SrvRecord>> srvQuery(String domain, bool dnssec) async { static Future<List<SrvRecord>> srvQuery(String domain, bool dnssec) async {
return await platform.srvQuery(domain, dnssec); return platform.srvQuery(domain, dnssec);
} }
} }

View File

@ -20,17 +20,18 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
moxdns_platform_interface:
hosted: https://pub.polynom.me
version: 0.1.1
moxdns_android: moxdns_android:
hosted: https://pub.polynom.me hosted: https://pub.polynom.me
version: 0.1.1 version: 0.1.1
moxdns_linux: moxdns_linux:
hosted: https://pub.polynom.me hosted: https://pub.polynom.me
version: 0.1.1 version: 0.1.1
moxdns_platform_interface:
hosted: https://pub.polynom.me
version: 0.1.1
dev_dependencies: dev_dependencies:
flutter_lints: ^2.0.0
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^2.0.0 very_good_analysis: 2.4.0