mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-26 00:29:20 +08:00
Enable unnecessary_const
This commit is contained in:
@ -105,7 +105,7 @@ linter:
|
||||
- type_init_formals
|
||||
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
|
||||
- unnecessary_brace_in_string_interps
|
||||
# - unnecessary_const
|
||||
- unnecessary_const
|
||||
- unnecessary_getters_setters
|
||||
- unnecessary_lambdas
|
||||
- unnecessary_new
|
||||
|
@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:flutter_crashlytics/flutter_crashlytics.dart';
|
||||
|
||||
const _platform = const MethodChannel('gitjournal.io/git');
|
||||
const _platform = MethodChannel('gitjournal.io/git');
|
||||
|
||||
bool shouldIgnorePlatformException(PlatformException ex) {
|
||||
var msg = ex.message.toLowerCase();
|
||||
|
@ -40,12 +40,12 @@ class GitHostRepo {
|
||||
}
|
||||
|
||||
class GitHostException implements Exception {
|
||||
static const OAuthFailed = const GitHostException("OAuthFailed");
|
||||
static const MissingAccessCode = const GitHostException("MissingAccessCode");
|
||||
static const RepoExists = const GitHostException("RepoExists");
|
||||
static const CreateRepoFailed = const GitHostException("CreateRepoFailed");
|
||||
static const DeployKeyFailed = const GitHostException("DeployKeyFailed");
|
||||
static const GetRepoFailed = const GitHostException("GetRepoFailed");
|
||||
static const OAuthFailed = GitHostException("OAuthFailed");
|
||||
static const MissingAccessCode = GitHostException("MissingAccessCode");
|
||||
static const RepoExists = GitHostException("RepoExists");
|
||||
static const CreateRepoFailed = GitHostException("CreateRepoFailed");
|
||||
static const DeployKeyFailed = GitHostException("DeployKeyFailed");
|
||||
static const GetRepoFailed = GitHostException("GetRepoFailed");
|
||||
|
||||
final String cause;
|
||||
const GitHostException(this.cause);
|
||||
|
@ -25,7 +25,7 @@ Future<String> getVersionString() async {
|
||||
|
||||
Future<bool> shouldEnableAnalytics() async {
|
||||
try {
|
||||
const _platform = const MethodChannel('gitjournal.io/git');
|
||||
const _platform = MethodChannel('gitjournal.io/git');
|
||||
final bool result = await _platform.invokeMethod('shouldEnableAnalytics');
|
||||
return result;
|
||||
} on MissingPluginException catch (e) {
|
||||
@ -37,7 +37,7 @@ Future<bool> shouldEnableAnalytics() async {
|
||||
/// adb logcat
|
||||
/// Returns the file path where the logs were dumped
|
||||
Future<String> dumpAppLogs() async {
|
||||
const _platform = const MethodChannel('gitjournal.io/git');
|
||||
const _platform = MethodChannel('gitjournal.io/git');
|
||||
final String logsFilePath = await _platform.invokeMethod('dumpAppLogs');
|
||||
return logsFilePath;
|
||||
}
|
||||
|
Reference in New Issue
Block a user