fix: resolve all flutter analyze warnings and infos
- app.dart: add braces to single-statement if body - briefing_api.dart: escape <id> in doc comment (unintended HTML) - notes_api.dart, tasks_api.dart, projects_api.dart: use null-aware map elements (?'key': value) instead of if-null guards - task_edit_screen.dart: remove unused tasks_api.dart import - task_edit_screen.dart, project_selector.dart: suppress deprecated_member_use on DropdownButtonFormField.value (value is the controlled-widget param; switching to initialValue would break current-selection display) - project_selector.dart: use _ instead of __ for ignored error params
This commit is contained in:
+1
-1
@@ -371,7 +371,7 @@ class _QuickCaptureBarState extends ConsumerState<_QuickCaptureBar> {
|
|||||||
|
|
||||||
String _hintForLocation(String location) {
|
String _hintForLocation(String location) {
|
||||||
if (location.startsWith(Routes.library) &&
|
if (location.startsWith(Routes.library) &&
|
||||||
location.contains('tasks')) return 'Add a task…';
|
location.contains('tasks')) { return 'Add a task…'; }
|
||||||
if (location.startsWith(Routes.conversations)) return 'Ask Fabled…';
|
if (location.startsWith(Routes.conversations)) return 'Ask Fabled…';
|
||||||
return 'Capture a note…';
|
return 'Capture a note…';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class BriefingApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// GET /api/briefing/conversations/<id>/messages
|
/// GET /api/briefing/conversations/`<id>`/messages
|
||||||
Future<List<Message>> getMessages(int convId) async {
|
Future<List<Message>> getMessages(int convId) async {
|
||||||
try {
|
try {
|
||||||
final response =
|
final response =
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class NotesApi {
|
|||||||
'title': title,
|
'title': title,
|
||||||
'body': body,
|
'body': body,
|
||||||
'tags': tags,
|
'tags': tags,
|
||||||
if (projectId != null) 'project_id': projectId,
|
?'project_id': projectId,
|
||||||
});
|
});
|
||||||
return Note.fromJson(response.data as Map<String, dynamic>);
|
return Note.fromJson(response.data as Map<String, dynamic>);
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
@@ -59,7 +59,7 @@ class NotesApi {
|
|||||||
'title': title,
|
'title': title,
|
||||||
'body': body,
|
'body': body,
|
||||||
'tags': tags,
|
'tags': tags,
|
||||||
if (clearProject) 'project_id': null else if (projectId != null) 'project_id': projectId,
|
if (clearProject) 'project_id': null else ?'project_id': projectId,
|
||||||
});
|
});
|
||||||
return Note.fromJson(response.data as Map<String, dynamic>);
|
return Note.fromJson(response.data as Map<String, dynamic>);
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class ProjectsApi {
|
|||||||
if (description != null && description.isNotEmpty)
|
if (description != null && description.isNotEmpty)
|
||||||
'description': description,
|
'description': description,
|
||||||
if (goal != null && goal.isNotEmpty) 'goal': goal,
|
if (goal != null && goal.isNotEmpty) 'goal': goal,
|
||||||
if (color != null) 'color': color,
|
?'color': color,
|
||||||
});
|
});
|
||||||
return Project.fromJson(response.data as Map<String, dynamic>);
|
return Project.fromJson(response.data as Map<String, dynamic>);
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ class TasksApi {
|
|||||||
'status': status.value,
|
'status': status.value,
|
||||||
'priority': priority.value,
|
'priority': priority.value,
|
||||||
'due_date': dueDate?.toIso8601String(),
|
'due_date': dueDate?.toIso8601String(),
|
||||||
if (projectId != null) 'project_id': projectId,
|
?'project_id': projectId,
|
||||||
if (parentId != null) 'parent_id': parentId,
|
?'parent_id': parentId,
|
||||||
});
|
});
|
||||||
return Task.fromJson(response.data as Map<String, dynamic>);
|
return Task.fromJson(response.data as Map<String, dynamic>);
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:go_router/go_router.dart';
|
|||||||
|
|
||||||
import '../../core/constants.dart';
|
import '../../core/constants.dart';
|
||||||
import '../../core/exceptions.dart';
|
import '../../core/exceptions.dart';
|
||||||
import '../../data/api/tasks_api.dart';
|
|
||||||
import '../../data/models/task.dart';
|
import '../../data/models/task.dart';
|
||||||
import '../../providers/api_client_provider.dart';
|
import '../../providers/api_client_provider.dart';
|
||||||
import '../../providers/tasks_provider.dart';
|
import '../../providers/tasks_provider.dart';
|
||||||
@@ -239,6 +238,7 @@ class _TaskEditScreenState extends ConsumerState<TaskEditScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
DropdownButtonFormField<TaskStatus>(
|
DropdownButtonFormField<TaskStatus>(
|
||||||
|
// ignore: deprecated_member_use
|
||||||
value: _status,
|
value: _status,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Status',
|
labelText: 'Status',
|
||||||
@@ -253,6 +253,7 @@ class _TaskEditScreenState extends ConsumerState<TaskEditScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
DropdownButtonFormField<TaskPriority>(
|
DropdownButtonFormField<TaskPriority>(
|
||||||
|
// ignore: deprecated_member_use
|
||||||
value: _priority,
|
value: _priority,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Priority',
|
labelText: 'Priority',
|
||||||
|
|||||||
@@ -23,12 +23,13 @@ class ProjectSelector extends ConsumerWidget {
|
|||||||
|
|
||||||
return projectsAsync.when(
|
return projectsAsync.when(
|
||||||
loading: () => const LinearProgressIndicator(),
|
loading: () => const LinearProgressIndicator(),
|
||||||
error: (_, __) => const SizedBox.shrink(),
|
error: (_, _) => const SizedBox.shrink(),
|
||||||
data: (projects) {
|
data: (projects) {
|
||||||
final active =
|
final active =
|
||||||
projects.where((p) => p.status == 'active').toList();
|
projects.where((p) => p.status == 'active').toList();
|
||||||
|
|
||||||
return DropdownButtonFormField<int?>(
|
return DropdownButtonFormField<int?>(
|
||||||
|
// ignore: deprecated_member_use
|
||||||
value: value,
|
value: value,
|
||||||
decoration: decoration ??
|
decoration: decoration ??
|
||||||
const InputDecoration(
|
const InputDecoration(
|
||||||
|
|||||||
Reference in New Issue
Block a user