Enable unnecessary_const

This commit is contained in:
Vishesh Handa
2019-10-20 01:15:58 +01:00
parent ffc0af12a3
commit e7b05d7231
4 changed files with 10 additions and 10 deletions

View File

@ -105,7 +105,7 @@ linter:
- type_init_formals - type_init_formals
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793 # - unawaited_futures # https://github.com/flutter/flutter/issues/5793
- unnecessary_brace_in_string_interps - unnecessary_brace_in_string_interps
# - unnecessary_const - unnecessary_const
- unnecessary_getters_setters - unnecessary_getters_setters
- unnecessary_lambdas - unnecessary_lambdas
- unnecessary_new - unnecessary_new

View File

@ -7,7 +7,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_crashlytics/flutter_crashlytics.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) { bool shouldIgnorePlatformException(PlatformException ex) {
var msg = ex.message.toLowerCase(); var msg = ex.message.toLowerCase();

View File

@ -40,12 +40,12 @@ class GitHostRepo {
} }
class GitHostException implements Exception { class GitHostException implements Exception {
static const OAuthFailed = const GitHostException("OAuthFailed"); static const OAuthFailed = GitHostException("OAuthFailed");
static const MissingAccessCode = const GitHostException("MissingAccessCode"); static const MissingAccessCode = GitHostException("MissingAccessCode");
static const RepoExists = const GitHostException("RepoExists"); static const RepoExists = GitHostException("RepoExists");
static const CreateRepoFailed = const GitHostException("CreateRepoFailed"); static const CreateRepoFailed = GitHostException("CreateRepoFailed");
static const DeployKeyFailed = const GitHostException("DeployKeyFailed"); static const DeployKeyFailed = GitHostException("DeployKeyFailed");
static const GetRepoFailed = const GitHostException("GetRepoFailed"); static const GetRepoFailed = GitHostException("GetRepoFailed");
final String cause; final String cause;
const GitHostException(this.cause); const GitHostException(this.cause);

View File

@ -25,7 +25,7 @@ Future<String> getVersionString() async {
Future<bool> shouldEnableAnalytics() async { Future<bool> shouldEnableAnalytics() async {
try { try {
const _platform = const MethodChannel('gitjournal.io/git'); const _platform = MethodChannel('gitjournal.io/git');
final bool result = await _platform.invokeMethod('shouldEnableAnalytics'); final bool result = await _platform.invokeMethod('shouldEnableAnalytics');
return result; return result;
} on MissingPluginException catch (e) { } on MissingPluginException catch (e) {
@ -37,7 +37,7 @@ Future<bool> shouldEnableAnalytics() async {
/// adb logcat /// adb logcat
/// Returns the file path where the logs were dumped /// Returns the file path where the logs were dumped
Future<String> dumpAppLogs() async { Future<String> dumpAppLogs() async {
const _platform = const MethodChannel('gitjournal.io/git'); const _platform = MethodChannel('gitjournal.io/git');
final String logsFilePath = await _platform.invokeMethod('dumpAppLogs'); final String logsFilePath = await _platform.invokeMethod('dumpAppLogs');
return logsFilePath; return logsFilePath;
} }