diff --git a/lib/main.dart b/lib/main.dart index eda265a8..61cb284f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -127,23 +127,23 @@ class _MyAppState extends State with WindowListener { final auth = context.read(); if (auth.isAuthenticated) { context.read().dispatch( - AppShortcutAction.newSession, - ); + AppShortcutAction.newSession, + ); } }, onRefresh: () { final auth = context.read(); if (auth.isAuthenticated) { context.read().fetchSessions( - auth.client, - authToken: auth.token, - force: true, - ); + auth.client, + authToken: auth.token, + force: true, + ); context.read().fetchSources( - auth.client, - authToken: auth.token, - force: true, - ); + auth.client, + authToken: auth.token, + force: true, + ); } }, ); diff --git a/lib/models/activity.dart b/lib/models/activity.dart index 40451613..3426950e 100644 --- a/lib/models/activity.dart +++ b/lib/models/activity.dart @@ -24,11 +24,11 @@ class PlanStep { } Map toJson() => { - 'id': id, - 'title': title, - 'description': description, - 'index': index, - }; + 'id': id, + 'title': title, + 'description': description, + 'index': index, + }; } class Plan { @@ -52,10 +52,10 @@ class Plan { } Map toJson() => { - 'id': id, - 'steps': steps.map((e) => e.toJson()).toList(), - 'createTime': createTime, - }; + 'id': id, + 'steps': steps.map((e) => e.toJson()).toList(), + 'createTime': createTime, + }; } class AgentMessaged { @@ -78,8 +78,8 @@ class PlanGenerated { final Plan plan; PlanGenerated({required this.plan}); factory PlanGenerated.fromJson(Map json) => PlanGenerated( - plan: getObjectFunctionPropOrThrow(json, 'plan', Plan.fromJson), - ); + plan: getObjectFunctionPropOrThrow(json, 'plan', Plan.fromJson), + ); Map toJson() => {'plan': plan.toJson()}; } @@ -144,10 +144,10 @@ class GitPatch { } Map toJson() => { - 'unidiffPatch': unidiffPatch, - 'baseCommitId': baseCommitId, - 'suggestedCommitMessage': suggestedCommitMessage, - }; + 'unidiffPatch': unidiffPatch, + 'baseCommitId': baseCommitId, + 'suggestedCommitMessage': suggestedCommitMessage, + }; } class ChangeSet { @@ -185,15 +185,15 @@ class BashOutput { required this.exitCode, }); factory BashOutput.fromJson(Map json) => BashOutput( - command: getStringPropOrThrow(json, 'command'), - output: getStringPropOrThrow(json, 'output'), - exitCode: getNumberPropOrThrow(json, 'exitCode')!.toInt(), - ); + command: getStringPropOrThrow(json, 'command'), + output: getStringPropOrThrow(json, 'output'), + exitCode: getNumberPropOrThrow(json, 'exitCode')!.toInt(), + ); Map toJson() => { - 'command': command, - 'output': output, - 'exitCode': exitCode, - }; + 'command': command, + 'output': output, + 'exitCode': exitCode, + }; } class Artifact { diff --git a/lib/models/bulk_action.dart b/lib/models/bulk_action.dart index 01aba1e2..cdb26ea0 100644 --- a/lib/models/bulk_action.dart +++ b/lib/models/bulk_action.dart @@ -92,10 +92,10 @@ class BulkActionStep { Map toJson() => {'type': type.index, 'message': message}; factory BulkActionStep.fromJson(Map json) => BulkActionStep( - type: BulkActionType - .values[(getNumberPropOrThrow(json, 'type') as num).toInt()], - message: getStringPropOrDefault(json, 'message', null), - ); + type: BulkActionType + .values[(getNumberPropOrThrow(json, 'type') as num).toInt()], + message: getStringPropOrDefault(json, 'message', null), + ); } enum BulkTargetType { visible, filtered } diff --git a/lib/models/cache_metadata.dart b/lib/models/cache_metadata.dart index 6a9c317c..87c4533d 100644 --- a/lib/models/cache_metadata.dart +++ b/lib/models/cache_metadata.dart @@ -11,7 +11,7 @@ class CacheMetadata { final bool isWatched; final bool isHidden; final bool - hasPendingUpdates; // True if message sent but not yet fully refreshed/synced response + hasPendingUpdates; // True if message sent but not yet fully refreshed/synced response final List pendingMessages; final String? reasonForLastUnread; final List recentErrors; diff --git a/lib/models/filter_element.dart b/lib/models/filter_element.dart index a0ff0608..67b9575a 100644 --- a/lib/models/filter_element.dart +++ b/lib/models/filter_element.dart @@ -78,7 +78,7 @@ class FilterContext { final Session session; final CacheMetadata metadata; final dynamic - queueProvider; // Using dynamic to avoid hard dependency on provider + queueProvider; // Using dynamic to avoid hard dependency on provider FilterContext({ required this.session, @@ -200,9 +200,9 @@ class AndElement extends FilterElement { @override Map toJson() => { - 'type': 'and', - 'children': children.map((c) => c.toJson()).toList(), - }; + 'type': 'and', + 'children': children.map((c) => c.toJson()).toList(), + }; @override FilterState evaluate(FilterContext context) { @@ -288,9 +288,9 @@ class TimeFilterElement extends FilterElement { @override Map toJson() => { - 'type': 'time', - 'timeFilter': timeFilter.toJson(), - }; + 'type': 'time', + 'timeFilter': timeFilter.toJson(), + }; @override FilterState evaluate(FilterContext context) { @@ -332,9 +332,9 @@ class OrElement extends FilterElement { @override Map toJson() => { - 'type': 'or', - 'children': children.map((c) => c.toJson()).toList(), - }; + 'type': 'or', + 'children': children.map((c) => c.toJson()).toList(), + }; @override FilterState evaluate(FilterContext context) { @@ -416,9 +416,9 @@ class DisabledElement extends FilterElement { @override Map toJson() => { - 'type': 'disabled', - 'child': child.toJson(), - }; + 'type': 'disabled', + 'child': child.toJson(), + }; @override FilterState evaluate(FilterContext context) { @@ -462,7 +462,8 @@ class TextElement extends FilterElement { FilterState evaluate(FilterContext context) { final query = text.toLowerCase(); final session = context.session; - final matches = (session.title?.toLowerCase().contains(query) ?? false) || + final matches = + (session.title?.toLowerCase().contains(query) ?? false) || (session.name.toLowerCase().contains(query)) || (session.id.toLowerCase().contains(query)) || (session.state.toString().toLowerCase().contains(query)) || @@ -500,10 +501,10 @@ class PrStatusElement extends FilterElement { @override Map toJson() => { - 'type': 'pr_status', - 'label': label, - 'value': value, - }; + 'type': 'pr_status', + 'label': label, + 'value': value, + }; @override FilterState evaluate(FilterContext context) { @@ -541,10 +542,10 @@ class CiStatusElement extends FilterElement { @override Map toJson() => { - 'type': 'ci_status', - 'label': label, - 'value': value, - }; + 'type': 'ci_status', + 'label': label, + 'value': value, + }; @override FilterState evaluate(FilterContext context) { @@ -614,10 +615,10 @@ class LabelElement extends FilterElement { @override Map toJson() => { - 'type': 'label', - 'label': label, - 'value': value, - }; + 'type': 'label', + 'label': label, + 'value': value, + }; @override FilterState evaluate(FilterContext context) { @@ -710,10 +711,10 @@ class StatusElement extends FilterElement { @override Map toJson() => { - 'type': 'status', - 'label': label, - 'value': value, - }; + 'type': 'status', + 'label': label, + 'value': value, + }; @override FilterState evaluate(FilterContext context) { @@ -730,7 +731,8 @@ class StatusElement extends FilterElement { return FilterState.explicitOut; } - final matches = state.toString().toLowerCase() == query || + final matches = + state.toString().toLowerCase() == query || state.name.toLowerCase() == query || state.displayName.toLowerCase() == query; @@ -768,14 +770,15 @@ class SourceElement extends FilterElement { @override Map toJson() => { - 'type': 'source', - 'label': label, - 'value': value, - }; + 'type': 'source', + 'label': label, + 'value': value, + }; @override FilterState evaluate(FilterContext context) { - final matches = context.session.sourceContext?.source.toLowerCase() == + final matches = + context.session.sourceContext?.source.toLowerCase() == value.toLowerCase(); if (context.metadata.isHidden) { return matches ? FilterState.implicitOut : FilterState.explicitOut; @@ -878,10 +881,10 @@ class BranchElement extends FilterElement { @override Map toJson() => { - 'type': 'branch', - 'label': label, - 'value': value, - }; + 'type': 'branch', + 'label': label, + 'value': value, + }; @override FilterState evaluate(FilterContext context) { @@ -923,14 +926,15 @@ class TagElement extends FilterElement { @override Map toJson() => { - 'type': 'tag', - 'label': label, - 'value': value, - }; + 'type': 'tag', + 'label': label, + 'value': value, + }; @override FilterState evaluate(FilterContext context) { - final matches = context.session.tags?.any( + final matches = + context.session.tags?.any( (t) => t.toLowerCase() == value.toLowerCase(), ) ?? false; @@ -1052,7 +1056,8 @@ class HasCreatePrElement extends FilterElement { @override FilterState evaluate(FilterContext context) { final session = context.session; - final matches = (session.prStatus == null || session.prStatus!.isEmpty) && + final matches = + (session.prStatus == null || session.prStatus!.isEmpty) && (session.diffUrl != null || (session.changedFiles != null && session.changedFiles! > 0)); diff --git a/lib/models/filter_element_builder.dart b/lib/models/filter_element_builder.dart index 7a80f4fd..4387a3d5 100644 --- a/lib/models/filter_element_builder.dart +++ b/lib/models/filter_element_builder.dart @@ -268,12 +268,15 @@ class FilterElementBuilder { if (root is AndElement || root is OrElement) { final isAnd = root is AndElement; - final children = - root is AndElement ? root.children : (root as OrElement).children; + final children = root is AndElement + ? root.children + : (root as OrElement).children; // Simplify all children first - final simplifiedChildren = - children.map((c) => simplify(c)).whereType().toList(); + final simplifiedChildren = children + .map((c) => simplify(c)) + .whereType() + .toList(); if (simplifiedChildren.isEmpty) return null; if (simplifiedChildren.length == 1) return simplifiedChildren.first; @@ -455,8 +458,9 @@ class FilterElementBuilder { }) { if (root == null) return root; - final group = - isAnd ? AndElement([target, source]) : OrElement([target, source]); + final group = isAnd + ? AndElement([target, source]) + : OrElement([target, source]); // If source is already in the tree (Move operation), remove it first // Note: This logic assumes we handle 'move' by removing source first at the UI level or prior to calling this if needed. diff --git a/lib/models/filter_expression_parser.dart b/lib/models/filter_expression_parser.dart index d18d8284..3af419ce 100644 --- a/lib/models/filter_expression_parser.dart +++ b/lib/models/filter_expression_parser.dart @@ -73,7 +73,8 @@ class FilterExpressionParser { _skipWhitespace(); final upperName = name.toUpperCase(); - final isComposite = upperName == 'AND' || + final isComposite = + upperName == 'AND' || upperName == 'OR' || upperName == 'NOT' || upperName == 'DISABLED'; @@ -123,8 +124,8 @@ class FilterExpressionParser { String _readIdentifier() { final start = pos; - while ( - pos < input.length && RegExp(r'[a-zA-Z0-9_\.]').hasMatch(input[pos])) { + while (pos < input.length && + RegExp(r'[a-zA-Z0-9_\.]').hasMatch(input[pos])) { pos++; } return input.substring(start, pos); diff --git a/lib/models/github_exclusion.dart b/lib/models/github_exclusion.dart index 53ad3baa..eaff9581 100644 --- a/lib/models/github_exclusion.dart +++ b/lib/models/github_exclusion.dart @@ -16,11 +16,11 @@ class GithubExclusion { }); Map toJson() => { - 'type': type.toString().split('.').last, - 'value': value, - 'reason': reason, - 'date': date.toIso8601String(), - }; + 'type': type.toString().split('.').last, + 'value': value, + 'reason': reason, + 'date': date.toIso8601String(), + }; factory GithubExclusion.fromJson(Map json) { return GithubExclusion( diff --git a/lib/models/media.dart b/lib/models/media.dart index 3ccbc72e..b6f3a199 100644 --- a/lib/models/media.dart +++ b/lib/models/media.dart @@ -5,8 +5,8 @@ class Media { final String mimeType; Media({required this.data, required this.mimeType}); factory Media.fromJson(Map json) => Media( - data: getStringPropOrThrow(json, 'data'), - mimeType: getStringPropOrThrow(json, 'mimeType'), - ); + data: getStringPropOrThrow(json, 'data'), + mimeType: getStringPropOrThrow(json, 'mimeType'), + ); Map toJson() => {'data': data, 'mimeType': mimeType}; } diff --git a/lib/models/queued_message.dart b/lib/models/queued_message.dart index 868f3e3e..80ac3b59 100644 --- a/lib/models/queued_message.dart +++ b/lib/models/queued_message.dart @@ -79,7 +79,8 @@ class QueuedMessage { )!, metadata: json['metadata'] as Map?, queueReason: getStringPropOrDefault(json, 'queueReason', null), - processingErrors: (json['processingErrors'] as List?) + processingErrors: + (json['processingErrors'] as List?) ?.map((e) => e.toString()) .toList() ?? [], diff --git a/lib/models/refresh_schedule.dart b/lib/models/refresh_schedule.dart index 2770217c..898e78dc 100644 --- a/lib/models/refresh_schedule.dart +++ b/lib/models/refresh_schedule.dart @@ -45,11 +45,12 @@ class RefreshSchedule { intervalInMinutes: (getNumberPropOrThrow(json, 'intervalInMinutes') as num).toInt(), isEnabled: getBooleanPropOrDefault(json, 'isEnabled', true), - taskType: RefreshTaskType.values[getNumberPropOrDefault( - json, - 'taskType', - RefreshTaskType.refresh.index, - ).toInt()], + taskType: + RefreshTaskType.values[getNumberPropOrDefault( + json, + 'taskType', + RefreshTaskType.refresh.index, + ).toInt()], refreshPolicy: refreshPolicyIndex != null ? ListRefreshPolicy.values[refreshPolicyIndex] : null, diff --git a/lib/models/scheduler_preset.dart b/lib/models/scheduler_preset.dart index 5f05d900..292877a0 100644 --- a/lib/models/scheduler_preset.dart +++ b/lib/models/scheduler_preset.dart @@ -13,38 +13,37 @@ class SchedulerPreset { }); static List get presets => [ - const SchedulerPreset( - name: 'Standard', - description: 'Default balanced configuration for regular usage.', - schedulesFactory: _createStandardSchedules, - ), - const SchedulerPreset( - name: 'Battery Saver', - description: 'Reduces refresh frequency to save power.', - schedulesFactory: _createBatterySaverSchedules, - ), - const SchedulerPreset( - name: 'Hourly', - description: 'Refreshes data every hour.', - schedulesFactory: _createHourlySchedules, - ), - const SchedulerPreset( - name: 'Daily', - description: 'Refreshes data only once a day.', - schedulesFactory: _createDailySchedules, - ), - const SchedulerPreset( - name: 'Aggressive', - description: 'Very frequent updates for heavy usage.', - schedulesFactory: _createAggressiveSchedules, - ), - const SchedulerPreset( - name: 'Never (Manual Only)', - description: - 'No automatic data refresh. Only sends pending messages.', - schedulesFactory: _createManualSchedules, - ), - ]; + const SchedulerPreset( + name: 'Standard', + description: 'Default balanced configuration for regular usage.', + schedulesFactory: _createStandardSchedules, + ), + const SchedulerPreset( + name: 'Battery Saver', + description: 'Reduces refresh frequency to save power.', + schedulesFactory: _createBatterySaverSchedules, + ), + const SchedulerPreset( + name: 'Hourly', + description: 'Refreshes data every hour.', + schedulesFactory: _createHourlySchedules, + ), + const SchedulerPreset( + name: 'Daily', + description: 'Refreshes data only once a day.', + schedulesFactory: _createDailySchedules, + ), + const SchedulerPreset( + name: 'Aggressive', + description: 'Very frequent updates for heavy usage.', + schedulesFactory: _createAggressiveSchedules, + ), + const SchedulerPreset( + name: 'Never (Manual Only)', + description: 'No automatic data refresh. Only sends pending messages.', + schedulesFactory: _createManualSchedules, + ), + ]; static List _createStandardSchedules() { return [ diff --git a/lib/models/search_filter.dart b/lib/models/search_filter.dart index 96afebfe..384e0744 100644 --- a/lib/models/search_filter.dart +++ b/lib/models/search_filter.dart @@ -52,8 +52,9 @@ class FilterToken { type: type, label: label, value: value, - mode: - mode == FilterMode.include ? FilterMode.exclude : FilterMode.include, + mode: mode == FilterMode.include + ? FilterMode.exclude + : FilterMode.include, ); } diff --git a/lib/models/source_group.dart b/lib/models/source_group.dart index 55fa4a79..6d3af81d 100644 --- a/lib/models/source_group.dart +++ b/lib/models/source_group.dart @@ -11,7 +11,7 @@ class SourceGroup { name: getStringPropOrThrow(json, 'name'), sourceNames: getStringArrayPropOrDefault(json, 'sourceNames', []) ?? - [], + [], ); } diff --git a/lib/models/time_filter.dart b/lib/models/time_filter.dart index 49cd9502..9583a323 100644 --- a/lib/models/time_filter.dart +++ b/lib/models/time_filter.dart @@ -38,8 +38,9 @@ class TimeFilter { return TimeFilter( type: TimeFilterType.values.byName(getStringPropOrThrow(json, 'type')), - specificTime: - specificTimeStr != null ? DateTime.parse(specificTimeStr) : null, + specificTime: specificTimeStr != null + ? DateTime.parse(specificTimeStr) + : null, specificTimeEnd: specificTimeEndStr != null ? DateTime.parse(specificTimeEndStr) : null, diff --git a/lib/services/bulk_action_executor.dart b/lib/services/bulk_action_executor.dart index 3780fc48..84160ab6 100644 --- a/lib/services/bulk_action_executor.dart +++ b/lib/services/bulk_action_executor.dart @@ -207,8 +207,9 @@ class BulkActionExecutor extends ChangeNotifier { } Future undoAll() async { - final undoableLogs = - _logs.where((l) => l.undoActionType != null && !l.isUndone).toList(); + final undoableLogs = _logs + .where((l) => l.undoActionType != null && !l.isUndone) + .toList(); if (undoableLogs.isEmpty) return; diff --git a/lib/services/bulk_action_preset_provider.dart b/lib/services/bulk_action_preset_provider.dart index f24a46aa..8f57ee40 100644 --- a/lib/services/bulk_action_preset_provider.dart +++ b/lib/services/bulk_action_preset_provider.dart @@ -50,8 +50,9 @@ class BulkActionPresetProvider with ChangeNotifier { final jsonString = prefs.getString(_presetsKey); if (jsonString != null) { final List jsonList = jsonDecode(jsonString); - _presets = - jsonList.map((json) => BulkActionPreset.fromJson(json)).toList(); + _presets = jsonList + .map((json) => BulkActionPreset.fromJson(json)) + .toList(); } else { _presets = List.from(_defaultPresets); await _savePresets(); diff --git a/lib/services/cache_service.dart b/lib/services/cache_service.dart index c5af8429..a16f47db 100644 --- a/lib/services/cache_service.dart +++ b/lib/services/cache_service.dart @@ -331,7 +331,8 @@ class CacheService { final json = jsonDecode(content); final session = Session.fromJson(json['session']); - final activities = (json['activities'] as List?) + final activities = + (json['activities'] as List?) ?.map((e) => Activity.fromJson(e)) .toList() ?? []; diff --git a/lib/services/exceptions.dart b/lib/services/exceptions.dart index 498d0774..a1928aac 100644 --- a/lib/services/exceptions.dart +++ b/lib/services/exceptions.dart @@ -40,53 +40,52 @@ class JulesException implements Exception { class InvalidTokenException extends JulesException { InvalidTokenException(String responseBody) - : super( - 'Invalid API token provided.', - statusCode: 401, - responseBody: responseBody, - ); + : super( + 'Invalid API token provided.', + statusCode: 401, + responseBody: responseBody, + ); } class PermissionDeniedException extends JulesException { PermissionDeniedException(String responseBody) - : super('Permission denied.', - statusCode: 403, responseBody: responseBody); + : super('Permission denied.', statusCode: 403, responseBody: responseBody); } class NotFoundException extends JulesException { NotFoundException(String responseBody, {String? resource}) - : super( - resource != null - ? 'Resource not found: $resource' - : 'Resource not found.', - statusCode: 404, - responseBody: responseBody, - ); + : super( + resource != null + ? 'Resource not found: $resource' + : 'Resource not found.', + statusCode: 404, + responseBody: responseBody, + ); } class ApiException extends JulesException { ApiException(int statusCode, String responseBody) - : super( - 'API error occurred.', - statusCode: statusCode, - responseBody: responseBody, - ); + : super( + 'API error occurred.', + statusCode: statusCode, + responseBody: responseBody, + ); } class ServiceUnavailableException extends JulesException { ServiceUnavailableException(String responseBody) - : super( - 'Service unavailable.', - statusCode: 503, - responseBody: responseBody, - ); + : super( + 'Service unavailable.', + statusCode: 503, + responseBody: responseBody, + ); } class RateLimitException extends JulesException { RateLimitException(String responseBody) - : super( - 'Rate limit exceeded.', - statusCode: 429, - responseBody: responseBody, - ); + : super( + 'Rate limit exceeded.', + statusCode: 429, + responseBody: responseBody, + ); } diff --git a/lib/services/filter_bookmark_provider.dart b/lib/services/filter_bookmark_provider.dart index bd575b91..ad5ef2d4 100644 --- a/lib/services/filter_bookmark_provider.dart +++ b/lib/services/filter_bookmark_provider.dart @@ -50,8 +50,9 @@ class FilterBookmarkProvider with ChangeNotifier { final jsonString = prefs.getString(_bookmarksKey); if (jsonString != null) { final List jsonList = jsonDecode(jsonString); - _bookmarks = - jsonList.map((json) => FilterBookmark.fromJson(json)).toList(); + _bookmarks = jsonList + .map((json) => FilterBookmark.fromJson(json)) + .toList(); } else { // No saved bookmarks, initialize with defaults _bookmarks = List.from(_defaultBookmarks); diff --git a/lib/services/github_provider.dart b/lib/services/github_provider.dart index 5524a207..aa60c883 100644 --- a/lib/services/github_provider.dart +++ b/lib/services/github_provider.dart @@ -71,8 +71,8 @@ class GithubProvider extends ChangeNotifier { this._cacheService, { AuthService? authService, http.Client? client, - }) : _authService = authService ?? AuthService(), - _client = client ?? http.Client() { + }) : _authService = authService ?? AuthService(), + _client = client ?? http.Client() { _loadToken(); } @@ -366,10 +366,7 @@ class GithubProvider extends ChangeNotifier { final url = Uri.parse( 'https://api.github.com/repos/$owner/$repo/pulls/$prNumber', ); - final response = await _client.get( - url, - headers: _getHeaders(token), - ); + final response = await _client.get(url, headers: _getHeaders(token)); _updateRateLimits(response.headers); @@ -642,10 +639,7 @@ class GithubProvider extends ChangeNotifier { if (token == null) throw Exception('Missing GitHub API Key'); final url = Uri.parse('https://api.github.com/repos/$owner/$repo'); - final response = await _client.get( - url, - headers: _getHeaders(token), - ); + final response = await _client.get(url, headers: _getHeaders(token)); _updateRateLimits(response.headers); @@ -856,7 +850,7 @@ class GitHubPrResponse { final Map _links; GitHubPrResponse(this._data) - : _links = _data['_links'] as Map? ?? {}; + : _links = _data['_links'] as Map? ?? {}; bool get isMerged => getBooleanPropOrDefault(_data, 'merged', false); bool get isDraft => getBooleanPropOrDefault(_data, 'draft', false); diff --git a/lib/services/global_shortcut_focus_manager.dart b/lib/services/global_shortcut_focus_manager.dart index 20fe68e7..1a5dbc5d 100644 --- a/lib/services/global_shortcut_focus_manager.dart +++ b/lib/services/global_shortcut_focus_manager.dart @@ -6,8 +6,8 @@ class GlobalShortcutFocusManager extends StatefulWidget { const GlobalShortcutFocusManager({super.key, required this.child}); static GlobalShortcutFocusManagerState of(BuildContext context) { - final state = - context.findAncestorStateOfType(); + final state = context + .findAncestorStateOfType(); if (state == null) { throw FlutterError( 'GlobalShortcutFocusManager not found in context. Wrap your app in a GlobalShortcutFocusManager.', diff --git a/lib/services/jules_client.dart b/lib/services/jules_client.dart index 854420f6..9ef1cd31 100644 --- a/lib/services/jules_client.dart +++ b/lib/services/jules_client.dart @@ -22,10 +22,10 @@ class JulesClient { }) : _client = client ?? http.Client(); Map get _headers => { - 'Content-Type': 'application/json', - if (accessToken != null) 'Authorization': 'Bearer $accessToken', - if (apiKey != null) 'X-Goog-Api-Key': apiKey!, - }; + 'Content-Type': 'application/json', + if (accessToken != null) 'Authorization': 'Bearer $accessToken', + if (apiKey != null) 'X-Goog-Api-Key': apiKey!, + }; Future _enqueueRequest(Future Function() task) { final prevRequest = _lastRequest; diff --git a/lib/services/notification_service.dart b/lib/services/notification_service.dart index be5d4d3c..ff056b0e 100644 --- a/lib/services/notification_service.dart +++ b/lib/services/notification_service.dart @@ -56,20 +56,20 @@ class NotificationService { final DarwinInitializationSettings initializationSettingsDarwin = DarwinInitializationSettings( - requestAlertPermission: true, - requestBadgePermission: true, - requestSoundPermission: true, - notificationCategories: [ - DarwinNotificationCategory( - 'jules_category', - actions: [ - DarwinNotificationAction.plain('show_task', 'Show Task'), - DarwinNotificationAction.plain('open_pr', 'Open PR'), - DarwinNotificationAction.plain('show_new', 'Show New'), + requestAlertPermission: true, + requestBadgePermission: true, + requestSoundPermission: true, + notificationCategories: [ + DarwinNotificationCategory( + 'jules_category', + actions: [ + DarwinNotificationAction.plain('show_task', 'Show Task'), + DarwinNotificationAction.plain('open_pr', 'Open PR'), + DarwinNotificationAction.plain('show_new', 'Show New'), + ], + ), ], - ), - ], - ); + ); const LinuxInitializationSettings initializationSettingsLinux = LinuxInitializationSettings(defaultActionName: 'Open notification'); @@ -84,12 +84,12 @@ class NotificationService { final InitializationSettings initializationSettings = InitializationSettings( - android: initializationSettingsAndroid, - iOS: initializationSettingsDarwin, - macOS: initializationSettingsDarwin, - linux: initializationSettingsLinux, - // windows: initializationSettingsWindows, - ); + android: initializationSettingsAndroid, + iOS: initializationSettingsDarwin, + macOS: initializationSettingsDarwin, + linux: initializationSettingsLinux, + // windows: initializationSettingsWindows, + ); await flutterLocalNotificationsPlugin.initialize( initializationSettings, @@ -197,14 +197,14 @@ class NotificationService { final AndroidNotificationDetails androidPlatformChannelSpecifics = AndroidNotificationDetails( - 'jules_channel_id', - 'Jules Notifications', - channelDescription: 'Notifications for Jules task updates', - importance: Importance.max, - priority: Priority.high, - showWhen: false, - actions: androidActions, - ); + 'jules_channel_id', + 'Jules Notifications', + channelDescription: 'Notifications for Jules task updates', + importance: Importance.max, + priority: Priority.high, + showWhen: false, + actions: androidActions, + ); final linuxActions = notification.actions?.map((action) { switch (action) { @@ -228,9 +228,9 @@ class NotificationService { const DarwinNotificationDetails darwinPlatformChannelSpecifics = DarwinNotificationDetails( - categoryIdentifier: 'jules_category', - attachments: [], - ); + categoryIdentifier: 'jules_category', + attachments: [], + ); final LinuxNotificationDetails linuxPlatformChannelSpecifics = LinuxNotificationDetails(actions: linuxActions ?? []); diff --git a/lib/services/prompt_template_provider.dart b/lib/services/prompt_template_provider.dart index 66f7223e..76b7b5f4 100644 --- a/lib/services/prompt_template_provider.dart +++ b/lib/services/prompt_template_provider.dart @@ -80,8 +80,9 @@ class PromptTemplateProvider extends ChangeNotifier { if (customJson != null) { try { final List decoded = jsonDecode(customJson); - _customTemplates = - decoded.map((j) => PromptTemplate.fromJson(j)).toList(); + _customTemplates = decoded + .map((j) => PromptTemplate.fromJson(j)) + .toList(); } catch (e) { debugPrint('Error loading custom templates: $e'); _customTemplates = []; @@ -93,8 +94,9 @@ class PromptTemplateProvider extends ChangeNotifier { if (recentJson != null) { try { final List decoded = jsonDecode(recentJson); - _recentPrompts = - decoded.map((j) => PromptTemplate.fromJson(j)).toList(); + _recentPrompts = decoded + .map((j) => PromptTemplate.fromJson(j)) + .toList(); } catch (e) { debugPrint('Error loading recent prompts: $e'); _recentPrompts = []; diff --git a/lib/services/refresh_service.dart b/lib/services/refresh_service.dart index d498e999..8213fb31 100644 --- a/lib/services/refresh_service.dart +++ b/lib/services/refresh_service.dart @@ -35,8 +35,9 @@ class RefreshService extends ChangeNotifier { this._activityProvider, this._timerService, { @visibleForTesting SessionComparator? sessionComparator, - }) : _sessionComparator = sessionComparator ?? - SessionComparator(_settingsProvider, _notificationService) { + }) : _sessionComparator = + sessionComparator ?? + SessionComparator(_settingsProvider, _notificationService) { _timerService.addListener(_onTick); } @@ -62,9 +63,11 @@ class RefreshService extends ChangeNotifier { } } - late final Map Function(RefreshSchedule, JulesClient)> - _scheduleHandlers = { + late final Map< + RefreshTaskType, + Future Function(RefreshSchedule, JulesClient) + > + _scheduleHandlers = { RefreshTaskType.refresh: _executeRefresh, RefreshTaskType.sendPendingMessages: _executeSendPendingMessages, }; @@ -210,8 +213,9 @@ class RefreshService extends ChangeNotifier { ({RefreshSchedule schedule, DateTime time})? getNextScheduledRefresh() { final now = DateTime.now(); - final schedules = - _settingsProvider.schedules.where((s) => s.isEnabled).toList(); + final schedules = _settingsProvider.schedules + .where((s) => s.isEnabled) + .toList(); if (schedules.isEmpty) return null; diff --git a/lib/services/session_provider.dart b/lib/services/session_provider.dart index d98aff69..a228ab81 100644 --- a/lib/services/session_provider.dart +++ b/lib/services/session_provider.dart @@ -528,7 +528,7 @@ class SessionProvider extends ChangeNotifier { case RuleType.stepChange: bool julesProgress = (oldSession.currentStep != newSession.currentStep) || - (oldSession.currentAction != newSession.currentAction); + (oldSession.currentAction != newSession.currentAction); if (julesProgress) { // For step changes, we currently don't support specific transitions // (e.g. step 1 -> step 2), so we treat it as "Any change". @@ -711,8 +711,9 @@ class SessionProvider extends ChangeNotifier { notifyListeners(); try { - final watchedItems = - _items.where((item) => item.metadata.isWatched).toList(); + final watchedItems = _items + .where((item) => item.metadata.isWatched) + .toList(); await Future.wait( watchedItems.map((item) async { try { @@ -988,8 +989,9 @@ class SessionProvider extends ChangeNotifier { } // Get PR URL from session - final pr = - session.outputs!.firstWhere((o) => o.pullRequest != null).pullRequest!; + final pr = session.outputs! + .firstWhere((o) => o.pullRequest != null) + .pullRequest!; // Extract owner, repo, and PR number from URL // URL format: https://github.com/owner/repo/pull/123 diff --git a/lib/services/settings_provider.dart b/lib/services/settings_provider.dart index 3e8c3bcf..1815dd7b 100644 --- a/lib/services/settings_provider.dart +++ b/lib/services/settings_provider.dart @@ -315,8 +315,9 @@ class SettingsProvider extends ChangeNotifier { if (jsonString != null) { try { final List decodedList = jsonDecode(jsonString); - _schedules = - decodedList.map((json) => RefreshSchedule.fromJson(json)).toList(); + _schedules = decodedList + .map((json) => RefreshSchedule.fromJson(json)) + .toList(); } catch (e) { _schedules = _defaultSchedules(); } @@ -509,8 +510,9 @@ class SettingsProvider extends ChangeNotifier { if (jsonString != null) { try { final List decodedList = jsonDecode(jsonString); - _unreadRules = - decodedList.map((json) => UnreadRule.fromJson(json)).toList(); + _unreadRules = decodedList + .map((json) => UnreadRule.fromJson(json)) + .toList(); } catch (e) { _unreadRules = _defaultUnreadRules(); } @@ -728,8 +730,9 @@ class SettingsProvider extends ChangeNotifier { if (jsonString != null) { try { final List decodedList = jsonDecode(jsonString); - _githubExclusions = - decodedList.map((json) => GithubExclusion.fromJson(json)).toList(); + _githubExclusions = decodedList + .map((json) => GithubExclusion.fromJson(json)) + .toList(); } catch (e) { _githubExclusions = []; } @@ -809,8 +812,9 @@ class SettingsProvider extends ChangeNotifier { if (jsonString != null) { try { final List decodedList = jsonDecode(jsonString); - _sourceGroups = - decodedList.map((json) => SourceGroup.fromJson(json)).toList(); + _sourceGroups = decodedList + .map((json) => SourceGroup.fromJson(json)) + .toList(); } catch (e) { _sourceGroups = []; } diff --git a/lib/services/source_provider.dart b/lib/services/source_provider.dart index c027ad9c..f66a2aef 100644 --- a/lib/services/source_provider.dart +++ b/lib/services/source_provider.dart @@ -159,24 +159,26 @@ class SourceProvider extends ChangeNotifier { source.githubRepo!.repo, ); - job.completer.future.then((_) { - _pendingGithubRefreshes--; - if (job.status == GithubJobStatus.completed) { - final details = job.result as Map?; - if (details != null) { - _updateSourceWithGithubDetails( - source.name, - details, - authToken, - ); - } - } - notifyListeners(); - }).catchError((err) { - _pendingGithubRefreshes--; - _appendError(source.name, 'GitHub Refresh: $err'); - notifyListeners(); - }); + job.completer.future + .then((_) { + _pendingGithubRefreshes--; + if (job.status == GithubJobStatus.completed) { + final details = job.result as Map?; + if (details != null) { + _updateSourceWithGithubDetails( + source.name, + details, + authToken, + ); + } + } + notifyListeners(); + }) + .catchError((err) { + _pendingGithubRefreshes--; + _appendError(source.name, 'GitHub Refresh: $err'); + notifyListeners(); + }); githubProvider.enqueue(job); } diff --git a/lib/ui/app_container.dart b/lib/ui/app_container.dart index 3b267294..a2504e52 100644 --- a/lib/ui/app_container.dart +++ b/lib/ui/app_container.dart @@ -44,8 +44,11 @@ class AppContainer extends StatelessWidget { update: (_, devMode, __) => CacheService(isDevMode: devMode.isDevMode), ), - ChangeNotifierProxyProvider2( + ChangeNotifierProxyProvider2< + SettingsProvider, + CacheService, + GithubProvider + >( create: (context) => GithubProvider( context.read(), context.read(), @@ -55,8 +58,13 @@ class AppContainer extends StatelessWidget { ChangeNotifierProvider(create: (_) => FilterBookmarkProvider()), ChangeNotifierProvider(create: (_) => BulkActionPresetProvider()), ChangeNotifierProvider(create: (_) => PromptTemplateProvider()..init()), - ChangeNotifierProxyProvider4( + ChangeNotifierProxyProvider4< + CacheService, + GithubProvider, + NotificationProvider, + SettingsProvider, + SessionProvider + >( create: (_) => SessionProvider(), update: (_, cache, github, notifications, settings, session) => session! @@ -69,20 +77,24 @@ class AppContainer extends StatelessWidget { create: (_) => SourceProvider(), update: (_, cache, source) => source!..setCacheService(cache), ), - ChangeNotifierProxyProvider2( + ChangeNotifierProxyProvider2< + CacheService, + AuthProvider, + MessageQueueProvider + >( create: (_) => MessageQueueProvider(), update: (_, cache, auth, queue) => queue!..setCacheService(cache, auth.token), ), ChangeNotifierProxyProvider6< - SettingsProvider, - SessionProvider, - SourceProvider, - NotificationService, - MessageQueueProvider, - ActivityProvider, - RefreshService>( + SettingsProvider, + SessionProvider, + SourceProvider, + NotificationService, + MessageQueueProvider, + ActivityProvider, + RefreshService + >( create: (context) => RefreshService( context.read(), context.read(), @@ -93,20 +105,25 @@ class AppContainer extends StatelessWidget { context.read(), context.read(), ), - update: ( - _, - settings, - sessionProvider, - sourceProvider, - notificationService, - messageQueueProvider, - activityProvider, - service, - ) => - service!, + update: + ( + _, + settings, + sessionProvider, + sourceProvider, + notificationService, + messageQueueProvider, + activityProvider, + service, + ) => service!, ), - ChangeNotifierProxyProvider4( + ChangeNotifierProxyProvider4< + SessionProvider, + AuthProvider, + GithubProvider, + SettingsProvider, + BulkActionExecutor + >( create: (context) => BulkActionExecutor( sessionProvider: context.read(), julesClient: context.read().client, diff --git a/lib/ui/screens/bookmark_manager_screen.dart b/lib/ui/screens/bookmark_manager_screen.dart index e31f066c..ce3db581 100644 --- a/lib/ui/screens/bookmark_manager_screen.dart +++ b/lib/ui/screens/bookmark_manager_screen.dart @@ -55,11 +55,13 @@ class _BookmarkManagerScreenState extends State { }).toList(); // 2. Restorable System Bookmarks - final restorableBookmarks = - provider.getRestorableSystemBookmarks().where((b) { - if (_searchQuery.isEmpty) return true; - return b.name.toLowerCase().contains(_searchQuery); - }).toList(); + final restorableBookmarks = provider + .getRestorableSystemBookmarks() + .where((b) { + if (_searchQuery.isEmpty) return true; + return b.name.toLowerCase().contains(_searchQuery); + }) + .toList(); return Column( children: [ @@ -271,7 +273,8 @@ class _BookmarkManagerScreenState extends State { } void _showBookmarkEditor(BuildContext context, FilterBookmark? existing) { - final isSystem = existing != null && + final isSystem = + existing != null && context.read().isSystemBookmark(existing.name); showDialog( @@ -299,8 +302,8 @@ class _BookmarkManagerScreenState extends State { style: FilledButton.styleFrom(backgroundColor: Colors.red), onPressed: () { context.read().deleteBookmark( - bookmark.name, - ); + bookmark.name, + ); Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text('Preset "${bookmark.name}" deleted')), @@ -339,9 +342,9 @@ class _BookmarkManagerScreenState extends State { final newName = nameController.text.trim(); if (newName.isNotEmpty) { await context.read().copyBookmark( - bookmark.name, - newName, - ); + bookmark.name, + newName, + ); if (context.mounted) { Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( @@ -486,9 +489,9 @@ class _BookmarkManagerScreenState extends State { try { await context.read().importFromJson( - jsonString, - merge: merge, - ); + jsonString, + merge: merge, + ); if (dialogContext.mounted) { Navigator.pop(dialogContext); diff --git a/lib/ui/screens/bulk_action_preset_manager_screen.dart b/lib/ui/screens/bulk_action_preset_manager_screen.dart index e85ad148..efe53107 100644 --- a/lib/ui/screens/bulk_action_preset_manager_screen.dart +++ b/lib/ui/screens/bulk_action_preset_manager_screen.dart @@ -200,7 +200,8 @@ class _BulkActionPresetManagerScreenState } void _showPresetEditor(BuildContext context, BulkActionPreset? existing) { - final isSystem = existing != null && + final isSystem = + existing != null && context.read().isSystemPreset(existing.name); showDialog( @@ -225,8 +226,8 @@ class _BulkActionPresetManagerScreenState style: FilledButton.styleFrom(backgroundColor: Colors.red), onPressed: () { context.read().deletePreset( - preset.name, - ); + preset.name, + ); Navigator.pop(context); ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text('Preset "${preset.name}" deleted')), @@ -362,9 +363,9 @@ class _BulkActionPresetManagerScreenState try { await context.read().importFromJson( - jsonString, - merge: merge, - ); + jsonString, + merge: merge, + ); if (dialogContext.mounted) { Navigator.pop(dialogContext); diff --git a/lib/ui/screens/login_screen.dart b/lib/ui/screens/login_screen.dart index 0909c4c4..cff19a78 100644 --- a/lib/ui/screens/login_screen.dart +++ b/lib/ui/screens/login_screen.dart @@ -66,8 +66,9 @@ class _LoginScreenState extends State { return TextFormField( controller: _tokenController, decoration: InputDecoration( - labelText: - _selectedType == TokenType.apiKey ? 'API Key' : 'Access Token', + labelText: _selectedType == TokenType.apiKey + ? 'API Key' + : 'Access Token', border: const OutlineInputBorder(), hintText: _selectedType == TokenType.apiKey ? 'Enter your API Key' diff --git a/lib/ui/screens/session_detail_screen.dart b/lib/ui/screens/session_detail_screen.dart index 0f66ce52..b9c8f8fc 100644 --- a/lib/ui/screens/session_detail_screen.dart +++ b/lib/ui/screens/session_detail_screen.dart @@ -333,8 +333,9 @@ class _SessionDetailScreenState extends State { // If we fetched new ones, merge. if (shallow && _activities.isNotEmpty) { final newIds = activities.map((a) => a.id).toSet(); - final oldUnique = - _activities.where((a) => !newIds.contains(a.id)).toList(); + final oldUnique = _activities + .where((a) => !newIds.contains(a.id)) + .toList(); // Combine and Sort _activities = [...activities, ...oldUnique]; @@ -571,8 +572,9 @@ class _SessionDetailScreenState extends State { message, reason: 'resource_not_found', processingErrors: [e.message], - metadata: - e.responseBody != null ? {'responseBody': e.responseBody} : null, + metadata: e.responseBody != null + ? {'responseBody': e.responseBody} + : null, ); handled = true; } @@ -765,14 +767,14 @@ class _SessionDetailScreenState extends State { (_session.note?.content.isEmpty ?? true) ? Icons.note_add_outlined : _isNoteVisible - ? Icons.speaker_notes_off_outlined - : Icons.speaker_notes_outlined, + ? Icons.speaker_notes_off_outlined + : Icons.speaker_notes_outlined, ), tooltip: (_session.note?.content.isEmpty ?? true) ? 'Add Note' : _isNoteVisible - ? 'Hide Note' - : 'View Note', + ? 'Hide Note' + : 'View Note', onPressed: _toggleNoteVisibility, ), IconButton( @@ -866,8 +868,9 @@ class _SessionDetailScreenState extends State { : const Icon(Icons.refresh), // Disable/Gray out while "busy" (min 2s or until completion) // Also blockout if any other network op is running - onPressed: - (_isRefreshDisabled || _busyCount > 0) ? null : _handleRefresh, + onPressed: (_isRefreshDisabled || _busyCount > 0) + ? null + : _handleRefresh, tooltip: 'Refresh', ); }, @@ -1174,8 +1177,8 @@ class _SessionDetailScreenState extends State { (_session.note?.content.isEmpty ?? true) ? Icons.note_add_outlined : (_isNoteVisible - ? Icons.speaker_notes_off_outlined - : Icons.speaker_notes_outlined), + ? Icons.speaker_notes_off_outlined + : Icons.speaker_notes_outlined), color: Colors.grey, ), const SizedBox(width: 8), @@ -1288,7 +1291,8 @@ class _SessionDetailScreenState extends State { ); } - bool hasPr = _session.outputs != null && + bool hasPr = + _session.outputs != null && _session.outputs!.any((o) => o.pullRequest != null); final bool showJulesNotice = @@ -1300,8 +1304,9 @@ class _SessionDetailScreenState extends State { // Merge queued messages final queueProvider = Provider.of(context); - final queuedMessages = - queueProvider.queue.where((m) => m.sessionId == _session.id).toList(); + final queuedMessages = queueProvider.queue + .where((m) => m.sessionId == _session.id) + .toList(); // Merge pending messages (Optimistic updates) final sessionProvider = Provider.of(context); @@ -1395,7 +1400,8 @@ class _SessionDetailScreenState extends State { return ListView.builder( reverse: true, // Start at bottom, visual index 0 is bottom - itemCount: finalItems.length + + itemCount: + finalItems.length + (hasPr ? 2 : 0) + (showJulesNotice ? 2 : 0) + 1, // +1 for Last Updated Status @@ -1412,11 +1418,10 @@ class _SessionDetailScreenState extends State { ? "Last updated: ${DateFormat.Hms().format(updateTime)} (${timeAgo(updateTime)}) - $_loadingStatus" : "Last updated: ${DateFormat.Hms().format(updateTime)} (${timeAgo(updateTime)})", style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: - DateTime.now().difference(updateTime).inMinutes > 15 - ? Colors.orange - : Colors.grey, - ), + color: DateTime.now().difference(updateTime).inMinutes > 15 + ? Colors.orange + : Colors.grey, + ), ), ), ); @@ -1524,7 +1529,8 @@ class _SessionDetailScreenState extends State { // If it's a local activity (pending/queued), "refresh" should just check sync status (full fetch) // instead of trying to hit the API for a non-existent ID. - final isLocal = activity.id.startsWith('pending-') || + final isLocal = + activity.id.startsWith('pending-') || activity.id.startsWith('queued-'); final item = ActivityItem( @@ -2258,7 +2264,8 @@ class _SessionDetailScreenState extends State { Widget _buildInput(BuildContext context) { final hasText = _messageController.text.isNotEmpty; - final canApprove = _session.state == SessionState.AWAITING_PLAN_APPROVAL && + final canApprove = + _session.state == SessionState.AWAITING_PLAN_APPROVAL && (_session.requirePlanApproval ?? true); return SafeArea( @@ -2607,8 +2614,9 @@ class _PromptExpander extends StatelessWidget { alignment: Alignment.topLeft, child: Container( constraints: BoxConstraints( - maxHeight: - isExpanded ? MediaQuery.sizeOf(context).height * 0.4 : 60, + maxHeight: isExpanded + ? MediaQuery.sizeOf(context).height * 0.4 + : 60, ), width: double.infinity, clipBehavior: Clip.hardEdge, diff --git a/lib/ui/screens/session_list_screen.dart b/lib/ui/screens/session_list_screen.dart index 18505475..d7495491 100644 --- a/lib/ui/screens/session_list_screen.dart +++ b/lib/ui/screens/session_list_screen.dart @@ -1471,7 +1471,8 @@ class _SessionListScreenState extends State { 'id': 'flag:create_pr', 'label': 'Ready for PR', 'value': 'create_pr', - 'active': (session.prStatus == null || session.prStatus!.isEmpty) && + 'active': + (session.prStatus == null || session.prStatus!.isEmpty) && (session.diffUrl != null || (session.changedFiles != null && session.changedFiles! > 0)), }, @@ -1711,89 +1712,92 @@ class _SessionListScreenState extends State { ) { return queueProvider.queue .where( - (m) => - m.type == QueuedMessageType.sessionCreation || - m.sessionId == 'new_session', - ) // Include legacy or pending + (m) => + m.type == QueuedMessageType.sessionCreation || + m.sessionId == 'new_session', + ) // Include legacy or pending .map((m) { - Map json; - if (m.metadata != null) { - json = Map.from(m.metadata!); - } else { - // Fallback for items without metadata - json = { - 'id': 'temp', - 'name': 'temp', - 'prompt': m.content, - 'sourceContext': {'source': 'unknown'}, - }; - } + Map json; + if (m.metadata != null) { + json = Map.from(m.metadata!); + } else { + // Fallback for items without metadata + json = { + 'id': 'temp', + 'name': 'temp', + 'prompt': m.content, + 'sourceContext': {'source': 'unknown'}, + }; + } - // Override ID to avoid collision - json['id'] = 'DRAFT_CREATION_${m.id}'; + // Override ID to avoid collision + json['id'] = 'DRAFT_CREATION_${m.id}'; - // Ensure prompt is set as title - if (json['title'] == null || json['title'].toString().isEmpty) { - json['title'] = (json['prompt'] as String?) ?? 'New Session (Draft)'; - } + // Ensure prompt is set as title + if (json['title'] == null || json['title'].toString().isEmpty) { + json['title'] = + (json['prompt'] as String?) ?? 'New Session (Draft)'; + } - final state = m.state; - final isOffline = queueProvider.isOffline; // Uses provider from context - - // Inject Flags based on queue state - // User Definition: "Pending" is for all new sessions (draft, error, sending). - // Status 'QUEUED' maps to "Pending" in UI usually. - - json['state'] = 'QUEUED'; // Always QUEUED to match "Pending" filter - - String statusReason; - if (m.processingErrors.isNotEmpty) { - final lastError = m.processingErrors.last; - if (lastError.contains('429') || - lastError.toLowerCase().contains('quota')) { - statusReason = 'Quota limit reached'; - } else if (lastError.contains('500') || - lastError.contains('502') || - lastError.contains('503')) { - statusReason = 'Server error'; - } else { - statusReason = 'Failed: $lastError'; - } - } else if (state == QueueState.draft) { - statusReason = m.queueReason ?? 'Saved as draft'; - } else if (state == QueueState.sending) { - statusReason = 'Sending to server...'; - } else if (state == QueueState.sent) { - statusReason = 'Sent (Waiting for sync)'; - } else if (state == QueueState.failed) { - statusReason = 'Sending failed'; - } else if (isOffline) { - // It's pending sending, but we are offline - statusReason = 'Pending (Offline)'; - if (state == QueueState.queued) { - statusReason = 'Queued (Offline)'; - } - } else { - // Pending sending, online, cached as queued? - statusReason = 'Queued'; - } + final state = m.state; + final isOffline = + queueProvider.isOffline; // Uses provider from context + + // Inject Flags based on queue state + // User Definition: "Pending" is for all new sessions (draft, error, sending). + // Status 'QUEUED' maps to "Pending" in UI usually. + + json['state'] = 'QUEUED'; // Always QUEUED to match "Pending" filter + + String statusReason; + if (m.processingErrors.isNotEmpty) { + final lastError = m.processingErrors.last; + if (lastError.contains('429') || + lastError.toLowerCase().contains('quota')) { + statusReason = 'Quota limit reached'; + } else if (lastError.contains('500') || + lastError.contains('502') || + lastError.contains('503')) { + statusReason = 'Server error'; + } else { + statusReason = 'Failed: $lastError'; + } + } else if (state == QueueState.draft) { + statusReason = m.queueReason ?? 'Saved as draft'; + } else if (state == QueueState.sending) { + statusReason = 'Sending to server...'; + } else if (state == QueueState.sent) { + statusReason = 'Sent (Waiting for sync)'; + } else if (state == QueueState.failed) { + statusReason = 'Sending failed'; + } else if (isOffline) { + // It's pending sending, but we are offline + statusReason = 'Pending (Offline)'; + if (state == QueueState.queued) { + statusReason = 'Queued (Offline)'; + } + } else { + // Pending sending, online, cached as queued? + statusReason = 'Queued'; + } - json['currentAction'] = statusReason; + json['currentAction'] = statusReason; - final session = Session.fromJson(json); + final session = Session.fromJson(json); - return CachedItem( - session, - CacheMetadata( - firstSeen: m.createdAt, - lastRetrieved: m.createdAt, - labels: (state == QueueState.draft) - ? ['DRAFT_CREATION'] - : ['PENDING_CREATION'], - hasPendingUpdates: state != QueueState.draft, - ), - ); - }).toList(); + return CachedItem( + session, + CacheMetadata( + firstSeen: m.createdAt, + lastRetrieved: m.createdAt, + labels: (state == QueueState.draft) + ? ['DRAFT_CREATION'] + : ['PENDING_CREATION'], + hasPendingUpdates: state != QueueState.draft, + ), + ); + }) + .toList(); } PreferredSizeWidget _buildAppBar(SettingsProvider settings, bool isLoading) { @@ -1912,27 +1916,30 @@ class _SessionListScreenState extends State { children: RefreshButtonAction.values .where((action) => settings.appBarRefreshActions.contains(action)) .map((action) { - switch (action) { - case RefreshButtonAction.refresh: - return IconButton( - icon: const Icon(Icons.refresh), - tooltip: 'Refresh (Quick)', - onPressed: () => _fetchSessions(force: true, shallow: true), - ); - case RefreshButtonAction.fullRefresh: - return IconButton( - icon: const Icon(Icons.sync), - tooltip: 'Full Refresh', - onPressed: () => _fetchSessions(force: true, shallow: false), - ); - case RefreshButtonAction.refreshDirty: - return IconButton( - icon: const Icon(Icons.sync_problem), - tooltip: 'Refresh Dirty Sessions', - onPressed: _refreshDirtySessions, - ); - } - }).toList(), + switch (action) { + case RefreshButtonAction.refresh: + return IconButton( + icon: const Icon(Icons.refresh), + tooltip: 'Refresh (Quick)', + onPressed: () => + _fetchSessions(force: true, shallow: true), + ); + case RefreshButtonAction.fullRefresh: + return IconButton( + icon: const Icon(Icons.sync), + tooltip: 'Full Refresh', + onPressed: () => + _fetchSessions(force: true, shallow: false), + ); + case RefreshButtonAction.refreshDirty: + return IconButton( + icon: const Icon(Icons.sync_problem), + tooltip: 'Refresh Dirty Sessions', + onPressed: _refreshDirtySessions, + ); + } + }) + .toList(), ); }, ); @@ -2203,11 +2210,10 @@ class _SessionListScreenState extends State { return Text( statusText, style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: - DateTime.now().difference(lastFetchTime).inMinutes > 15 - ? Colors.orange - : Theme.of(context).textTheme.bodySmall?.color, - ), + color: DateTime.now().difference(lastFetchTime).inMinutes > 15 + ? Colors.orange + : Theme.of(context).textTheme.bodySmall?.color, + ), ); }, ), @@ -2599,9 +2605,9 @@ class _SessionListScreenState extends State { padding: const EdgeInsets.symmetric(horizontal: 4.0), child: GestureDetector( onSecondaryTapUp: (details) { - final RenderBox overlay = Overlay.of(context) - .context - .findRenderObject() as RenderBox; + final RenderBox overlay = + Overlay.of(context).context.findRenderObject() + as RenderBox; final RelativeRect position = RelativeRect.fromRect( Rect.fromPoints( details.globalPosition, @@ -2839,9 +2845,9 @@ class _SessionListScreenState extends State { final query = _searchText.toLowerCase(); final matches = (session.title?.toLowerCase().contains(query) ?? false) || - (session.name.toLowerCase().contains(query)) || - (session.id.toLowerCase().contains(query)) || - (session.state.toString().toLowerCase().contains(query)); + (session.name.toLowerCase().contains(query)) || + (session.id.toLowerCase().contains(query)) || + (session.state.toString().toLowerCase().contains(query)); if (!matches) return false; } @@ -2875,43 +2881,42 @@ class _SessionListScreenState extends State { child: Scaffold( floatingActionButton: settings.fabVisibility == FabVisibility.floating - ? FloatingActionButton( - onPressed: _createSession, - tooltip: 'New Session', - child: const Icon(Icons.add), - ) - : null, + ? FloatingActionButton( + onPressed: _createSession, + tooltip: 'New Session', + child: const Icon(Icons.add), + ) + : null, appBar: _buildAppBar(settings, isLoading), body: Consumer( builder: (context, settings, _) { return (cachedItems.isEmpty && isLoading) ? const Center(child: Text("Loading sessions...")) : (cachedItems.isEmpty && error != null) - ? Center(child: Text('Error: $error')) - : Column( - children: [ - _buildSearchBar(), - if (lastFetchTime != null) - _buildRefreshStatus( - sessionProvider, lastFetchTime), - Expanded( - child: RefreshIndicator( - onRefresh: () => _fetchSessions( - force: true, shallow: true), - child: ListView.builder( - itemCount: _displayItems.length, - itemBuilder: (context, index) { - final cachedItem = _displayItems[index]; - return _buildSessionCard( - cachedItem, - queueProvider, - ); - }, - ), - ), + ? Center(child: Text('Error: $error')) + : Column( + children: [ + _buildSearchBar(), + if (lastFetchTime != null) + _buildRefreshStatus(sessionProvider, lastFetchTime), + Expanded( + child: RefreshIndicator( + onRefresh: () => + _fetchSessions(force: true, shallow: true), + child: ListView.builder( + itemCount: _displayItems.length, + itemBuilder: (context, index) { + final cachedItem = _displayItems[index]; + return _buildSessionCard( + cachedItem, + queueProvider, + ); + }, ), - ], - ); + ), + ), + ], + ); }, ), ), @@ -2992,9 +2997,7 @@ class _SessionListScreenState extends State { } } - Future _fetchAndShowRawData( - Session session, - ) async { + Future _fetchAndShowRawData(Session session) async { final auth = Provider.of(context, listen: false); final cacheService = Provider.of(context, listen: false); @@ -3031,8 +3034,9 @@ class _SessionListScreenState extends State { ); } - final fetchedActivities = - await auth.client.listActivities(session.name); + final fetchedActivities = await auth.client.listActivities( + session.name, + ); activities = fetchedActivities; // Update cache @@ -3072,9 +3076,9 @@ class _SessionListScreenState extends State { // Let's refine: Use a state variable or try/finally blocks better. } if (mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Failed to load raw data: $e')), - ); + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text('Failed to load raw data: $e'))); } } } diff --git a/lib/ui/screens/settings_screen.dart b/lib/ui/screens/settings_screen.dart index 6c6088ff..6c828f4a 100644 --- a/lib/ui/screens/settings_screen.dart +++ b/lib/ui/screens/settings_screen.dart @@ -20,41 +20,46 @@ class _SettingsScreenState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Settings')), - body: Consumer4( - builder: (context, settings, devMode, auth, github, child) { - return ListView( - children: [ - _buildSessionUpdatesSection(context, settings), - const Divider(), - _buildListUpdatesSection(context, settings), - const Divider(), - _buildRefreshActionsSection(context, settings), - const Divider(), - _buildAppearanceSection(context, settings), - const Divider(), - _buildSourceListSection(context, settings), - _buildKeybindingsSection(context, settings), - const Divider(), - _buildAutomaticRefreshSection(context, settings), - const Divider(), - _buildNotificationsSection(context, settings), - const Divider(), - _buildSystemTraySection(context, settings), - const Divider(), - _buildPerformanceSection(context, settings), - const Divider(), - _buildDiagnosticsSection(context), - const Divider(), - _buildDeveloperSection(context, settings, devMode), - const Divider(), - _buildAuthenticationSection(context, auth), - const Divider(), - _buildGitHubSection(context, settings, github), - ], - ); - }, - ), + body: + Consumer4< + SettingsProvider, + DevModeProvider, + AuthProvider, + GithubProvider + >( + builder: (context, settings, devMode, auth, github, child) { + return ListView( + children: [ + _buildSessionUpdatesSection(context, settings), + const Divider(), + _buildListUpdatesSection(context, settings), + const Divider(), + _buildRefreshActionsSection(context, settings), + const Divider(), + _buildAppearanceSection(context, settings), + const Divider(), + _buildSourceListSection(context, settings), + _buildKeybindingsSection(context, settings), + const Divider(), + _buildAutomaticRefreshSection(context, settings), + const Divider(), + _buildNotificationsSection(context, settings), + const Divider(), + _buildSystemTraySection(context, settings), + const Divider(), + _buildPerformanceSection(context, settings), + const Divider(), + _buildDiagnosticsSection(context), + const Divider(), + _buildDeveloperSection(context, settings, devMode), + const Divider(), + _buildAuthenticationSection(context, auth), + const Divider(), + _buildGitHubSection(context, settings, github), + ], + ); + }, + ), ); } @@ -173,9 +178,9 @@ class _SettingsScreenState extends State { child: Text( title, style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Theme.of(context).colorScheme.primary, - fontWeight: FontWeight.bold, - ), + color: Theme.of(context).colorScheme.primary, + fontWeight: FontWeight.bold, + ), ), ); } @@ -405,15 +410,17 @@ class _SettingsScreenState extends State { TextButton( onPressed: () { final rule = UnreadRule( - id: existingRule?.id ?? + id: + existingRule?.id ?? DateTime.now().microsecondsSinceEpoch.toString(), type: type, action: action, fromValue: fromController.text.isEmpty ? null : fromController.text, - toValue: - toController.text.isEmpty ? null : toController.text, + toValue: toController.text.isEmpty + ? null + : toController.text, enabled: existingRule?.enabled ?? true, ); if (isEditing) { @@ -841,9 +848,9 @@ class _SettingsScreenState extends State { Text( 'Automatic Refresh', style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Theme.of(context).colorScheme.primary, - fontWeight: FontWeight.bold, - ), + color: Theme.of(context).colorScheme.primary, + fontWeight: FontWeight.bold, + ), ), IconButton( icon: const Icon(Icons.add), @@ -1079,8 +1086,8 @@ class _SettingsScreenState extends State { : null, sendMessagesMode: taskType == RefreshTaskType.sendPendingMessages - ? sendMessagesMode - : null, + ? sendMessagesMode + : null, isEnabled: schedule?.isEnabled ?? true, ); diff --git a/lib/ui/screens/source_list_screen.dart b/lib/ui/screens/source_list_screen.dart index 6cd483bf..575a14ee 100644 --- a/lib/ui/screens/source_list_screen.dart +++ b/lib/ui/screens/source_list_screen.dart @@ -521,10 +521,10 @@ class _SourceListScreenState extends State { child: Text( 'Last refreshed: ${DateFormat.Hms().format(lastFetchTime)} (${timeAgo(lastFetchTime)})', style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: DateTime.now().difference(lastFetchTime).inMinutes > 30 - ? Colors.orange - : null, - ), + color: DateTime.now().difference(lastFetchTime).inMinutes > 30 + ? Colors.orange + : null, + ), ), ), ); diff --git a/lib/ui/widgets/activity_image.dart b/lib/ui/widgets/activity_image.dart index a34dcef1..5ee2b723 100644 --- a/lib/ui/widgets/activity_image.dart +++ b/lib/ui/widgets/activity_image.dart @@ -228,8 +228,8 @@ class _ActivityImageDialogState extends State<_ActivityImageDialog> { icon: const Icon(Icons.zoom_in, color: Colors.white), tooltip: 'Zoom In', onPressed: () { - final Matrix4 matrix = - _transformationController.value.clone(); + final Matrix4 matrix = _transformationController.value + .clone(); // ignore: deprecated_member_use matrix.scale(1.2); _transformationController.value = matrix; @@ -239,8 +239,8 @@ class _ActivityImageDialogState extends State<_ActivityImageDialog> { icon: const Icon(Icons.zoom_out, color: Colors.white), tooltip: 'Zoom Out', onPressed: () { - final Matrix4 matrix = - _transformationController.value.clone(); + final Matrix4 matrix = _transformationController.value + .clone(); // ignore: deprecated_member_use matrix.scale(1 / 1.2); _transformationController.value = matrix; diff --git a/lib/ui/widgets/activity_item.dart b/lib/ui/widgets/activity_item.dart index 134d4aab..5660f289 100644 --- a/lib/ui/widgets/activity_item.dart +++ b/lib/ui/widgets/activity_item.dart @@ -328,7 +328,8 @@ class _ActivityItemState extends State { } } - final hasOtherContent = activity.progressUpdated != null || + final hasOtherContent = + activity.progressUpdated != null || activity.agentMessaged != null || activity.userMessaged != null || activity.unmappedProps.isNotEmpty; @@ -538,27 +539,28 @@ class _ActivityItemState extends State { CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, - children: (activity - .unmappedProps[ - 'processingErrors'] - as List) - .map((e) { - return Padding( - padding: - const EdgeInsets.only( - bottom: 8.0, - ), - child: SelectableText( - "• $e", - style: const TextStyle( - color: Colors.red, - fontFamily: - 'monospace', - fontSize: 12, - ), - ), - ); - }).toList(), + children: + (activity.unmappedProps['processingErrors'] + as List) + .map((e) { + return Padding( + padding: + const EdgeInsets.only( + bottom: 8.0, + ), + child: SelectableText( + "• $e", + style: const TextStyle( + color: Colors + .red, + fontFamily: + 'monospace', + fontSize: 12, + ), + ), + ); + }) + .toList(), ), ), actions: [ diff --git a/lib/ui/widgets/advanced_search_bar.dart b/lib/ui/widgets/advanced_search_bar.dart index dde1e2af..1ebc88f3 100644 --- a/lib/ui/widgets/advanced_search_bar.dart +++ b/lib/ui/widgets/advanced_search_bar.dart @@ -25,7 +25,7 @@ class AdvancedSearchBar extends StatefulWidget { final ValueChanged onSearchChanged; final List - availableSuggestions; // All possible filters for autocomplete + availableSuggestions; // All possible filters for autocomplete final List activeSorts; final ValueChanged> onSortsChanged; @@ -114,8 +114,9 @@ class AdvancedSearchBarState extends State { void _updateFormulaText() { final filterExpression = widget.filterTree?.toExpression() ?? ''; - final sortExpression = - widget.activeSorts.map((s) => s.toExpression()).join(', '); + final sortExpression = widget.activeSorts + .map((s) => s.toExpression()) + .join(', '); final fullExpression = '$filterExpression ${sortExpression.isNotEmpty ? 'SORT BY $sortExpression' : ''}' .trim(); @@ -463,20 +464,27 @@ class AdvancedSearchBarState extends State { _SuggestionGroups _groupSuggestionsByType(List suggestions) { return _SuggestionGroups( - flagSuggestions: - suggestions.where((s) => s.type == FilterType.flag).toList(), - statusSuggestions: - suggestions.where((s) => s.type == FilterType.status).toList(), - sourceSuggestions: - suggestions.where((s) => s.type == FilterType.source).toList(), - prStatusSuggestions: - suggestions.where((s) => s.type == FilterType.prStatus).toList(), - ciStatusSuggestions: - suggestions.where((s) => s.type == FilterType.ciStatus).toList(), - timeSuggestions: - suggestions.where((s) => s.type == FilterType.time).toList(), - otherSuggestions: - suggestions.where((s) => s.type == FilterType.text).toList(), + flagSuggestions: suggestions + .where((s) => s.type == FilterType.flag) + .toList(), + statusSuggestions: suggestions + .where((s) => s.type == FilterType.status) + .toList(), + sourceSuggestions: suggestions + .where((s) => s.type == FilterType.source) + .toList(), + prStatusSuggestions: suggestions + .where((s) => s.type == FilterType.prStatus) + .toList(), + ciStatusSuggestions: suggestions + .where((s) => s.type == FilterType.ciStatus) + .toList(), + timeSuggestions: suggestions + .where((s) => s.type == FilterType.time) + .toList(), + otherSuggestions: suggestions + .where((s) => s.type == FilterType.text) + .toList(), ); } @@ -1502,18 +1510,18 @@ class _BookmarkDetails extends StatelessWidget { class PopupMenuHeader extends PopupMenuItem { const PopupMenuHeader({super.key, required super.child}) - : super(enabled: false, height: 32); + : super(enabled: false, height: 32); @override Widget? get child => MouseRegion( - cursor: SystemMouseCursors.basic, - child: DefaultTextStyle( - style: const TextStyle( - fontSize: 12, - fontWeight: FontWeight.bold, - color: Colors.grey, - ), - child: super.child!, - ), - ); + cursor: SystemMouseCursors.basic, + child: DefaultTextStyle( + style: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + child: super.child!, + ), + ); } diff --git a/lib/ui/widgets/bulk_action_dialog.dart b/lib/ui/widgets/bulk_action_dialog.dart index 2f86acbf..589728c5 100644 --- a/lib/ui/widgets/bulk_action_dialog.dart +++ b/lib/ui/widgets/bulk_action_dialog.dart @@ -182,8 +182,9 @@ class _BulkActionDialogState extends State { child: const Text('Cancel'), ), FilledButton.icon( - onPressed: - _totalMatches > 0 && _actions.isNotEmpty ? _startJob : null, + onPressed: _totalMatches > 0 && _actions.isNotEmpty + ? _startJob + : null, icon: const Icon(Icons.play_arrow), label: const Text('Run Bulk Actions'), ), @@ -462,8 +463,9 @@ class _BulkActionDialogState extends State { return false; } - final initialState = - metadata.isHidden ? FilterState.implicitOut : FilterState.implicitIn; + final initialState = metadata.isHidden + ? FilterState.implicitOut + : FilterState.implicitIn; if (_filterTree == null) { return initialState.isIn; @@ -693,8 +695,8 @@ class _BulkActionDialogState extends State { if (existingPreset != null) { final contentDiffers = existingPreset.filterExpression != newPreset.filterExpression || - existingPreset.actionScript != newPreset.actionScript || - existingPreset.description != newPreset.description; + existingPreset.actionScript != newPreset.actionScript || + existingPreset.description != newPreset.description; if (contentDiffers) { final confirm = await showDialog( @@ -738,15 +740,15 @@ class _BulkActionDialogState extends State { void _startJob() { // Save configuration context.read().saveBulkActionConfig( - actions: _actions, - parallelQueries: _parallelQueries, - waitBetweenMilliseconds: _waitBetween.inMilliseconds, - waitBetweenUnit: _waitBetweenUnit, - limit: _limit, - offset: _offset, - randomize: _randomize, - stopOnError: _stopOnError, - ); + actions: _actions, + parallelQueries: _parallelQueries, + waitBetweenMilliseconds: _waitBetween.inMilliseconds, + waitBetweenUnit: _waitBetweenUnit, + limit: _limit, + offset: _offset, + randomize: _randomize, + stopOnError: _stopOnError, + ); final config = BulkJobConfig( targetType: BulkTargetType.filtered, @@ -774,9 +776,9 @@ class _BulkActionDialogState extends State { final query = _searchText.toLowerCase(); final matches = (session.title?.toLowerCase().contains(query) ?? false) || - (session.name.toLowerCase().contains(query)) || - (session.id.toLowerCase().contains(query)) || - (session.state.toString().toLowerCase().contains(query)); + (session.name.toLowerCase().contains(query)) || + (session.id.toLowerCase().contains(query)) || + (session.state.toString().toLowerCase().contains(query)); if (!matches) return false; } diff --git a/lib/ui/widgets/bulk_action_progress_dialog.dart b/lib/ui/widgets/bulk_action_progress_dialog.dart index dddf4b81..6161f1d2 100644 --- a/lib/ui/widgets/bulk_action_progress_dialog.dart +++ b/lib/ui/widgets/bulk_action_progress_dialog.dart @@ -31,9 +31,9 @@ class _BulkActionProgressDialogState extends State { _delayController.text = widget.config.waitBetween.inSeconds.toString(); WidgetsBinding.instance.addPostFrameCallback((_) { context.read().startJob( - widget.config, - widget.targets, - ); + widget.config, + widget.targets, + ); }); } @@ -50,7 +50,8 @@ class _BulkActionProgressDialogState extends State { final total = executor.totalToProcess; final completed = executor.completed.length; final progress = total > 0 ? completed / total : 0.0; - final isDone = executor.status == BulkJobStatus.completed || + final isDone = + executor.status == BulkJobStatus.completed || executor.status == BulkJobStatus.canceled; return AlertDialog( @@ -336,8 +337,9 @@ class _BulkActionProgressDialogState extends State { log.message, style: TextStyle( fontSize: 11, - color: - log.isError ? Colors.red : Colors.black87, + color: log.isError + ? Colors.red + : Colors.black87, ), ), ), @@ -410,8 +412,9 @@ class _BulkActionProgressDialogState extends State { titleStyle: TextStyle( fontSize: 11, color: isPaused ? Colors.orange.shade700 : Colors.black87, - fontWeight: - isPaused ? FontWeight.w600 : FontWeight.normal, + fontWeight: isPaused + ? FontWeight.w600 + : FontWeight.normal, ), subtitleStyle: TextStyle( fontSize: 9, diff --git a/lib/ui/widgets/filter_element_widget.dart b/lib/ui/widgets/filter_element_widget.dart index 98d551ff..27015067 100644 --- a/lib/ui/widgets/filter_element_widget.dart +++ b/lib/ui/widgets/filter_element_widget.dart @@ -25,9 +25,10 @@ class FilterElementWidget extends StatelessWidget { FilterElement target, FilterDropAction action, bool isCopy, - )? onDrop; + )? + onDrop; final Function(FilterElement target, FilterElement alternative)? - onAddAlternative; + onAddAlternative; final bool isNegated; final bool isParentDisabled; @@ -121,8 +122,9 @@ class FilterElementWidget extends StatelessWidget { ); } else if (element is PrStatusElement) { final label = element.label; - final displayLabel = - label.toUpperCase().startsWith('PR:') ? label : 'PR: $label'; + final displayLabel = label.toUpperCase().startsWith('PR:') + ? label + : 'PR: $label'; return _buildLeafElement( context, element, @@ -133,8 +135,9 @@ class FilterElementWidget extends StatelessWidget { ); } else if (element is BranchElement) { final label = element.label; - final displayLabel = - label.startsWith('Branch:') ? label : 'Branch: $label'; + final displayLabel = label.startsWith('Branch:') + ? label + : 'Branch: $label'; return _buildLeafElement( context, element, @@ -145,8 +148,9 @@ class FilterElementWidget extends StatelessWidget { ); } else if (element is CiStatusElement) { final label = element.label; - final displayLabel = - label.toUpperCase().startsWith('CI:') ? label : 'CI: $label'; + final displayLabel = label.toUpperCase().startsWith('CI:') + ? label + : 'CI: $label'; return _buildLeafElement( context, element, @@ -615,8 +619,9 @@ class FilterElementWidget extends StatelessWidget { ) { final bool isActuallyDisabled = element is DisabledElement || isParentDisabled; - final effectiveTextColor = - isActuallyDisabled ? textColor.withValues(alpha: 0.5) : textColor; + final effectiveTextColor = isActuallyDisabled + ? textColor.withValues(alpha: 0.5) + : textColor; final effectiveBackgroundColor = isActuallyDisabled ? backgroundColor.withValues(alpha: 0.5) : backgroundColor; @@ -761,11 +766,11 @@ class FilterElementWidget extends StatelessWidget { final isCtrlPressed = ServicesBinding.instance.keyboard.logicalKeysPressed.contains( - LogicalKeyboardKey.controlLeft, - ) || - ServicesBinding.instance.keyboard.logicalKeysPressed.contains( - LogicalKeyboardKey.controlRight, - ); + LogicalKeyboardKey.controlLeft, + ) || + ServicesBinding.instance.keyboard.logicalKeysPressed.contains( + LogicalKeyboardKey.controlRight, + ); // Show Popup Menu final RenderBox renderBox = context.findRenderObject() as RenderBox; diff --git a/lib/ui/widgets/group_management_dialog.dart b/lib/ui/widgets/group_management_dialog.dart index b5257751..0214d082 100644 --- a/lib/ui/widgets/group_management_dialog.dart +++ b/lib/ui/widgets/group_management_dialog.dart @@ -148,8 +148,9 @@ class _GroupEditorDialogState extends State<_GroupEditorDialog> { final allSources = sourceProvider.items.map((i) => i.data).toList(); // Map selected names back to source objects if available - final initialSelection = - allSources.where((s) => _selectedSourceNames.contains(s.name)).toList(); + final initialSelection = allSources + .where((s) => _selectedSourceNames.contains(s.name)) + .toList(); final result = await showDialog>( context: context, diff --git a/lib/ui/widgets/new_session_dialog.dart b/lib/ui/widgets/new_session_dialog.dart index 8322e7bd..fe2b5e87 100644 --- a/lib/ui/widgets/new_session_dialog.dart +++ b/lib/ui/widgets/new_session_dialog.dart @@ -137,7 +137,8 @@ class _NewSessionDialogState extends State { if (widget.initialSession != null) { // Initialize other fields based on initialSession logic - final mode = widget.initialSession!.automationMode ?? + final mode = + widget.initialSession!.automationMode ?? AutomationMode.AUTOMATION_MODE_UNSPECIFIED; final requireApproval = widget.initialSession!.requirePlanApproval ?? false; @@ -440,7 +441,10 @@ class _NewSessionDialogState extends State { // Try to match branch from draft if (widget.initialSession!.sourceContext!.githubRepoContext != null) { _selectedBranch = widget - .initialSession!.sourceContext!.githubRepoContext!.startingBranch; + .initialSession! + .sourceContext! + .githubRepoContext! + .startingBranch; _branchController.text = _selectedBranch ?? ''; } } else { @@ -462,8 +466,9 @@ class _NewSessionDialogState extends State { List allSources = sourceProvider.items.map((i) => i.data).toList(); if (settingsProvider.hideArchivedAndReadOnly) { - allSources = - allSources.where((s) => !s.isArchived && !s.isReadOnly).toList(); + allSources = allSources + .where((s) => !s.isArchived && !s.isReadOnly) + .toList(); } _sortSources(allSources); @@ -591,7 +596,8 @@ class _NewSessionDialogState extends State { void _restoreModeFromSession() { if (widget.initialSession == null) return; _promptController.text = widget.initialSession!.prompt; - final mode = widget.initialSession!.automationMode ?? + final mode = + widget.initialSession!.automationMode ?? AutomationMode.AUTOMATION_MODE_UNSPECIFIED; final requireApproval = widget.initialSession!.requirePlanApproval ?? false; @@ -759,8 +765,9 @@ class _NewSessionDialogState extends State { final allSources = sourceProvider.items.map((i) => i.data).toList(); // Map group members to Source objects - final sources = - allSources.where((s) => group.sourceNames.contains(s.name)).toList(); + final sources = allSources + .where((s) => group.sourceNames.contains(s.name)) + .toList(); setState(() { _bulkSelections = sources @@ -863,8 +870,9 @@ class _NewSessionDialogState extends State { Future _showBulkDialog(List allSources) async { // Convert existing BulkSelection to simple Source list for the dialog - List initialSelection = - _bulkSelections.map((bs) => bs.source).toList(); + List initialSelection = _bulkSelections + .map((bs) => bs.source) + .toList(); if (initialSelection.isEmpty && _selectedSource != null) { initialSelection.add(_selectedSource!); } @@ -1201,8 +1209,9 @@ class _NewSessionDialogState extends State { var sources = sourceProvider.items.map((i) => i.data).toList(); if (settingsProvider.hideArchivedAndReadOnly) { - sources = - sources.where((s) => !s.isArchived && !s.isReadOnly).toList(); + sources = sources + .where((s) => !s.isArchived && !s.isReadOnly) + .toList(); } // Sort sources @@ -1332,17 +1341,20 @@ class _NewSessionDialogState extends State { Consumer( builder: (context, queueProvider, _) { try { - final errorMsg = - queueProvider.queue.firstWhere( - (m) => - m.type == - QueuedMessageType - .sessionCreation && - m.content == - widget.initialSession! - .prompt && - m.processingErrors.isNotEmpty, - ); + final errorMsg = queueProvider.queue + .firstWhere( + (m) => + m.type == + QueuedMessageType + .sessionCreation && + m.content == + widget + .initialSession! + .prompt && + m + .processingErrors + .isNotEmpty, + ); return Padding( padding: const EdgeInsets.only( @@ -1351,21 +1363,22 @@ class _NewSessionDialogState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: - errorMsg.processingErrors - .map( - (e) => Text( - "• $e", - style: TextStyle( - color: Colors - .red.shade900, - fontSize: 11, - fontFamily: - 'monospace', - ), - ), - ) - .toList(), + children: errorMsg + .processingErrors + .map( + (e) => Text( + "• $e", + style: TextStyle( + color: Colors + .red + .shade900, + fontSize: 11, + fontFamily: + 'monospace', + ), + ), + ) + .toList(), ), ); } catch (_) { @@ -1464,7 +1477,8 @@ class _NewSessionDialogState extends State { 'Describe what you want to do...', border: const OutlineInputBorder(), alignLabelWithHint: true, - suffixIcon: (widget.mode == + suffixIcon: + (widget.mode == SessionDialogMode.edit || widget.mode == SessionDialogMode @@ -1481,7 +1495,8 @@ class _NewSessionDialogState extends State { return; } final originalPrompt = widget - .initialSession!.prompt; + .initialSession! + .prompt; final currentText = _promptController.text; @@ -1497,13 +1512,14 @@ class _NewSessionDialogState extends State { originalPrompt; } _promptController.selection = - TextSelection - .fromPosition( - TextPosition( - offset: _promptController - .text.length, - ), - ); + TextSelection.fromPosition( + TextPosition( + offset: + _promptController + .text + .length, + ), + ); }, ) : null, @@ -2006,82 +2022,88 @@ class _SingleSourceSelector extends StatelessWidget { onSelected: (String selection) { onBranchChanged(selection); }, - fieldViewBuilder: ( - BuildContext context, - TextEditingController fieldTextEditingController, - FocusNode fieldFocusNode, - VoidCallback onFieldSubmitted, - ) { - return TextField( - controller: fieldTextEditingController, - focusNode: fieldFocusNode, - decoration: InputDecoration( - labelText: 'Branch', - border: const OutlineInputBorder(), - suffixIcon: isRefreshingBranch - ? const SizedBox( - width: 16, - height: 16, - child: Padding( - padding: EdgeInsets.all(12.0), - child: CircularProgressIndicator(strokeWidth: 2), - ), - ) - : IconButton( - icon: const Icon(Icons.refresh, size: 16), - onPressed: onRefreshBranch, - tooltip: 'Refresh branches', - ), - ), - onSubmitted: (String value) { - onFieldSubmitted(); - onBranchChanged(value); - }, - ); - }, - optionsViewBuilder: ( - BuildContext context, - AutocompleteOnSelected onSelected, - Iterable options, - ) { - return Align( - alignment: Alignment.topLeft, - child: Material( - elevation: 4.0, - child: ConstrainedBox( - constraints: const BoxConstraints( - maxHeight: 200.0, - maxWidth: 300.0, + fieldViewBuilder: + ( + BuildContext context, + TextEditingController fieldTextEditingController, + FocusNode fieldFocusNode, + VoidCallback onFieldSubmitted, + ) { + return TextField( + controller: fieldTextEditingController, + focusNode: fieldFocusNode, + decoration: InputDecoration( + labelText: 'Branch', + border: const OutlineInputBorder(), + suffixIcon: isRefreshingBranch + ? const SizedBox( + width: 16, + height: 16, + child: Padding( + padding: EdgeInsets.all(12.0), + child: CircularProgressIndicator( + strokeWidth: 2, + ), + ), + ) + : IconButton( + icon: const Icon(Icons.refresh, size: 16), + onPressed: onRefreshBranch, + tooltip: 'Refresh branches', + ), ), - child: ListView.builder( - padding: EdgeInsets.zero, - shrinkWrap: true, - itemCount: options.length, - itemBuilder: (BuildContext context, int index) { - final String option = options.elementAt(index); - final bool isSuggestion = - suggestions.contains(option) && + onSubmitted: (String value) { + onFieldSubmitted(); + onBranchChanged(value); + }, + ); + }, + optionsViewBuilder: + ( + BuildContext context, + AutocompleteOnSelected onSelected, + Iterable options, + ) { + return Align( + alignment: Alignment.topLeft, + child: Material( + elevation: 4.0, + child: ConstrainedBox( + constraints: const BoxConstraints( + maxHeight: 200.0, + maxWidth: 300.0, + ), + child: ListView.builder( + padding: EdgeInsets.zero, + shrinkWrap: true, + itemCount: options.length, + itemBuilder: (BuildContext context, int index) { + final String option = options.elementAt(index); + final bool isSuggestion = + suggestions.contains(option) && !branches.contains(option); - return InkWell( - onTap: () { - onSelected(option); + return InkWell( + onTap: () { + onSelected(option); + }, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Text( + option, + style: isSuggestion + ? const TextStyle( + fontStyle: FontStyle.italic, + ) + : null, + ), + ), + ); }, - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Text( - option, - style: isSuggestion - ? const TextStyle(fontStyle: FontStyle.italic) - : null, - ), - ), - ); - }, + ), + ), ), - ), - ), - ); - }, + ); + }, ), ), ], diff --git a/lib/ui/widgets/session_meta_pills.dart b/lib/ui/widgets/session_meta_pills.dart index 10be3f00..3b6c4d82 100644 --- a/lib/ui/widgets/session_meta_pills.dart +++ b/lib/ui/widgets/session_meta_pills.dart @@ -48,8 +48,8 @@ class SessionMetaPills extends StatelessWidget { context, avatar: const Icon(Icons.calendar_today, size: 16), label: DateFormat.yMMMd().add_jm().format( - DateTime.parse(session.createTime!).toLocal(), - ), + DateTime.parse(session.createTime!).toLocal(), + ), sortField: SortField.created, ), @@ -120,15 +120,15 @@ class SessionMetaPills extends StatelessWidget { session.ciStatus == 'Success' ? Icons.check_circle : (session.ciStatus == 'Failure' - ? Icons.cancel - : Icons.pending), + ? Icons.cancel + : Icons.pending), size: 16, ), backgroundColor: session.ciStatus == 'Success' ? Colors.green.shade50 : (session.ciStatus == 'Failure' - ? Colors.red.shade50 - : Colors.amber.shade50), + ? Colors.red.shade50 + : Colors.amber.shade50), filterToken: FilterToken( id: 'ciStatus:${session.ciStatus}', type: FilterType.ciStatus, diff --git a/lib/ui/widgets/session_metadata_dialog.dart b/lib/ui/widgets/session_metadata_dialog.dart index 53ef571b..3dde4140 100644 --- a/lib/ui/widgets/session_metadata_dialog.dart +++ b/lib/ui/widgets/session_metadata_dialog.dart @@ -139,9 +139,9 @@ class SessionMetadataDialog extends StatelessWidget { child: Text( title, style: Theme.of(context).textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.bold, - color: Theme.of(context).primaryColor, - ), + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryColor, + ), ), ); } @@ -212,8 +212,9 @@ class SessionMetadataDialog extends StatelessWidget { border: TableBorder.all(color: Colors.grey.shade300), columnWidths: const {0: IntrinsicColumnWidth(), 1: FlexColumnWidth()}, defaultVerticalAlignment: TableCellVerticalAlignment.middle, - children: - session.metadata!.map((m) => _buildRow(m.key, m.value)).toList(), + children: session.metadata! + .map((m) => _buildRow(m.key, m.value)) + .toList(), ); } diff --git a/lib/ui/widgets/session_preview_modal.dart b/lib/ui/widgets/session_preview_modal.dart index baa0507a..7a52b128 100644 --- a/lib/ui/widgets/session_preview_modal.dart +++ b/lib/ui/widgets/session_preview_modal.dart @@ -84,7 +84,10 @@ class SessionPreviewModal extends StatelessWidget { ), if (session.sourceContext?.githubRepoContext != null) ...[ if (session - .sourceContext!.githubRepoContext!.startingBranch.isNotEmpty) + .sourceContext! + .githubRepoContext! + .startingBranch + .isNotEmpty) ListTile( title: const Text("Branch"), subtitle: Text( diff --git a/lib/ui/widgets/sort_pills_widget.dart b/lib/ui/widgets/sort_pills_widget.dart index 56c409a6..7936c4f3 100644 --- a/lib/ui/widgets/sort_pills_widget.dart +++ b/lib/ui/widgets/sort_pills_widget.dart @@ -177,8 +177,9 @@ class SortPillsWidget extends StatelessWidget { void _showAddSortMenu(BuildContext context) { final existingFields = activeSorts.map((s) => s.field).toSet(); - final availableFields = - SortField.values.where((f) => !existingFields.contains(f)).toList(); + final availableFields = SortField.values + .where((f) => !existingFields.contains(f)) + .toList(); if (availableFields.isEmpty) return; // All fields added diff --git a/lib/ui/widgets/source_metadata_dialog.dart b/lib/ui/widgets/source_metadata_dialog.dart index b98bdf2c..501baebc 100644 --- a/lib/ui/widgets/source_metadata_dialog.dart +++ b/lib/ui/widgets/source_metadata_dialog.dart @@ -198,9 +198,9 @@ class SourceMetadataDialog extends StatelessWidget { child: Text( title, style: Theme.of(context).textTheme.titleSmall?.copyWith( - fontWeight: FontWeight.bold, - color: Theme.of(context).primaryColor, - ), + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryColor, + ), ), ); } @@ -297,9 +297,9 @@ class SourceMetadataDialog extends StatelessWidget { void _copyCacheFilePath(BuildContext context) { Clipboard.setData(ClipboardData(text: cacheFile!.path)); - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('Path copied')), - ); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Path copied'))); } Future _openCacheFile(BuildContext context) async { @@ -319,9 +319,9 @@ class SourceMetadataDialog extends StatelessWidget { } } catch (e) { if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar(content: Text('Error opening file: $e')), - ); + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text('Error opening file: $e'))); } } } diff --git a/lib/ui/widgets/source_tile.dart b/lib/ui/widgets/source_tile.dart index e0297277..08f42d9f 100644 --- a/lib/ui/widgets/source_tile.dart +++ b/lib/ui/widgets/source_tile.dart @@ -133,10 +133,7 @@ class SourceTile extends StatelessWidget { child: Text('Refresh Sessions'), ), const PopupMenuItem(value: 'stats', child: Text('Show Stats')), - const PopupMenuItem( - value: 'view_cache_file', - child: Text('View Source'), - ), + const PopupMenuItem(value: 'view_cache_file', child: Text('View Source')), if (bookmarks.isNotEmpty) const PopupMenuDivider(), ...bookmarks.map( (bookmark) => PopupMenuItem( @@ -396,8 +393,8 @@ Widget _buildInfoPill(BuildContext context, String text, IconData icon) { Text( text, style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), + color: Theme.of(context).colorScheme.onSurfaceVariant, + ), ), ], ), diff --git a/lib/ui/widgets/time_filter_dialog.dart b/lib/ui/widgets/time_filter_dialog.dart index 8a5025cc..63397ea7 100644 --- a/lib/ui/widgets/time_filter_dialog.dart +++ b/lib/ui/widgets/time_filter_dialog.dart @@ -214,8 +214,9 @@ class _TimeFilterDialogState extends State { ), TextButton( onPressed: () { - final range = - _rangeController.text.isNotEmpty ? _rangeController.text : null; + final range = _rangeController.text.isNotEmpty + ? _rangeController.text + : null; final timeFilter = TimeFilter( type: _selectedType, range: range, diff --git a/lib/utils/action_script_parser.dart b/lib/utils/action_script_parser.dart index a11e820b..e6e5b53d 100644 --- a/lib/utils/action_script_parser.dart +++ b/lib/utils/action_script_parser.dart @@ -79,8 +79,9 @@ class ActionScriptParser { } else { final parts = line.split(RegExp(r'\s+')); final actionName = parts[0]; - final message = - parts.length > 1 ? parts.sublist(1).join(' ').trim() : null; + final message = parts.length > 1 + ? parts.sublist(1).join(' ').trim() + : null; final actionType = BulkActionType.values.firstWhere( (e) => e.name == actionName, diff --git a/lib/utils/filter_utils.dart b/lib/utils/filter_utils.dart index 883ac3b2..d51f1b26 100644 --- a/lib/utils/filter_utils.dart +++ b/lib/utils/filter_utils.dart @@ -17,7 +17,8 @@ class FilterUtils { }) { if (searchText.isNotEmpty) { final query = searchText.toLowerCase(); - final matches = (session.title?.toLowerCase().contains(query) ?? false) || + final matches = + (session.title?.toLowerCase().contains(query) ?? false) || (session.name.toLowerCase().contains(query)) || (session.id.toLowerCase().contains(query)) || (session.state.toString().toLowerCase().contains(query)); @@ -28,18 +29,24 @@ class FilterUtils { // Filter Tokens Logic // Group by Type - final statusFilters = - activeFilters.where((f) => f.type == FilterType.status).toList(); - final sourceFilters = - activeFilters.where((f) => f.type == FilterType.source).toList(); - final flagFilters = - activeFilters.where((f) => f.type == FilterType.flag).toList(); - final textFilters = - activeFilters.where((f) => f.type == FilterType.text).toList(); - final ciStatusFilters = - activeFilters.where((f) => f.type == FilterType.ciStatus).toList(); - final timeFilters = - activeFilters.where((f) => f.type == FilterType.time).toList(); + final statusFilters = activeFilters + .where((f) => f.type == FilterType.status) + .toList(); + final sourceFilters = activeFilters + .where((f) => f.type == FilterType.source) + .toList(); + final flagFilters = activeFilters + .where((f) => f.type == FilterType.flag) + .toList(); + final textFilters = activeFilters + .where((f) => f.type == FilterType.text) + .toList(); + final ciStatusFilters = activeFilters + .where((f) => f.type == FilterType.ciStatus) + .toList(); + final timeFilters = activeFilters + .where((f) => f.type == FilterType.time) + .toList(); if (!_matchesStatusFilters(session, statusFilters)) return false; diff --git a/test/api_samples_test.dart b/test/api_samples_test.dart index a9dfb75e..bf7ea2ae 100644 --- a/test/api_samples_test.dart +++ b/test/api_samples_test.dart @@ -46,8 +46,9 @@ void main() { // But Activity.fromJson exists. final activitiesList = json['activities'] as List; - final activities = - activitiesList.map((e) => Activity.fromJson(e)).toList(); + final activities = activitiesList + .map((e) => Activity.fromJson(e)) + .toList(); expect(activities.length, 1); final activity = activities.first; diff --git a/test/filter_approval_test.dart b/test/filter_approval_test.dart index 5f725f44..afca93d8 100644 --- a/test/filter_approval_test.dart +++ b/test/filter_approval_test.dart @@ -154,8 +154,9 @@ List> _applyFilter( final session = item.data; final metadata = item.metadata; - final initialState = - metadata.isHidden ? FilterState.implicitOut : FilterState.implicitIn; + final initialState = metadata.isHidden + ? FilterState.implicitOut + : FilterState.implicitIn; if (filterTree == null) { return initialState.isIn; diff --git a/test/filter_expression_parser_test.dart b/test/filter_expression_parser_test.dart index 3da29cb9..19afd7f0 100644 --- a/test/filter_expression_parser_test.dart +++ b/test/filter_expression_parser_test.dart @@ -87,16 +87,18 @@ void main() { }); test('Should parse time-based filters', () { - final before = FilterExpressionParser.parse('before(yesterday)') - as TimeFilterElement; + final before = + FilterExpressionParser.parse('before(yesterday)') + as TimeFilterElement; expect(before.value.type, TimeFilterType.olderThan); expect( before.value.specificTime?.day, DateTime.now().subtract(const Duration(days: 1)).day, ); - final after = FilterExpressionParser.parse('after(2023-10-27)') - as TimeFilterElement; + final after = + FilterExpressionParser.parse('after(2023-10-27)') + as TimeFilterElement; expect(after.value.type, TimeFilterType.newerThan); expect(after.value.specificTime, DateTime(2023, 10, 27)); @@ -107,8 +109,9 @@ void main() { expect(between.value.specificTime, DateTime(2023, 10, 27)); expect(between.value.specificTimeEnd, DateTime(2023, 10, 28)); - final afterDuration = FilterExpressionParser.parse('after(last 24 hours)') - as TimeFilterElement; + final afterDuration = + FilterExpressionParser.parse('after(last 24 hours)') + as TimeFilterElement; expect(afterDuration.value.type, TimeFilterType.newerThan); expect( afterDuration.value.specificTime?.hour, diff --git a/test/filter_integration_test.dart b/test/filter_integration_test.dart index b402de14..20741e37 100644 --- a/test/filter_integration_test.dart +++ b/test/filter_integration_test.dart @@ -172,8 +172,7 @@ void main() { ); }); - test('OR(Label(Bug), Hidden()): shows visible bugs and all hidden items', - () { + test('OR(Label(Bug), Hidden()): shows visible bugs and all hidden items', () { final filterTree = OrElement([ LabelElement('Bug', 'bug'), LabelElement('Hidden', 'hidden'), @@ -309,8 +308,9 @@ List> _applyFilter( final metadata = item.metadata; // Apply the FilterState logic - final initialState = - metadata.isHidden ? FilterState.implicitOut : FilterState.implicitIn; + final initialState = metadata.isHidden + ? FilterState.implicitOut + : FilterState.implicitIn; if (filterTree == null) { return initialState.isIn; diff --git a/test/refresh_service_test.mocks.dart b/test/refresh_service_test.mocks.dart index 25a46904..b8e8979f 100644 --- a/test/refresh_service_test.mocks.dart +++ b/test/refresh_service_test.mocks.dart @@ -49,24 +49,15 @@ import 'package:mockito/src/dummies.dart' as _i23; // ignore_for_file: invalid_use_of_internal_member class _FakeGlobalKey_0> - extends _i2.SmartFake implements _i1.GlobalKey { - _FakeGlobalKey_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + extends _i2.SmartFake + implements _i1.GlobalKey { + _FakeGlobalKey_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeJulesClient_1 extends _i2.SmartFake implements _i3.JulesClient { - _FakeJulesClient_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeJulesClient_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeFlutterLocalNotificationsPlugin_2 extends _i2.SmartFake @@ -74,21 +65,13 @@ class _FakeFlutterLocalNotificationsPlugin_2 extends _i2.SmartFake _FakeFlutterLocalNotificationsPlugin_2( Object parent, Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + ) : super(parent, parentInvocation); } class _FakeStreamController_3 extends _i2.SmartFake implements _i5.StreamController { - _FakeStreamController_3( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeStreamController_3(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [SettingsProvider]. @@ -96,712 +79,728 @@ class _FakeStreamController_3 extends _i2.SmartFake /// See the documentation for Mockito's code generation for more information. class MockSettingsProvider extends _i2.Mock implements _i6.SettingsProvider { @override - _i7.ListRefreshPolicy get refreshOnAppStart => (super.noSuchMethod( - Invocation.getter(#refreshOnAppStart), - returnValue: _i7.ListRefreshPolicy.none, - returnValueForMissingStub: _i7.ListRefreshPolicy.none, - ) as _i7.ListRefreshPolicy); + _i7.ListRefreshPolicy get refreshOnAppStart => + (super.noSuchMethod( + Invocation.getter(#refreshOnAppStart), + returnValue: _i7.ListRefreshPolicy.none, + returnValueForMissingStub: _i7.ListRefreshPolicy.none, + ) + as _i7.ListRefreshPolicy); @override - _i7.SessionRefreshPolicy get refreshOnOpen => (super.noSuchMethod( - Invocation.getter(#refreshOnOpen), - returnValue: _i7.SessionRefreshPolicy.none, - returnValueForMissingStub: _i7.SessionRefreshPolicy.none, - ) as _i7.SessionRefreshPolicy); + _i7.SessionRefreshPolicy get refreshOnOpen => + (super.noSuchMethod( + Invocation.getter(#refreshOnOpen), + returnValue: _i7.SessionRefreshPolicy.none, + returnValueForMissingStub: _i7.SessionRefreshPolicy.none, + ) + as _i7.SessionRefreshPolicy); @override - _i7.SessionRefreshPolicy get refreshOnMessage => (super.noSuchMethod( - Invocation.getter(#refreshOnMessage), - returnValue: _i7.SessionRefreshPolicy.none, - returnValueForMissingStub: _i7.SessionRefreshPolicy.none, - ) as _i7.SessionRefreshPolicy); + _i7.SessionRefreshPolicy get refreshOnMessage => + (super.noSuchMethod( + Invocation.getter(#refreshOnMessage), + returnValue: _i7.SessionRefreshPolicy.none, + returnValueForMissingStub: _i7.SessionRefreshPolicy.none, + ) + as _i7.SessionRefreshPolicy); @override - _i7.ListRefreshPolicy get refreshOnReturn => (super.noSuchMethod( - Invocation.getter(#refreshOnReturn), - returnValue: _i7.ListRefreshPolicy.none, - returnValueForMissingStub: _i7.ListRefreshPolicy.none, - ) as _i7.ListRefreshPolicy); + _i7.ListRefreshPolicy get refreshOnReturn => + (super.noSuchMethod( + Invocation.getter(#refreshOnReturn), + returnValue: _i7.ListRefreshPolicy.none, + returnValueForMissingStub: _i7.ListRefreshPolicy.none, + ) + as _i7.ListRefreshPolicy); @override - _i7.ListRefreshPolicy get refreshOnCreate => (super.noSuchMethod( - Invocation.getter(#refreshOnCreate), - returnValue: _i7.ListRefreshPolicy.none, - returnValueForMissingStub: _i7.ListRefreshPolicy.none, - ) as _i7.ListRefreshPolicy); + _i7.ListRefreshPolicy get refreshOnCreate => + (super.noSuchMethod( + Invocation.getter(#refreshOnCreate), + returnValue: _i7.ListRefreshPolicy.none, + returnValueForMissingStub: _i7.ListRefreshPolicy.none, + ) + as _i7.ListRefreshPolicy); @override - int get sessionPageSize => (super.noSuchMethod( - Invocation.getter(#sessionPageSize), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get sessionPageSize => + (super.noSuchMethod( + Invocation.getter(#sessionPageSize), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - List<_i8.RefreshSchedule> get schedules => (super.noSuchMethod( - Invocation.getter(#schedules), - returnValue: <_i8.RefreshSchedule>[], - returnValueForMissingStub: <_i8.RefreshSchedule>[], - ) as List<_i8.RefreshSchedule>); + List<_i8.RefreshSchedule> get schedules => + (super.noSuchMethod( + Invocation.getter(#schedules), + returnValue: <_i8.RefreshSchedule>[], + returnValueForMissingStub: <_i8.RefreshSchedule>[], + ) + as List<_i8.RefreshSchedule>); @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isInitialized => + (super.noSuchMethod( + Invocation.getter(#isInitialized), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get notifyOnAttention => (super.noSuchMethod( - Invocation.getter(#notifyOnAttention), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get notifyOnAttention => + (super.noSuchMethod( + Invocation.getter(#notifyOnAttention), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get notifyOnCompletion => (super.noSuchMethod( - Invocation.getter(#notifyOnCompletion), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get notifyOnCompletion => + (super.noSuchMethod( + Invocation.getter(#notifyOnCompletion), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get notifyOnWatch => (super.noSuchMethod( - Invocation.getter(#notifyOnWatch), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get notifyOnWatch => + (super.noSuchMethod( + Invocation.getter(#notifyOnWatch), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get notifyOnFailure => (super.noSuchMethod( - Invocation.getter(#notifyOnFailure), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get notifyOnFailure => + (super.noSuchMethod( + Invocation.getter(#notifyOnFailure), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get notifyOnRefreshStart => (super.noSuchMethod( - Invocation.getter(#notifyOnRefreshStart), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get notifyOnRefreshStart => + (super.noSuchMethod( + Invocation.getter(#notifyOnRefreshStart), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get notifyOnRefreshComplete => (super.noSuchMethod( - Invocation.getter(#notifyOnRefreshComplete), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get notifyOnRefreshComplete => + (super.noSuchMethod( + Invocation.getter(#notifyOnRefreshComplete), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get notifyOnErrors => (super.noSuchMethod( - Invocation.getter(#notifyOnErrors), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get notifyOnErrors => + (super.noSuchMethod( + Invocation.getter(#notifyOnErrors), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get trayEnabled => (super.noSuchMethod( - Invocation.getter(#trayEnabled), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get trayEnabled => + (super.noSuchMethod( + Invocation.getter(#trayEnabled), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get hideToTray => (super.noSuchMethod( - Invocation.getter(#hideToTray), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hideToTray => + (super.noSuchMethod( + Invocation.getter(#hideToTray), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i7.FabVisibility get fabVisibility => (super.noSuchMethod( - Invocation.getter(#fabVisibility), - returnValue: _i7.FabVisibility.appBar, - returnValueForMissingStub: _i7.FabVisibility.appBar, - ) as _i7.FabVisibility); + _i7.FabVisibility get fabVisibility => + (super.noSuchMethod( + Invocation.getter(#fabVisibility), + returnValue: _i7.FabVisibility.appBar, + returnValueForMissingStub: _i7.FabVisibility.appBar, + ) + as _i7.FabVisibility); @override - bool get hideArchivedAndReadOnly => (super.noSuchMethod( - Invocation.getter(#hideArchivedAndReadOnly), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hideArchivedAndReadOnly => + (super.noSuchMethod( + Invocation.getter(#hideArchivedAndReadOnly), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - List<_i9.GithubExclusion> get githubExclusions => (super.noSuchMethod( - Invocation.getter(#githubExclusions), - returnValue: <_i9.GithubExclusion>[], - returnValueForMissingStub: <_i9.GithubExclusion>[], - ) as List<_i9.GithubExclusion>); + List<_i9.GithubExclusion> get githubExclusions => + (super.noSuchMethod( + Invocation.getter(#githubExclusions), + returnValue: <_i9.GithubExclusion>[], + returnValueForMissingStub: <_i9.GithubExclusion>[], + ) + as List<_i9.GithubExclusion>); @override - List<_i10.SourceGroup> get sourceGroups => (super.noSuchMethod( - Invocation.getter(#sourceGroups), - returnValue: <_i10.SourceGroup>[], - returnValueForMissingStub: <_i10.SourceGroup>[], - ) as List<_i10.SourceGroup>); + List<_i10.SourceGroup> get sourceGroups => + (super.noSuchMethod( + Invocation.getter(#sourceGroups), + returnValue: <_i10.SourceGroup>[], + returnValueForMissingStub: <_i10.SourceGroup>[], + ) + as List<_i10.SourceGroup>); @override - bool get useCorpJulesUrl => (super.noSuchMethod( - Invocation.getter(#useCorpJulesUrl), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get useCorpJulesUrl => + (super.noSuchMethod( + Invocation.getter(#useCorpJulesUrl), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i11.JulesThemeType get themeType => (super.noSuchMethod( - Invocation.getter(#themeType), - returnValue: _i11.JulesThemeType.blue, - returnValueForMissingStub: _i11.JulesThemeType.blue, - ) as _i11.JulesThemeType); + _i11.JulesThemeType get themeType => + (super.noSuchMethod( + Invocation.getter(#themeType), + returnValue: _i11.JulesThemeType.blue, + returnValueForMissingStub: _i11.JulesThemeType.blue, + ) + as _i11.JulesThemeType); @override - _i1.ThemeMode get themeMode => (super.noSuchMethod( - Invocation.getter(#themeMode), - returnValue: _i1.ThemeMode.system, - returnValueForMissingStub: _i1.ThemeMode.system, - ) as _i1.ThemeMode); + _i1.ThemeMode get themeMode => + (super.noSuchMethod( + Invocation.getter(#themeMode), + returnValue: _i1.ThemeMode.system, + returnValueForMissingStub: _i1.ThemeMode.system, + ) + as _i1.ThemeMode); @override - bool get enableNotificationDebounce => (super.noSuchMethod( - Invocation.getter(#enableNotificationDebounce), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get enableNotificationDebounce => + (super.noSuchMethod( + Invocation.getter(#enableNotificationDebounce), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - int get notificationDebounceDuration => (super.noSuchMethod( - Invocation.getter(#notificationDebounceDuration), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get notificationDebounceDuration => + (super.noSuchMethod( + Invocation.getter(#notificationDebounceDuration), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - Set<_i7.RefreshButtonAction> get appBarRefreshActions => (super.noSuchMethod( - Invocation.getter(#appBarRefreshActions), - returnValue: <_i7.RefreshButtonAction>{}, - returnValueForMissingStub: <_i7.RefreshButtonAction>{}, - ) as Set<_i7.RefreshButtonAction>); + Set<_i7.RefreshButtonAction> get appBarRefreshActions => + (super.noSuchMethod( + Invocation.getter(#appBarRefreshActions), + returnValue: <_i7.RefreshButtonAction>{}, + returnValueForMissingStub: <_i7.RefreshButtonAction>{}, + ) + as Set<_i7.RefreshButtonAction>); @override - List<_i12.UnreadRule> get unreadRules => (super.noSuchMethod( - Invocation.getter(#unreadRules), - returnValue: <_i12.UnreadRule>[], - returnValueForMissingStub: <_i12.UnreadRule>[], - ) as List<_i12.UnreadRule>); + List<_i12.UnreadRule> get unreadRules => + (super.noSuchMethod( + Invocation.getter(#unreadRules), + returnValue: <_i12.UnreadRule>[], + returnValueForMissingStub: <_i12.UnreadRule>[], + ) + as List<_i12.UnreadRule>); @override - _i7.MessageSubmitAction get enterKeyAction => (super.noSuchMethod( - Invocation.getter(#enterKeyAction), - returnValue: _i7.MessageSubmitAction.addNewLine, - returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, - ) as _i7.MessageSubmitAction); + _i7.MessageSubmitAction get enterKeyAction => + (super.noSuchMethod( + Invocation.getter(#enterKeyAction), + returnValue: _i7.MessageSubmitAction.addNewLine, + returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, + ) + as _i7.MessageSubmitAction); @override - _i7.MessageSubmitAction get shiftEnterKeyAction => (super.noSuchMethod( - Invocation.getter(#shiftEnterKeyAction), - returnValue: _i7.MessageSubmitAction.addNewLine, - returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, - ) as _i7.MessageSubmitAction); + _i7.MessageSubmitAction get shiftEnterKeyAction => + (super.noSuchMethod( + Invocation.getter(#shiftEnterKeyAction), + returnValue: _i7.MessageSubmitAction.addNewLine, + returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, + ) + as _i7.MessageSubmitAction); @override - _i7.MessageSubmitAction get ctrlEnterKeyAction => (super.noSuchMethod( - Invocation.getter(#ctrlEnterKeyAction), - returnValue: _i7.MessageSubmitAction.addNewLine, - returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, - ) as _i7.MessageSubmitAction); + _i7.MessageSubmitAction get ctrlEnterKeyAction => + (super.noSuchMethod( + Invocation.getter(#ctrlEnterKeyAction), + returnValue: _i7.MessageSubmitAction.addNewLine, + returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, + ) + as _i7.MessageSubmitAction); @override - _i7.MessageSubmitAction get ctrlShiftEnterKeyAction => (super.noSuchMethod( - Invocation.getter(#ctrlShiftEnterKeyAction), - returnValue: _i7.MessageSubmitAction.addNewLine, - returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, - ) as _i7.MessageSubmitAction); + _i7.MessageSubmitAction get ctrlShiftEnterKeyAction => + (super.noSuchMethod( + Invocation.getter(#ctrlShiftEnterKeyAction), + returnValue: _i7.MessageSubmitAction.addNewLine, + returnValueForMissingStub: _i7.MessageSubmitAction.addNewLine, + ) + as _i7.MessageSubmitAction); @override - _i7.EscKeyAction get escKeyAction => (super.noSuchMethod( - Invocation.getter(#escKeyAction), - returnValue: _i7.EscKeyAction.savesDraftAndGoesBack, - returnValueForMissingStub: _i7.EscKeyAction.savesDraftAndGoesBack, - ) as _i7.EscKeyAction); + _i7.EscKeyAction get escKeyAction => + (super.noSuchMethod( + Invocation.getter(#escKeyAction), + returnValue: _i7.EscKeyAction.savesDraftAndGoesBack, + returnValueForMissingStub: _i7.EscKeyAction.savesDraftAndGoesBack, + ) + as _i7.EscKeyAction); @override - List<_i13.BulkActionStep> get lastBulkActions => (super.noSuchMethod( - Invocation.getter(#lastBulkActions), - returnValue: <_i13.BulkActionStep>[], - returnValueForMissingStub: <_i13.BulkActionStep>[], - ) as List<_i13.BulkActionStep>); + List<_i13.BulkActionStep> get lastBulkActions => + (super.noSuchMethod( + Invocation.getter(#lastBulkActions), + returnValue: <_i13.BulkActionStep>[], + returnValueForMissingStub: <_i13.BulkActionStep>[], + ) + as List<_i13.BulkActionStep>); @override - int get lastBulkParallelQueries => (super.noSuchMethod( - Invocation.getter(#lastBulkParallelQueries), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get lastBulkParallelQueries => + (super.noSuchMethod( + Invocation.getter(#lastBulkParallelQueries), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - int get lastBulkWaitBetweenMilliseconds => (super.noSuchMethod( - Invocation.getter(#lastBulkWaitBetweenMilliseconds), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get lastBulkWaitBetweenMilliseconds => + (super.noSuchMethod( + Invocation.getter(#lastBulkWaitBetweenMilliseconds), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - _i7.DelayUnit get lastBulkWaitBetweenUnit => (super.noSuchMethod( - Invocation.getter(#lastBulkWaitBetweenUnit), - returnValue: _i7.DelayUnit.ms, - returnValueForMissingStub: _i7.DelayUnit.ms, - ) as _i7.DelayUnit); + _i7.DelayUnit get lastBulkWaitBetweenUnit => + (super.noSuchMethod( + Invocation.getter(#lastBulkWaitBetweenUnit), + returnValue: _i7.DelayUnit.ms, + returnValueForMissingStub: _i7.DelayUnit.ms, + ) + as _i7.DelayUnit); @override - int get lastBulkOffset => (super.noSuchMethod( - Invocation.getter(#lastBulkOffset), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get lastBulkOffset => + (super.noSuchMethod( + Invocation.getter(#lastBulkOffset), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - bool get lastBulkRandomize => (super.noSuchMethod( - Invocation.getter(#lastBulkRandomize), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get lastBulkRandomize => + (super.noSuchMethod( + Invocation.getter(#lastBulkRandomize), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get lastBulkStopOnError => (super.noSuchMethod( - Invocation.getter(#lastBulkStopOnError), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get lastBulkStopOnError => + (super.noSuchMethod( + Invocation.getter(#lastBulkStopOnError), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i5.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future applySchedulerPreset(_i14.SchedulerPreset? preset) => (super.noSuchMethod( - Invocation.method( - #applySchedulerPreset, - [preset], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#applySchedulerPreset, [preset]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future addSchedule(_i8.RefreshSchedule? schedule) => (super.noSuchMethod( - Invocation.method( - #addSchedule, - [schedule], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addSchedule, [schedule]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future updateSchedule(_i8.RefreshSchedule? schedule) => (super.noSuchMethod( - Invocation.method( - #updateSchedule, - [schedule], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#updateSchedule, [schedule]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future deleteSchedule(String? scheduleId) => (super.noSuchMethod( - Invocation.method( - #deleteSchedule, - [scheduleId], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future deleteSchedule(String? scheduleId) => + (super.noSuchMethod( + Invocation.method(#deleteSchedule, [scheduleId]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setSessionPageSize(int? size) => (super.noSuchMethod( - Invocation.method( - #setSessionPageSize, - [size], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setSessionPageSize(int? size) => + (super.noSuchMethod( + Invocation.method(#setSessionPageSize, [size]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setRefreshOnAppStart(_i7.ListRefreshPolicy? policy) => (super.noSuchMethod( - Invocation.method( - #setRefreshOnAppStart, - [policy], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setRefreshOnAppStart, [policy]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setRefreshOnOpen(_i7.SessionRefreshPolicy? policy) => (super.noSuchMethod( - Invocation.method( - #setRefreshOnOpen, - [policy], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setRefreshOnOpen, [policy]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setRefreshOnMessage(_i7.SessionRefreshPolicy? policy) => (super.noSuchMethod( - Invocation.method( - #setRefreshOnMessage, - [policy], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setRefreshOnMessage, [policy]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setRefreshOnReturn(_i7.ListRefreshPolicy? policy) => (super.noSuchMethod( - Invocation.method( - #setRefreshOnReturn, - [policy], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setRefreshOnReturn, [policy]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setRefreshOnCreate(_i7.ListRefreshPolicy? policy) => (super.noSuchMethod( - Invocation.method( - #setRefreshOnCreate, - [policy], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setNotifyOnAttention(bool? value) => (super.noSuchMethod( - Invocation.method( - #setNotifyOnAttention, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setNotifyOnCompletion(bool? value) => (super.noSuchMethod( - Invocation.method( - #setNotifyOnCompletion, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setNotifyOnWatch(bool? value) => (super.noSuchMethod( - Invocation.method( - #setNotifyOnWatch, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setNotifyOnFailure(bool? value) => (super.noSuchMethod( - Invocation.method( - #setNotifyOnFailure, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setNotifyOnRefreshStart(bool? value) => (super.noSuchMethod( - Invocation.method( - #setNotifyOnRefreshStart, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setRefreshOnCreate, [policy]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setNotifyOnAttention(bool? value) => + (super.noSuchMethod( + Invocation.method(#setNotifyOnAttention, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setNotifyOnCompletion(bool? value) => + (super.noSuchMethod( + Invocation.method(#setNotifyOnCompletion, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setNotifyOnWatch(bool? value) => + (super.noSuchMethod( + Invocation.method(#setNotifyOnWatch, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setNotifyOnFailure(bool? value) => + (super.noSuchMethod( + Invocation.method(#setNotifyOnFailure, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setNotifyOnRefreshStart(bool? value) => + (super.noSuchMethod( + Invocation.method(#setNotifyOnRefreshStart, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setNotifyOnRefreshComplete(bool? value) => (super.noSuchMethod( - Invocation.method( - #setNotifyOnRefreshComplete, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setNotifyOnErrors(bool? value) => (super.noSuchMethod( - Invocation.method( - #setNotifyOnErrors, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setTrayEnabled(bool? value) => (super.noSuchMethod( - Invocation.method( - #setTrayEnabled, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setHideToTray(bool? value) => (super.noSuchMethod( - Invocation.method( - #setHideToTray, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setNotifyOnRefreshComplete, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setNotifyOnErrors(bool? value) => + (super.noSuchMethod( + Invocation.method(#setNotifyOnErrors, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setTrayEnabled(bool? value) => + (super.noSuchMethod( + Invocation.method(#setTrayEnabled, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setHideToTray(bool? value) => + (super.noSuchMethod( + Invocation.method(#setHideToTray, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setFabVisibility(_i7.FabVisibility? visibility) => (super.noSuchMethod( - Invocation.method( - #setFabVisibility, - [visibility], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setFabVisibility, [visibility]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setHideArchivedAndReadOnly(bool? value) => (super.noSuchMethod( - Invocation.method( - #setHideArchivedAndReadOnly, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setHideArchivedAndReadOnly, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setUseCorpJulesUrl(bool? value) => (super.noSuchMethod( - Invocation.method( - #setUseCorpJulesUrl, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setUseCorpJulesUrl(bool? value) => + (super.noSuchMethod( + Invocation.method(#setUseCorpJulesUrl, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setThemeType(_i11.JulesThemeType? value) => (super.noSuchMethod( - Invocation.method( - #setThemeType, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setThemeType, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setThemeMode(_i1.ThemeMode? value) => (super.noSuchMethod( - Invocation.method( - #setThemeMode, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future setThemeMode(_i1.ThemeMode? value) => + (super.noSuchMethod( + Invocation.method(#setThemeMode, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setEnableNotificationDebounce(bool? value) => (super.noSuchMethod( - Invocation.method( - #setEnableNotificationDebounce, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setEnableNotificationDebounce, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setNotificationDebounceDuration(int? value) => (super.noSuchMethod( - Invocation.method( - #setNotificationDebounceDuration, - [value], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setNotificationDebounceDuration, [value]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setAppBarRefreshActions( - Set<_i7.RefreshButtonAction>? actions) => + Set<_i7.RefreshButtonAction>? actions, + ) => (super.noSuchMethod( - Invocation.method( - #setAppBarRefreshActions, - [actions], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setAppBarRefreshActions, [actions]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future addUnreadRule(_i12.UnreadRule? rule) => (super.noSuchMethod( - Invocation.method( - #addUnreadRule, - [rule], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future addUnreadRule(_i12.UnreadRule? rule) => + (super.noSuchMethod( + Invocation.method(#addUnreadRule, [rule]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future updateUnreadRule(_i12.UnreadRule? rule) => (super.noSuchMethod( - Invocation.method( - #updateUnreadRule, - [rule], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#updateUnreadRule, [rule]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future deleteUnreadRule(String? id) => (super.noSuchMethod( - Invocation.method( - #deleteUnreadRule, - [id], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future deleteUnreadRule(String? id) => + (super.noSuchMethod( + Invocation.method(#deleteUnreadRule, [id]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future restoreDefaultUnreadRules() => (super.noSuchMethod( - Invocation.method( - #restoreDefaultUnreadRules, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future restoreDefaultUnreadRules() => + (super.noSuchMethod( + Invocation.method(#restoreDefaultUnreadRules, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setEnterKeyAction(_i7.MessageSubmitAction? action) => (super.noSuchMethod( - Invocation.method( - #setEnterKeyAction, - [action], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setEnterKeyAction, [action]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setShiftEnterKeyAction(_i7.MessageSubmitAction? action) => (super.noSuchMethod( - Invocation.method( - #setShiftEnterKeyAction, - [action], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setShiftEnterKeyAction, [action]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setCtrlEnterKeyAction(_i7.MessageSubmitAction? action) => (super.noSuchMethod( - Invocation.method( - #setCtrlEnterKeyAction, - [action], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setCtrlEnterKeyAction, [action]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setCtrlShiftEnterKeyAction( - _i7.MessageSubmitAction? action) => + _i7.MessageSubmitAction? action, + ) => (super.noSuchMethod( - Invocation.method( - #setCtrlShiftEnterKeyAction, - [action], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setCtrlShiftEnterKeyAction, [action]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setEscKeyAction(_i7.EscKeyAction? action) => (super.noSuchMethod( - Invocation.method( - #setEscKeyAction, - [action], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setEscKeyAction, [action]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future setLastFilter(_i15.FilterElement? filter) => (super.noSuchMethod( - Invocation.method( - #setLastFilter, - [filter], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setLastFilter, [filter]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future setLastFetchInfo( - DateTime? time, - String? type, - ) => + _i5.Future setLastFetchInfo(DateTime? time, String? type) => (super.noSuchMethod( - Invocation.method( - #setLastFetchInfo, - [ - time, - type, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#setLastFetchInfo, [time, type]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future saveBulkActionConfig({ @@ -815,34 +814,29 @@ class MockSettingsProvider extends _i2.Mock implements _i6.SettingsProvider { required bool? stopOnError, }) => (super.noSuchMethod( - Invocation.method( - #saveBulkActionConfig, - [], - { - #actions: actions, - #parallelQueries: parallelQueries, - #waitBetweenMilliseconds: waitBetweenMilliseconds, - #waitBetweenUnit: waitBetweenUnit, - #limit: limit, - #offset: offset, - #randomize: randomize, - #stopOnError: stopOnError, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#saveBulkActionConfig, [], { + #actions: actions, + #parallelQueries: parallelQueries, + #waitBetweenMilliseconds: waitBetweenMilliseconds, + #waitBetweenUnit: waitBetweenUnit, + #limit: limit, + #offset: offset, + #randomize: randomize, + #stopOnError: stopOnError, + }), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future addGithubExclusion(_i9.GithubExclusion? exclusion) => (super.noSuchMethod( - Invocation.method( - #addGithubExclusion, - [exclusion], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addGithubExclusion, [exclusion]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future removeGithubExclusion( @@ -850,94 +844,71 @@ class MockSettingsProvider extends _i2.Mock implements _i6.SettingsProvider { _i9.GithubExclusionType? type, ) => (super.noSuchMethod( - Invocation.method( - #removeGithubExclusion, - [ - value, - type, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removeGithubExclusion, [value, type]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - bool isExcluded(String? userOrgRepo) => (super.noSuchMethod( - Invocation.method( - #isExcluded, - [userOrgRepo], - ), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool isExcluded(String? userOrgRepo) => + (super.noSuchMethod( + Invocation.method(#isExcluded, [userOrgRepo]), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override _i5.Future addSourceGroup(_i10.SourceGroup? group) => (super.noSuchMethod( - Invocation.method( - #addSourceGroup, - [group], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addSourceGroup, [group]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future updateSourceGroup(_i10.SourceGroup? group) => (super.noSuchMethod( - Invocation.method( - #updateSourceGroup, - [group], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#updateSourceGroup, [group]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future deleteSourceGroup(String? groupName) => (super.noSuchMethod( - Invocation.method( - #deleteSourceGroup, - [groupName], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future deleteSourceGroup(String? groupName) => + (super.noSuchMethod( + Invocation.method(#deleteSourceGroup, [groupName]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [SessionProvider]. @@ -947,90 +918,85 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { @override _i1.GlobalKey<_i1.ScaffoldMessengerState> get scaffoldKey => (super.noSuchMethod( - Invocation.getter(#scaffoldKey), - returnValue: _FakeGlobalKey_0<_i1.ScaffoldMessengerState>( - this, - Invocation.getter(#scaffoldKey), - ), - returnValueForMissingStub: _FakeGlobalKey_0<_i1.ScaffoldMessengerState>( - this, - Invocation.getter(#scaffoldKey), - ), - ) as _i1.GlobalKey<_i1.ScaffoldMessengerState>); - - @override - _i5.Stream get progressStream => (super.noSuchMethod( - Invocation.getter(#progressStream), - returnValue: _i5.Stream.empty(), - returnValueForMissingStub: _i5.Stream.empty(), - ) as _i5.Stream); + Invocation.getter(#scaffoldKey), + returnValue: _FakeGlobalKey_0<_i1.ScaffoldMessengerState>( + this, + Invocation.getter(#scaffoldKey), + ), + returnValueForMissingStub: + _FakeGlobalKey_0<_i1.ScaffoldMessengerState>( + this, + Invocation.getter(#scaffoldKey), + ), + ) + as _i1.GlobalKey<_i1.ScaffoldMessengerState>); + + @override + _i5.Stream get progressStream => + (super.noSuchMethod( + Invocation.getter(#progressStream), + returnValue: _i5.Stream.empty(), + returnValueForMissingStub: _i5.Stream.empty(), + ) + as _i5.Stream); @override - List<_i18.CachedItem<_i19.Session>> get items => (super.noSuchMethod( - Invocation.getter(#items), - returnValue: <_i18.CachedItem<_i19.Session>>[], - returnValueForMissingStub: <_i18.CachedItem<_i19.Session>>[], - ) as List<_i18.CachedItem<_i19.Session>>); + List<_i18.CachedItem<_i19.Session>> get items => + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i18.CachedItem<_i19.Session>>[], + returnValueForMissingStub: <_i18.CachedItem<_i19.Session>>[], + ) + as List<_i18.CachedItem<_i19.Session>>); @override - bool get isLoading => (super.noSuchMethod( - Invocation.getter(#isLoading), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isLoading => + (super.noSuchMethod( + Invocation.getter(#isLoading), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void setCacheService(_i18.CacheService? service) => super.noSuchMethod( - Invocation.method( - #setCacheService, - [service], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#setCacheService, [service]), + returnValueForMissingStub: null, + ); @override void setGithubProvider(_i20.GithubProvider? service) => super.noSuchMethod( - Invocation.method( - #setGithubProvider, - [service], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#setGithubProvider, [service]), + returnValueForMissingStub: null, + ); @override void setNotificationProvider(_i21.NotificationProvider? service) => super.noSuchMethod( - Invocation.method( - #setNotificationProvider, - [service], - ), + Invocation.method(#setNotificationProvider, [service]), returnValueForMissingStub: null, ); @override void setSettingsProvider(_i6.SettingsProvider? service) => super.noSuchMethod( - Invocation.method( - #setSettingsProvider, - [service], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#setSettingsProvider, [service]), + returnValueForMissingStub: null, + ); @override _i5.Future fetchSessions( @@ -1042,20 +1008,21 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { void Function(String)? onRefreshFallback, }) => (super.noSuchMethod( - Invocation.method( - #fetchSessions, - [client], - { - #force: force, - #shallow: shallow, - #pageSize: pageSize, - #authToken: authToken, - #onRefreshFallback: onRefreshFallback, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #fetchSessions, + [client], + { + #force: force, + #shallow: shallow, + #pageSize: pageSize, + #authToken: authToken, + #onRefreshFallback: onRefreshFallback, + }, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future updateSession( @@ -1064,17 +1031,15 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { List<_i19.Activity>? activities, }) => (super.noSuchMethod( - Invocation.method( - #updateSession, - [session], - { - #authToken: authToken, - #activities: activities, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #updateSession, + [session], + {#authToken: authToken, #activities: activities}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future refreshSession( @@ -1083,17 +1048,15 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { String? authToken, }) => (super.noSuchMethod( - Invocation.method( - #refreshSession, - [ - client, - sessionName, - ], - {#authToken: authToken}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #refreshSession, + [client, sessionName], + {#authToken: authToken}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future refreshDirtySessions( @@ -1101,14 +1064,15 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { required String? authToken, }) => (super.noSuchMethod( - Invocation.method( - #refreshDirtySessions, - [client], - {#authToken: authToken}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #refreshDirtySessions, + [client], + {#authToken: authToken}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future refreshWatchedSessions( @@ -1116,82 +1080,51 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { required String? authToken, }) => (super.noSuchMethod( - Invocation.method( - #refreshWatchedSessions, - [client], - {#authToken: authToken}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future toggleWatch( - String? sessionId, - String? authToken, - ) => + Invocation.method( + #refreshWatchedSessions, + [client], + {#authToken: authToken}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future toggleWatch(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #toggleWatch, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#toggleWatch, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future watchSession( - String? sessionId, - String? authToken, - ) => + _i5.Future watchSession(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #watchSession, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#watchSession, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future unwatchSession( - String? sessionId, - String? authToken, - ) => + _i5.Future unwatchSession(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #unwatchSession, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#unwatchSession, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future toggleHidden( - String? sessionId, - String? authToken, - ) => + _i5.Future toggleHidden(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #toggleHidden, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#toggleHidden, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future addPendingMessage( @@ -1200,17 +1133,15 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { String? authToken, ) => (super.noSuchMethod( - Invocation.method( - #addPendingMessage, - [ - sessionId, - content, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#addPendingMessage, [ + sessionId, + content, + authToken, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future removePendingMessage( @@ -1219,17 +1150,15 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { String? authToken, ) => (super.noSuchMethod( - Invocation.method( - #removePendingMessage, - [ - sessionId, - pendingId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#removePendingMessage, [ + sessionId, + pendingId, + authToken, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future markMessageAsSent( @@ -1238,102 +1167,60 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { String? authToken, ) => (super.noSuchMethod( - Invocation.method( - #markMessageAsSent, - [ - sessionId, - pendingId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#markMessageAsSent, [ + sessionId, + pendingId, + authToken, + ]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future markAsPendingUpdate( - String? sessionId, - String? authToken, - ) => + _i5.Future markAsPendingUpdate(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #markAsPendingUpdate, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#markAsPendingUpdate, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future markAsRead( - String? sessionId, - String? authToken, - ) => + _i5.Future markAsRead(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #markAsRead, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#markAsRead, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future markAsUnread( - String? sessionId, - String? authToken, - ) => + _i5.Future markAsUnread(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #markAsUnread, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#markAsUnread, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future markPrAsOpened( - String? sessionId, - String? authToken, - ) => + _i5.Future markPrAsOpened(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #markPrAsOpened, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#markPrAsOpened, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override - _i5.Future refreshGitStatus( - String? sessionId, - String? authToken, - ) => + _i5.Future refreshGitStatus(String? sessionId, String? authToken) => (super.noSuchMethod( - Invocation.method( - #refreshGitStatus, - [ - sessionId, - authToken, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#refreshGitStatus, [sessionId, authToken]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future updateSessionTags( @@ -1341,16 +1228,11 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { List? tags, ) => (super.noSuchMethod( - Invocation.method( - #updateSessionTags, - [ - session, - tags, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#updateSessionTags, [session, tags]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future refreshSessionsForSource( @@ -1359,44 +1241,33 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { required String? authToken, }) => (super.noSuchMethod( - Invocation.method( - #refreshSessionsForSource, - [ - client, - sourceName, - ], - {#authToken: authToken}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #refreshSessionsForSource, + [client, sourceName], + {#authToken: authToken}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [SourceProvider]. @@ -1404,61 +1275,70 @@ class MockSessionProvider extends _i2.Mock implements _i17.SessionProvider { /// See the documentation for Mockito's code generation for more information. class MockSourceProvider extends _i2.Mock implements _i22.SourceProvider { @override - List<_i18.CachedItem<_i19.Source>> get items => (super.noSuchMethod( - Invocation.getter(#items), - returnValue: <_i18.CachedItem<_i19.Source>>[], - returnValueForMissingStub: <_i18.CachedItem<_i19.Source>>[], - ) as List<_i18.CachedItem<_i19.Source>>); - - @override - bool get isLoading => (super.noSuchMethod( - Invocation.getter(#isLoading), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + List<_i18.CachedItem<_i19.Source>> get items => + (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i18.CachedItem<_i19.Source>>[], + returnValueForMissingStub: <_i18.CachedItem<_i19.Source>>[], + ) + as List<_i18.CachedItem<_i19.Source>>); @override - String get loadingStatus => (super.noSuchMethod( - Invocation.getter(#loadingStatus), - returnValue: _i23.dummyValue( - this, - Invocation.getter(#loadingStatus), - ), - returnValueForMissingStub: _i23.dummyValue( - this, - Invocation.getter(#loadingStatus), - ), - ) as String); + bool get isLoading => + (super.noSuchMethod( + Invocation.getter(#isLoading), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - int get loadingCount => (super.noSuchMethod( - Invocation.getter(#loadingCount), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + String get loadingStatus => + (super.noSuchMethod( + Invocation.getter(#loadingStatus), + returnValue: _i23.dummyValue( + this, + Invocation.getter(#loadingStatus), + ), + returnValueForMissingStub: _i23.dummyValue( + this, + Invocation.getter(#loadingStatus), + ), + ) + as String); + + @override + int get loadingCount => + (super.noSuchMethod( + Invocation.getter(#loadingCount), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - int get pendingGithubRefreshes => (super.noSuchMethod( - Invocation.getter(#pendingGithubRefreshes), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + int get pendingGithubRefreshes => + (super.noSuchMethod( + Invocation.getter(#pendingGithubRefreshes), + returnValue: 0, + returnValueForMissingStub: 0, + ) + as int); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override void setCacheService(_i18.CacheService? service) => super.noSuchMethod( - Invocation.method( - #setCacheService, - [service], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#setCacheService, [service]), + returnValueForMissingStub: null, + ); @override _i5.Future fetchSources( @@ -1466,42 +1346,35 @@ class MockSourceProvider extends _i2.Mock implements _i22.SourceProvider { bool? force = false, String? authToken, _i20.GithubProvider? githubProvider, - void Function( - int, - String, - )? onProgress, + void Function(int, String)? onProgress, }) => (super.noSuchMethod( - Invocation.method( - #fetchSources, - [client], - { - #force: force, - #authToken: authToken, - #githubProvider: githubProvider, - #onProgress: onProgress, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #fetchSources, + [client], + { + #force: force, + #authToken: authToken, + #githubProvider: githubProvider, + #onProgress: onProgress, + }, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void queueAllSourcesGithubRefresh({ required _i20.GithubProvider? githubProvider, String? authToken, - }) => - super.noSuchMethod( - Invocation.method( - #queueAllSourcesGithubRefresh, - [], - { - #githubProvider: githubProvider, - #authToken: authToken, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method(#queueAllSourcesGithubRefresh, [], { + #githubProvider: githubProvider, + #authToken: authToken, + }), + returnValueForMissingStub: null, + ); @override _i5.Future ensureSourceAvailable( @@ -1510,17 +1383,15 @@ class MockSourceProvider extends _i2.Mock implements _i22.SourceProvider { String? authToken, }) => (super.noSuchMethod( - Invocation.method( - #ensureSourceAvailable, - [ - client, - sourceName, - ], - {#authToken: authToken}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #ensureSourceAvailable, + [client, sourceName], + {#authToken: authToken}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future refreshSource( @@ -1530,56 +1401,39 @@ class MockSourceProvider extends _i2.Mock implements _i22.SourceProvider { _i20.GithubProvider? githubProvider, }) => (super.noSuchMethod( - Invocation.method( - #refreshSource, - [ - client, - sourceToRefresh, - ], - { - #authToken: authToken, - #githubProvider: githubProvider, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #refreshSource, + [client, sourceToRefresh], + {#authToken: authToken, #githubProvider: githubProvider}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [AuthProvider]. @@ -1587,135 +1441,112 @@ class MockSourceProvider extends _i2.Mock implements _i22.SourceProvider { /// See the documentation for Mockito's code generation for more information. class MockAuthProvider extends _i2.Mock implements _i24.AuthProvider { @override - _i24.TokenType get tokenType => (super.noSuchMethod( - Invocation.getter(#tokenType), - returnValue: _i24.TokenType.apiKey, - returnValueForMissingStub: _i24.TokenType.apiKey, - ) as _i24.TokenType); + _i24.TokenType get tokenType => + (super.noSuchMethod( + Invocation.getter(#tokenType), + returnValue: _i24.TokenType.apiKey, + returnValueForMissingStub: _i24.TokenType.apiKey, + ) + as _i24.TokenType); @override - bool get isLoading => (super.noSuchMethod( - Invocation.getter(#isLoading), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isLoading => + (super.noSuchMethod( + Invocation.getter(#isLoading), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get isAuthenticated => (super.noSuchMethod( - Invocation.getter(#isAuthenticated), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isAuthenticated => + (super.noSuchMethod( + Invocation.getter(#isAuthenticated), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i3.JulesClient get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeJulesClient_1( - this, - Invocation.getter(#client), - ), - returnValueForMissingStub: _FakeJulesClient_1( - this, - Invocation.getter(#client), - ), - ) as _i3.JulesClient); + _i3.JulesClient get client => + (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeJulesClient_1(this, Invocation.getter(#client)), + returnValueForMissingStub: _FakeJulesClient_1( + this, + Invocation.getter(#client), + ), + ) + as _i3.JulesClient); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - _i5.Future validateToken( - String? token, - _i24.TokenType? type, - ) => + _i5.Future validateToken(String? token, _i24.TokenType? type) => (super.noSuchMethod( - Invocation.method( - #validateToken, - [ - token, - type, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future setToken( - String? token, - _i24.TokenType? type, - ) => + Invocation.method(#validateToken, [token, type]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future setToken(String? token, _i24.TokenType? type) => + (super.noSuchMethod( + Invocation.method(#setToken, [token, type]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future signInWithGoogle() => (super.noSuchMethod( - Invocation.method( - #setToken, - [ - token, - type, - ], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future signInWithGoogle() => (super.noSuchMethod( - Invocation.method( - #signInWithGoogle, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future logout() => (super.noSuchMethod( - Invocation.method( - #logout, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#signInWithGoogle, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future logout() => + (super.noSuchMethod( + Invocation.method(#logout, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [NotificationService]. @@ -1726,67 +1557,64 @@ class MockNotificationService extends _i2.Mock @override _i4.FlutterLocalNotificationsPlugin get flutterLocalNotificationsPlugin => (super.noSuchMethod( - Invocation.getter(#flutterLocalNotificationsPlugin), - returnValue: _FakeFlutterLocalNotificationsPlugin_2( - this, - Invocation.getter(#flutterLocalNotificationsPlugin), - ), - returnValueForMissingStub: _FakeFlutterLocalNotificationsPlugin_2( - this, - Invocation.getter(#flutterLocalNotificationsPlugin), - ), - ) as _i4.FlutterLocalNotificationsPlugin); + Invocation.getter(#flutterLocalNotificationsPlugin), + returnValue: _FakeFlutterLocalNotificationsPlugin_2( + this, + Invocation.getter(#flutterLocalNotificationsPlugin), + ), + returnValueForMissingStub: _FakeFlutterLocalNotificationsPlugin_2( + this, + Invocation.getter(#flutterLocalNotificationsPlugin), + ), + ) + as _i4.FlutterLocalNotificationsPlugin); @override _i5.StreamController<_i4.NotificationResponse> get onNotificationResponse => (super.noSuchMethod( - Invocation.getter(#onNotificationResponse), - returnValue: _FakeStreamController_3<_i4.NotificationResponse>( - this, - Invocation.getter(#onNotificationResponse), - ), - returnValueForMissingStub: - _FakeStreamController_3<_i4.NotificationResponse>( - this, - Invocation.getter(#onNotificationResponse), - ), - ) as _i5.StreamController<_i4.NotificationResponse>); + Invocation.getter(#onNotificationResponse), + returnValue: _FakeStreamController_3<_i4.NotificationResponse>( + this, + Invocation.getter(#onNotificationResponse), + ), + returnValueForMissingStub: + _FakeStreamController_3<_i4.NotificationResponse>( + this, + Invocation.getter(#onNotificationResponse), + ), + ) + as _i5.StreamController<_i4.NotificationResponse>); @override _i5.Stream<_i4.NotificationResponse> get onNotificationResponseStream => (super.noSuchMethod( - Invocation.getter(#onNotificationResponseStream), - returnValue: _i5.Stream<_i4.NotificationResponse>.empty(), - returnValueForMissingStub: _i5.Stream<_i4.NotificationResponse>.empty(), - ) as _i5.Stream<_i4.NotificationResponse>); + Invocation.getter(#onNotificationResponseStream), + returnValue: _i5.Stream<_i4.NotificationResponse>.empty(), + returnValueForMissingStub: + _i5.Stream<_i4.NotificationResponse>.empty(), + ) + as _i5.Stream<_i4.NotificationResponse>); @override set settings(_i6.SettingsProvider? value) => super.noSuchMethod( - Invocation.setter( - #settings, - value, - ), - returnValueForMissingStub: null, - ); + Invocation.setter(#settings, value), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override - _i5.Future init() => (super.noSuchMethod( - Invocation.method( - #init, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future init() => + (super.noSuchMethod( + Invocation.method(#init, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override _i5.Future showNotification( @@ -1796,20 +1624,15 @@ class MockNotificationService extends _i2.Mock List<_i25.NotificationAction>? actions, }) => (super.noSuchMethod( - Invocation.method( - #showNotification, - [ - title, - body, - ], - { - #payload: payload, - #actions: actions, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method( + #showNotification, + [title, body], + {#payload: payload, #actions: actions}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); } /// A class which mocks [ActivityProvider]. @@ -1817,63 +1640,52 @@ class MockNotificationService extends _i2.Mock /// See the documentation for Mockito's code generation for more information. class MockActivityProvider extends _i2.Mock implements _i26.ActivityProvider { @override - List<_i19.ActivityLog> get logs => (super.noSuchMethod( - Invocation.getter(#logs), - returnValue: <_i19.ActivityLog>[], - returnValueForMissingStub: <_i19.ActivityLog>[], - ) as List<_i19.ActivityLog>); + List<_i19.ActivityLog> get logs => + (super.noSuchMethod( + Invocation.getter(#logs), + returnValue: <_i19.ActivityLog>[], + returnValueForMissingStub: <_i19.ActivityLog>[], + ) + as List<_i19.ActivityLog>); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override void addLog(String? message) => super.noSuchMethod( - Invocation.method( - #addLog, - [message], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addLog, [message]), + returnValueForMissingStub: null, + ); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } /// A class which mocks [MessageQueueProvider]. @@ -1882,67 +1694,62 @@ class MockActivityProvider extends _i2.Mock implements _i26.ActivityProvider { class MockMessageQueueProvider extends _i2.Mock implements _i27.MessageQueueProvider { @override - List<_i19.QueuedMessage> get queue => (super.noSuchMethod( - Invocation.getter(#queue), - returnValue: <_i19.QueuedMessage>[], - returnValueForMissingStub: <_i19.QueuedMessage>[], - ) as List<_i19.QueuedMessage>); + List<_i19.QueuedMessage> get queue => + (super.noSuchMethod( + Invocation.getter(#queue), + returnValue: <_i19.QueuedMessage>[], + returnValueForMissingStub: <_i19.QueuedMessage>[], + ) + as List<_i19.QueuedMessage>); @override - bool get isOffline => (super.noSuchMethod( - Invocation.getter(#isOffline), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isOffline => + (super.noSuchMethod( + Invocation.getter(#isOffline), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get isConnecting => (super.noSuchMethod( - Invocation.getter(#isConnecting), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get isConnecting => + (super.noSuchMethod( + Invocation.getter(#isConnecting), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); + bool get hasListeners => + (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) + as bool); @override - void setCacheService( - _i18.CacheService? service, - String? token, - ) => + void setCacheService(_i18.CacheService? service, String? token) => super.noSuchMethod( - Invocation.method( - #setCacheService, - [ - service, - token, - ], - ), + Invocation.method(#setCacheService, [service, token]), returnValueForMissingStub: null, ); @override void setOffline(bool? value) => super.noSuchMethod( - Invocation.method( - #setOffline, - [value], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#setOffline, [value]), + returnValueForMissingStub: null, + ); @override - _i5.Future resyncQueue() => (super.noSuchMethod( - Invocation.method( - #resyncQueue, - [], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i5.Future resyncQueue() => + (super.noSuchMethod( + Invocation.method(#resyncQueue, []), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override String addMessage( @@ -1955,55 +1762,47 @@ class MockMessageQueueProvider extends _i2.Mock List? processingErrors, }) => (super.noSuchMethod( - Invocation.method( - #addMessage, - [ - sessionId, - content, - ], - { - #reason: reason, - #isDraft: isDraft, - #requestId: requestId, - #metadata: metadata, - #processingErrors: processingErrors, - }, - ), - returnValue: _i23.dummyValue( - this, - Invocation.method( - #addMessage, - [ - sessionId, - content, - ], - { - #reason: reason, - #isDraft: isDraft, - #requestId: requestId, - #metadata: metadata, - #processingErrors: processingErrors, - }, - ), - ), - returnValueForMissingStub: _i23.dummyValue( - this, - Invocation.method( - #addMessage, - [ - sessionId, - content, - ], - { - #reason: reason, - #isDraft: isDraft, - #requestId: requestId, - #metadata: metadata, - #processingErrors: processingErrors, - }, - ), - ), - ) as String); + Invocation.method( + #addMessage, + [sessionId, content], + { + #reason: reason, + #isDraft: isDraft, + #requestId: requestId, + #metadata: metadata, + #processingErrors: processingErrors, + }, + ), + returnValue: _i23.dummyValue( + this, + Invocation.method( + #addMessage, + [sessionId, content], + { + #reason: reason, + #isDraft: isDraft, + #requestId: requestId, + #metadata: metadata, + #processingErrors: processingErrors, + }, + ), + ), + returnValueForMissingStub: _i23.dummyValue( + this, + Invocation.method( + #addMessage, + [sessionId, content], + { + #reason: reason, + #isDraft: isDraft, + #requestId: requestId, + #metadata: metadata, + #processingErrors: processingErrors, + }, + ), + ), + ) + as String); @override String addCreateSessionRequest( @@ -2013,56 +1812,35 @@ class MockMessageQueueProvider extends _i2.Mock String? requestId, }) => (super.noSuchMethod( - Invocation.method( - #addCreateSessionRequest, - [session], - { - #reason: reason, - #isDraft: isDraft, - #requestId: requestId, - }, - ), - returnValue: _i23.dummyValue( - this, - Invocation.method( - #addCreateSessionRequest, - [session], - { - #reason: reason, - #isDraft: isDraft, - #requestId: requestId, - }, - ), - ), - returnValueForMissingStub: _i23.dummyValue( - this, - Invocation.method( - #addCreateSessionRequest, - [session], - { - #reason: reason, - #isDraft: isDraft, - #requestId: requestId, - }, - ), - ), - ) as String); - - @override - void updateMessage( - String? id, - String? newContent, - ) => - super.noSuchMethod( - Invocation.method( - #updateMessage, - [ - id, - newContent, - ], - ), - returnValueForMissingStub: null, - ); + Invocation.method( + #addCreateSessionRequest, + [session], + {#reason: reason, #isDraft: isDraft, #requestId: requestId}, + ), + returnValue: _i23.dummyValue( + this, + Invocation.method( + #addCreateSessionRequest, + [session], + {#reason: reason, #isDraft: isDraft, #requestId: requestId}, + ), + ), + returnValueForMissingStub: _i23.dummyValue( + this, + Invocation.method( + #addCreateSessionRequest, + [session], + {#reason: reason, #isDraft: isDraft, #requestId: requestId}, + ), + ), + ) + as String); + + @override + void updateMessage(String? id, String? newContent) => super.noSuchMethod( + Invocation.method(#updateMessage, [id, newContent]), + returnValueForMissingStub: null, + ); @override void updateCreateSessionRequest( @@ -2070,160 +1848,118 @@ class MockMessageQueueProvider extends _i2.Mock _i19.Session? session, { bool? isDraft, String? reason, - }) => - super.noSuchMethod( - Invocation.method( - #updateCreateSessionRequest, - [ - id, - session, - ], - { - #isDraft: isDraft, - #reason: reason, - }, - ), - returnValueForMissingStub: null, - ); + }) => super.noSuchMethod( + Invocation.method( + #updateCreateSessionRequest, + [id, session], + {#isDraft: isDraft, #reason: reason}, + ), + returnValueForMissingStub: null, + ); @override void deleteMessage(String? id) => super.noSuchMethod( - Invocation.method( - #deleteMessage, - [id], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#deleteMessage, [id]), + returnValueForMissingStub: null, + ); @override - void saveDraft( - String? sessionId, - String? content, - ) => - super.noSuchMethod( - Invocation.method( - #saveDraft, - [ - sessionId, - content, - ], - ), - returnValueForMissingStub: null, - ); + void saveDraft(String? sessionId, String? content) => super.noSuchMethod( + Invocation.method(#saveDraft, [sessionId, content]), + returnValueForMissingStub: null, + ); @override - List<_i19.QueuedMessage> getDrafts(String? sessionId) => (super.noSuchMethod( - Invocation.method( - #getDrafts, - [sessionId], - ), - returnValue: <_i19.QueuedMessage>[], - returnValueForMissingStub: <_i19.QueuedMessage>[], - ) as List<_i19.QueuedMessage>); + List<_i19.QueuedMessage> getDrafts(String? sessionId) => + (super.noSuchMethod( + Invocation.method(#getDrafts, [sessionId]), + returnValue: <_i19.QueuedMessage>[], + returnValueForMissingStub: <_i19.QueuedMessage>[], + ) + as List<_i19.QueuedMessage>); @override - _i5.Future goOnline(_i3.JulesClient? client) => (super.noSuchMethod( - Invocation.method( - #goOnline, - [client], - ), - returnValue: _i5.Future.value(false), - returnValueForMissingStub: _i5.Future.value(false), - ) as _i5.Future); + _i5.Future goOnline(_i3.JulesClient? client) => + (super.noSuchMethod( + Invocation.method(#goOnline, [client]), + returnValue: _i5.Future.value(false), + returnValueForMissingStub: _i5.Future.value(false), + ) + as _i5.Future); @override _i5.Future sendQueue( _i3.JulesClient? client, { dynamic Function(String)? onMessageSent, dynamic Function(_i19.Session)? onSessionCreated, - dynamic Function( - String, - Object, - )? onError, + dynamic Function(String, Object)? onError, int? limit = 0, }) => (super.noSuchMethod( - Invocation.method( - #sendQueue, - [client], - { - #onMessageSent: onMessageSent, - #onSessionCreated: onSessionCreated, - #onError: onError, - #limit: limit, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - - @override - _i5.Future importLegacyQueue(String? filePath) => (super.noSuchMethod( - Invocation.method( - #importLegacyQueue, - [filePath], - ), - returnValue: _i5.Future.value(_i23.dummyValue( - this, - Invocation.method( - #importLegacyQueue, - [filePath], - ), - )), - returnValueForMissingStub: - _i5.Future.value(_i23.dummyValue( - this, - Invocation.method( - #importLegacyQueue, - [filePath], - ), - )), - ) as _i5.Future); + Invocation.method( + #sendQueue, + [client], + { + #onMessageSent: onMessageSent, + #onSessionCreated: onSessionCreated, + #onError: onError, + #limit: limit, + }, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); + + @override + _i5.Future importLegacyQueue(String? filePath) => + (super.noSuchMethod( + Invocation.method(#importLegacyQueue, [filePath]), + returnValue: _i5.Future.value( + _i23.dummyValue( + this, + Invocation.method(#importLegacyQueue, [filePath]), + ), + ), + returnValueForMissingStub: _i5.Future.value( + _i23.dummyValue( + this, + Invocation.method(#importLegacyQueue, [filePath]), + ), + ), + ) + as _i5.Future); @override _i5.Future getQueuePathForSessionId(String? sessionId) => (super.noSuchMethod( - Invocation.method( - #getQueuePathForSessionId, - [sessionId], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + Invocation.method(#getQueuePathForSessionId, [sessionId]), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) + as _i5.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); @override void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); @override void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); @override void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], - ), - returnValueForMissingStub: null, - ); + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); } diff --git a/test/services/bulk_action_executor_test.dart b/test/services/bulk_action_executor_test.dart index 38389a7b..ff148f7e 100644 --- a/test/services/bulk_action_executor_test.dart +++ b/test/services/bulk_action_executor_test.dart @@ -149,8 +149,9 @@ void main() { expect(sessionProvider.markAsReadCalls, 2); - final undoableLogs = - executor.logs.where((l) => l.undoActionType != null).toList(); + final undoableLogs = executor.logs + .where((l) => l.undoActionType != null) + .toList(); expect(undoableLogs.length, 2); await executor.undoAll(); diff --git a/test/services/github_provider_test.dart b/test/services/github_provider_test.dart index 75139224..c13572cb 100644 --- a/test/services/github_provider_test.dart +++ b/test/services/github_provider_test.dart @@ -50,8 +50,12 @@ void main() { return http.Response('{}', 404); }); - provider = GithubProvider(settingsProvider, cacheService, - authService: authService, client: mockClient); + provider = GithubProvider( + settingsProvider, + cacheService, + authService: authService, + client: mockClient, + ); }); test('getPrStatus sends Authorization header with token', () async { @@ -61,13 +65,14 @@ void main() { if (request.url.path.contains('/pulls/123')) { if (request.headers['Authorization'] == 'token test_token') { return http.Response( - jsonEncode({ - 'state': 'open', - '_links': { - 'html': {'href': 'http://url'} - } - }), - 200); + jsonEncode({ + 'state': 'open', + '_links': { + 'html': {'href': 'http://url'}, + }, + }), + 200, + ); } else { return http.Response('Unauthorized', 401); } @@ -75,8 +80,12 @@ void main() { return http.Response('Not Found', 404); }); - provider = GithubProvider(settingsProvider, cacheService, - authService: authService, client: mockClient); + provider = GithubProvider( + settingsProvider, + cacheService, + authService: authService, + client: mockClient, + ); await provider.setApiKey('test_token'); // Ensure token is loaded final result = await provider.getPrStatus('owner', 'repo', '123'); @@ -94,8 +103,12 @@ void main() { return http.Response('{}', 200); }); - provider = GithubProvider(settingsProvider, cacheService, - authService: authService, client: mockClient); + provider = GithubProvider( + settingsProvider, + cacheService, + authService: authService, + client: mockClient, + ); // Token is null initially. final result = await provider.getPrStatus('owner', 'repo', '123'); @@ -116,8 +129,12 @@ void main() { return http.Response('Error', 400); }); - provider = GithubProvider(settingsProvider, cacheService, - authService: authService, client: mockClient); + provider = GithubProvider( + settingsProvider, + cacheService, + authService: authService, + client: mockClient, + ); await provider.setApiKey('diff_token'); final result = await provider.getDiff('owner', 'repo', '123'); @@ -138,8 +155,12 @@ void main() { return http.Response('Error', 400); }); - provider = GithubProvider(settingsProvider, cacheService, - authService: authService, client: mockClient); + provider = GithubProvider( + settingsProvider, + cacheService, + authService: authService, + client: mockClient, + ); await provider.setApiKey('patch_token'); final result = await provider.getPatch('owner', 'repo', '123'); @@ -155,17 +176,18 @@ void main() { if (request.headers['Authorization'] == 'token repo_token') { headerCorrect = true; return http.Response( - jsonEncode({ - 'name': 'repo', - 'id': 1, - 'private': false, - 'open_issues_count': 0, - 'fork': false, - 'default_branch': 'main', - 'description': 'desc', - 'language': 'Dart' - }), - 200); + jsonEncode({ + 'name': 'repo', + 'id': 1, + 'private': false, + 'open_issues_count': 0, + 'fork': false, + 'default_branch': 'main', + 'description': 'desc', + 'language': 'Dart', + }), + 200, + ); } // Handle branches call if (request.url.path.endsWith('/branches')) { @@ -174,8 +196,12 @@ void main() { return http.Response('Error', 400); }); - provider = GithubProvider(settingsProvider, cacheService, - authService: authService, client: mockClient); + provider = GithubProvider( + settingsProvider, + cacheService, + authService: authService, + client: mockClient, + ); await provider.setApiKey('repo_token'); final job = provider.createRepoDetailsJob('owner', 'repo'); @@ -187,8 +213,12 @@ void main() { test('createRepoDetailsJob throws if token is missing', () async { authService._token = null; - provider = GithubProvider(settingsProvider, cacheService, - authService: authService, client: mockClient); + provider = GithubProvider( + settingsProvider, + cacheService, + authService: authService, + client: mockClient, + ); final job = provider.createRepoDetailsJob('owner', 'repo'); diff --git a/test/services/source_provider_branches_test.dart b/test/services/source_provider_branches_test.dart index bf8ff54e..8f3d3f95 100644 --- a/test/services/source_provider_branches_test.dart +++ b/test/services/source_provider_branches_test.dart @@ -64,15 +64,18 @@ class MockGithubProvider extends Mock implements GithubProvider { @override void enqueue(GithubJob job) { // Execute immediately for testing purposes - job.action().then((result) { - job.result = result; - job.status = GithubJobStatus.completed; - job.completer.complete(); - }).catchError((e) { - job.status = GithubJobStatus.failed; - job.error = e.toString(); - job.completer.completeError(e); - }); + job + .action() + .then((result) { + job.result = result; + job.status = GithubJobStatus.completed; + job.completer.complete(); + }) + .catchError((e) { + job.status = GithubJobStatus.failed; + job.error = e.toString(); + job.completer.completeError(e); + }); } @override @@ -109,8 +112,9 @@ void main() { mockCacheService = MockCacheService(); mockGithubProvider = MockGithubProvider(); - when(mockCacheService.loadSources(any)) - .thenAnswer((_) async => >[]); + when( + mockCacheService.loadSources(any), + ).thenAnswer((_) async => >[]); when(mockCacheService.saveSources(any, any)).thenAnswer((_) async {}); provider.setCacheService(mockCacheService); @@ -125,25 +129,22 @@ void main() { isPrivate: false, branches: [julesBranch], ); - final source = Source( - name: 'source1', - id: 'id1', - githubRepo: oldRepo, - ); + final source = Source(name: 'source1', id: 'id1', githubRepo: oldRepo); final response = ListSourcesResponse( sources: [source], nextPageToken: null, ); - when(mockClient.listSources(pageToken: anyNamed('pageToken'))) - .thenAnswer((_) async => response); + when( + mockClient.listSources(pageToken: anyNamed('pageToken')), + ).thenAnswer((_) async => response); await provider.fetchSources(mockClient, authToken: 'auth_token'); // Setup GitHub provider to return "github-branch" final githubDetails = { 'repoName': 'repo', 'branches': [ - {'displayName': 'github-branch'} + {'displayName': 'github-branch'}, ], 'defaultBranch': 'main', 'repoId': 123, @@ -156,13 +157,15 @@ void main() { 'forkParent': null, }; - when(mockGithubProvider.getRepoDetails('owner', 'repo')) - .thenAnswer((_) async => githubDetails); + when( + mockGithubProvider.getRepoDetails('owner', 'repo'), + ).thenAnswer((_) async => githubDetails); // Act // We need to mock getSource to return the source (or a version of it) when(mockClient.getSource(source.name)).thenAnswer( - (_) async => source); // Return original source from Jules API + (_) async => source, + ); // Return original source from Jules API await provider.refreshSource( mockClient, @@ -173,8 +176,9 @@ void main() { // Verify final updatedSource = provider.items[0].data; - final branchNames = - updatedSource.githubRepo!.branches!.map((b) => b.displayName).toSet(); + final branchNames = updatedSource.githubRepo!.branches! + .map((b) => b.displayName) + .toSet(); expect(branchNames, containsAll(['jules-branch', 'github-branch'])); }); @@ -188,25 +192,22 @@ void main() { isPrivate: false, branches: [julesBranch], ); - final source = Source( - name: 'source1', - id: 'id1', - githubRepo: oldRepo, - ); + final source = Source(name: 'source1', id: 'id1', githubRepo: oldRepo); final response = ListSourcesResponse( sources: [source], nextPageToken: null, ); - when(mockClient.listSources(pageToken: anyNamed('pageToken'))) - .thenAnswer((_) async => response); + when( + mockClient.listSources(pageToken: anyNamed('pageToken')), + ).thenAnswer((_) async => response); await provider.fetchSources(mockClient, authToken: 'auth_token'); // Setup GitHub provider to return "github-branch" final githubDetails = { 'repoName': 'repo', 'branches': [ - {'displayName': 'github-branch'} + {'displayName': 'github-branch'}, ], 'defaultBranch': 'main', 'repoId': 123, @@ -228,8 +229,9 @@ void main() { // We need to simulate the job running. // In our mock enqueue, we execute it. - when(mockGithubProvider.createRepoDetailsJob('owner', 'repo')) - .thenReturn(job); + when( + mockGithubProvider.createRepoDetailsJob('owner', 'repo'), + ).thenReturn(job); // Act provider.queueAllSourcesGithubRefresh( @@ -247,8 +249,9 @@ void main() { // Verify final updatedSource = provider.items[0].data; - final branchNames = - updatedSource.githubRepo!.branches!.map((b) => b.displayName).toSet(); + final branchNames = updatedSource.githubRepo!.branches! + .map((b) => b.displayName) + .toSet(); expect(branchNames, containsAll(['jules-branch', 'github-branch'])); }); diff --git a/test/services/source_provider_persistence_test.dart b/test/services/source_provider_persistence_test.dart index 8f38c0a3..42ba19ad 100644 --- a/test/services/source_provider_persistence_test.dart +++ b/test/services/source_provider_persistence_test.dart @@ -80,8 +80,9 @@ void main() { mockCacheService = MockCacheService(); // Stub loadSources - when(mockCacheService.loadSources(any)) - .thenAnswer((_) async => >[]); + when( + mockCacheService.loadSources(any), + ).thenAnswer((_) async => >[]); // Stub saveSources when(mockCacheService.saveSources(any, any)).thenAnswer((_) async {}); @@ -93,14 +94,10 @@ void main() { test('fetchSources parses and saves options', () async { final options = { 'key': 'value', - 'nested': {'foo': 'bar'} + 'nested': {'foo': 'bar'}, }; final sources = [ - Source( - name: 'source1', - id: 'id1', - options: options, - ), + Source(name: 'source1', id: 'id1', options: options), ]; final response = ListSourcesResponse( sources: sources, @@ -129,7 +126,11 @@ void main() { test('refreshSource updates branches and preserves options', () async { final options = {'key': 'preserved'}; final oldRepo = GitHubRepo( - owner: 'owner', repo: 'repo', isPrivate: false, branches: []); + owner: 'owner', + repo: 'repo', + isPrivate: false, + branches: [], + ); final source = Source( name: 'source1', id: 'id1', @@ -145,13 +146,14 @@ void main() { sources: [source], nextPageToken: null, ); - when(mockClient.listSources(pageToken: anyNamed('pageToken'))) - .thenAnswer((_) async => response); + when( + mockClient.listSources(pageToken: anyNamed('pageToken')), + ).thenAnswer((_) async => response); await provider.fetchSources(mockClient, authToken: 'auth_token'); // Setup refresh final newBranches = [ - {'displayName': 'new-branch'} + {'displayName': 'new-branch'}, ]; final details = { 'repoName': 'repo', @@ -167,12 +169,17 @@ void main() { 'forkParent': null, }; - when(mockGithubProvider.getRepoDetails('owner', 'repo')) - .thenAnswer((_) async => details); + when( + mockGithubProvider.getRepoDetails('owner', 'repo'), + ).thenAnswer((_) async => details); // Act - await provider.refreshSource(mockClient, source, - authToken: 'auth_token', githubProvider: mockGithubProvider); + await provider.refreshSource( + mockClient, + source, + authToken: 'auth_token', + githubProvider: mockGithubProvider, + ); // Verify final updatedSource = provider.items[0].data; @@ -186,8 +193,9 @@ void main() { expect(updatedSource.options, equals(options)); // Verify save called - verify(mockCacheService.saveSources('auth_token', any)) - .called(greaterThan(1)); // Initial fetch + refresh + verify( + mockCacheService.saveSources('auth_token', any), + ).called(greaterThan(1)); // Initial fetch + refresh }); }); } diff --git a/test/unit/scheduler_preset_test.dart b/test/unit/scheduler_preset_test.dart index 7776f651..6cb31278 100644 --- a/test/unit/scheduler_preset_test.dart +++ b/test/unit/scheduler_preset_test.dart @@ -6,148 +6,201 @@ import 'package:flutter_jules/models/enums.dart'; void main() { group('SchedulerPreset', () { test('Standard preset has correct schedules', () { - final preset = - SchedulerPreset.presets.firstWhere((p) => p.name == 'Standard'); + final preset = SchedulerPreset.presets.firstWhere( + (p) => p.name == 'Standard', + ); final schedules = preset.schedulesFactory(); expect(schedules.length, 5); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 5 && - s.refreshPolicy == ListRefreshPolicy.quick), - isTrue); // On open (name not checked by logic but by human) + s.refreshPolicy == ListRefreshPolicy.quick, + ), + isTrue, + ); // On open (name not checked by logic but by human) expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 60 && - s.refreshPolicy == ListRefreshPolicy.full), - isTrue); + s.refreshPolicy == ListRefreshPolicy.full, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 5 && - s.refreshPolicy == ListRefreshPolicy.watched), - isTrue); + s.refreshPolicy == ListRefreshPolicy.watched, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 15 && - s.refreshPolicy == ListRefreshPolicy.quick), - isTrue); + s.refreshPolicy == ListRefreshPolicy.quick, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.taskType == RefreshTaskType.sendPendingMessages && - s.sendMessagesMode == SendMessagesMode.sendAllUntilFailure), - isTrue); + s.sendMessagesMode == SendMessagesMode.sendAllUntilFailure, + ), + isTrue, + ); }); test('Battery Saver preset has correct schedules', () { - final preset = - SchedulerPreset.presets.firstWhere((p) => p.name == 'Battery Saver'); + final preset = SchedulerPreset.presets.firstWhere( + (p) => p.name == 'Battery Saver', + ); final schedules = preset.schedulesFactory(); expect(schedules.length, 4); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 240 && - s.refreshPolicy == ListRefreshPolicy.full), - isTrue); + s.refreshPolicy == ListRefreshPolicy.full, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 15 && - s.refreshPolicy == ListRefreshPolicy.watched), - isTrue); + s.refreshPolicy == ListRefreshPolicy.watched, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 60 && - s.refreshPolicy == ListRefreshPolicy.quick), - isTrue); - expect( - schedules - .any((s) => s.taskType == RefreshTaskType.sendPendingMessages), - isTrue); + s.refreshPolicy == ListRefreshPolicy.quick, + ), + isTrue, + ); + expect( + schedules.any((s) => s.taskType == RefreshTaskType.sendPendingMessages), + isTrue, + ); }); test('Daily preset has correct schedules', () { - final preset = - SchedulerPreset.presets.firstWhere((p) => p.name == 'Daily'); + final preset = SchedulerPreset.presets.firstWhere( + (p) => p.name == 'Daily', + ); final schedules = preset.schedulesFactory(); expect(schedules.length, 2); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 1440 && - s.refreshPolicy == ListRefreshPolicy.full), - isTrue); - expect( - schedules - .any((s) => s.taskType == RefreshTaskType.sendPendingMessages), - isTrue); + s.refreshPolicy == ListRefreshPolicy.full, + ), + isTrue, + ); + expect( + schedules.any((s) => s.taskType == RefreshTaskType.sendPendingMessages), + isTrue, + ); }); test('Never (Manual Only) preset has correct schedules', () { - final preset = SchedulerPreset.presets - .firstWhere((p) => p.name == 'Never (Manual Only)'); + final preset = SchedulerPreset.presets.firstWhere( + (p) => p.name == 'Never (Manual Only)', + ); final schedules = preset.schedulesFactory(); expect(schedules.length, 1); expect( - schedules - .any((s) => s.taskType == RefreshTaskType.sendPendingMessages), - isTrue); + schedules.any((s) => s.taskType == RefreshTaskType.sendPendingMessages), + isTrue, + ); expect( - schedules.any((s) => s.taskType == RefreshTaskType.refresh), isFalse); + schedules.any((s) => s.taskType == RefreshTaskType.refresh), + isFalse, + ); }); test('Hourly preset has correct schedules', () { - final preset = - SchedulerPreset.presets.firstWhere((p) => p.name == 'Hourly'); + final preset = SchedulerPreset.presets.firstWhere( + (p) => p.name == 'Hourly', + ); final schedules = preset.schedulesFactory(); expect(schedules.length, 4); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 60 && - s.refreshPolicy == ListRefreshPolicy.full), - isTrue); + s.refreshPolicy == ListRefreshPolicy.full, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 10 && - s.refreshPolicy == ListRefreshPolicy.watched), - isTrue); + s.refreshPolicy == ListRefreshPolicy.watched, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 30 && - s.refreshPolicy == ListRefreshPolicy.quick), - isTrue); - expect( - schedules - .any((s) => s.taskType == RefreshTaskType.sendPendingMessages), - isTrue); + s.refreshPolicy == ListRefreshPolicy.quick, + ), + isTrue, + ); + expect( + schedules.any((s) => s.taskType == RefreshTaskType.sendPendingMessages), + isTrue, + ); }); test('Aggressive preset has correct schedules', () { - final preset = - SchedulerPreset.presets.firstWhere((p) => p.name == 'Aggressive'); + final preset = SchedulerPreset.presets.firstWhere( + (p) => p.name == 'Aggressive', + ); final schedules = preset.schedulesFactory(); expect(schedules.length, 4); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 15 && - s.refreshPolicy == ListRefreshPolicy.full), - isTrue); + s.refreshPolicy == ListRefreshPolicy.full, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 2 && - s.refreshPolicy == ListRefreshPolicy.watched), - isTrue); + s.refreshPolicy == ListRefreshPolicy.watched, + ), + isTrue, + ); expect( - schedules.any((s) => + schedules.any( + (s) => s.intervalInMinutes == 5 && - s.refreshPolicy == ListRefreshPolicy.quick), - isTrue); - expect( - schedules - .any((s) => s.taskType == RefreshTaskType.sendPendingMessages), - isTrue); + s.refreshPolicy == ListRefreshPolicy.quick, + ), + isTrue, + ); + expect( + schedules.any((s) => s.taskType == RefreshTaskType.sendPendingMessages), + isTrue, + ); }); }); } diff --git a/test/unit/source_enrichment_test.dart b/test/unit/source_enrichment_test.dart index be01b051..9780b3d8 100644 --- a/test/unit/source_enrichment_test.dart +++ b/test/unit/source_enrichment_test.dart @@ -62,15 +62,18 @@ class MockGithubProvider extends Mock implements GithubProvider { void enqueue(GithubJob job) { // Execute immediately job.status = GithubJobStatus.running; - job.action().then((result) { - job.result = result; - job.status = GithubJobStatus.completed; - job.completer.complete(); - }).catchError((e) { - job.status = GithubJobStatus.failed; - job.error = e.toString(); - job.completer.completeError(e); - }); + job + .action() + .then((result) { + job.result = result; + job.status = GithubJobStatus.completed; + job.completer.complete(); + }) + .catchError((e) { + job.status = GithubJobStatus.failed; + job.error = e.toString(); + job.completer.completeError(e); + }); } } diff --git a/test/widget/new_session_dialog_branch_logic_test.dart b/test/widget/new_session_dialog_branch_logic_test.dart index a9a0e66d..ba08f624 100644 --- a/test/widget/new_session_dialog_branch_logic_test.dart +++ b/test/widget/new_session_dialog_branch_logic_test.dart @@ -150,14 +150,17 @@ void main() { SharedPreferences.setMockInitialValues({}); }); - testWidgets('NewSessionDialog branch selection logic', - (WidgetTester tester) async { + testWidgets('NewSessionDialog branch selection logic', ( + WidgetTester tester, + ) async { // Set screen size to avoid overflow tester.view.physicalSize = const Size(1600, 1200); tester.view.devicePixelRatio = 1.0; - final meta = - CacheMetadata(firstSeen: DateTime.now(), lastRetrieved: DateTime.now()); + final meta = CacheMetadata( + firstSeen: DateTime.now(), + lastRetrieved: DateTime.now(), + ); // 1. Setup Source with NO branches final sourceNoBranches = Source( @@ -215,23 +218,28 @@ void main() { providers: [ ChangeNotifierProvider.value(value: MockAuthProvider()), ChangeNotifierProvider.value( - value: mockSourceProvider), + value: mockSourceProvider, + ), ChangeNotifierProvider.value( - value: MockGithubProvider()), + value: MockGithubProvider(), + ), ChangeNotifierProvider.value( - value: MockSessionProvider()), + value: MockSessionProvider(), + ), ChangeNotifierProvider.value( - value: mockSettingsProvider), + value: mockSettingsProvider, + ), ChangeNotifierProvider.value( - value: MockMessageQueueProvider()), + value: MockMessageQueueProvider(), + ), ChangeNotifierProvider.value( - value: MockPromptTemplateProvider()), + value: MockPromptTemplateProvider(), + ), ChangeNotifierProvider.value( - value: MockShortcutRegistry()), + value: MockShortcutRegistry(), + ), ], - child: const MaterialApp( - home: NewSessionDialog(), - ), + child: const MaterialApp(home: NewSessionDialog()), ), ); @@ -240,7 +248,9 @@ void main() { // Select source with NO branches (repo1) await tester.enterText( - find.widgetWithText(TextField, 'Repository'), 'repo1'); + find.widgetWithText(TextField, 'Repository'), + 'repo1', + ); await tester.pumpAndSettle(); // Tap the item in overlay @@ -252,38 +262,53 @@ void main() { final controller = (tester.widget(branchField) as TextField).controller; // Expectation 1: If no default branch (and no branches), it should be empty. - expect(controller!.text, isEmpty, - reason: "Branch should be empty for source with no branches"); + expect( + controller!.text, + isEmpty, + reason: "Branch should be empty for source with no branches", + ); // Expectation 2: It should show suggestions 'main', 'master' if no branches. // Trigger suggestions await tester.tap(branchField); await tester.pumpAndSettle(); expect(find.text('main'), findsOneWidget, reason: "Should suggest main"); - expect(find.text('master'), findsOneWidget, - reason: "Should suggest master"); + expect( + find.text('master'), + findsOneWidget, + reason: "Should suggest master", + ); // Now select source with branches but NO default (repo2) await tester.enterText( - find.widgetWithText(TextField, 'Repository'), 'repo2'); + find.widgetWithText(TextField, 'Repository'), + 'repo2', + ); await tester.pumpAndSettle(); await tester.tap(find.text('owner/repo2')); await tester.pumpAndSettle(); // Expectation 3: Branch should be empty (no default branch). - expect(controller.text, isEmpty, - reason: - "Branch should be empty for source with branches but no default"); + expect( + controller.text, + isEmpty, + reason: "Branch should be empty for source with branches but no default", + ); // Now select source WITH default (repo3) await tester.enterText( - find.widgetWithText(TextField, 'Repository'), 'repo3'); + find.widgetWithText(TextField, 'Repository'), + 'repo3', + ); await tester.pumpAndSettle(); await tester.tap(find.text('owner/repo3')); await tester.pumpAndSettle(); // Expectation 4: Branch should be 'main' - expect(controller.text, 'main', - reason: "Branch should be main for source with default branch"); + expect( + controller.text, + 'main', + reason: "Branch should be main for source with default branch", + ); }); } diff --git a/test/widget/session_detail_screen_pending_test.dart b/test/widget/session_detail_screen_pending_test.dart index e339e190..ea37f8d9 100644 --- a/test/widget/session_detail_screen_pending_test.dart +++ b/test/widget/session_detail_screen_pending_test.dart @@ -161,8 +161,7 @@ class MockCacheService extends Mock implements CacheService { Future loadSessionDetails( String? token, String? sessionId, - ) async => - null; + ) async => null; } class MockTimerService extends Mock implements TimerService {} diff --git a/test/widget/session_metadata_dialog_test.dart b/test/widget/session_metadata_dialog_test.dart index c278f137..defcd088 100644 --- a/test/widget/session_metadata_dialog_test.dart +++ b/test/widget/session_metadata_dialog_test.dart @@ -4,8 +4,9 @@ import 'package:flutter_jules/models.dart'; import 'package:flutter_jules/ui/widgets/session_metadata_dialog.dart'; void main() { - testWidgets('SessionMetadataDialog shows raw content when provided', - (WidgetTester tester) async { + testWidgets('SessionMetadataDialog shows raw content when provided', ( + WidgetTester tester, + ) async { final session = Session( id: 'test_session', name: 'Test Session', @@ -29,8 +30,9 @@ void main() { expect(find.textContaining('"key": "value"'), findsOneWidget); }); - testWidgets('SessionMetadataDialog shows raw content as-is if invalid JSON', - (WidgetTester tester) async { + testWidgets('SessionMetadataDialog shows raw content as-is if invalid JSON', ( + WidgetTester tester, + ) async { final session = Session( id: 'test_session', name: 'Test Session', diff --git a/test/widget/source_metadata_dialog_test.dart b/test/widget/source_metadata_dialog_test.dart index 7c1b02d7..20fdf5ed 100644 --- a/test/widget/source_metadata_dialog_test.dart +++ b/test/widget/source_metadata_dialog_test.dart @@ -4,8 +4,9 @@ import 'package:flutter_jules/models.dart'; import 'package:flutter_jules/ui/widgets/source_metadata_dialog.dart'; void main() { - testWidgets('SourceMetadataDialog shows source details and raw content', - (WidgetTester tester) async { + testWidgets('SourceMetadataDialog shows source details and raw content', ( + WidgetTester tester, + ) async { final source = Source( id: 'test_source', name: 'Test Source',