Skip to content

Commit

Permalink
Fix project warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jsondergaard committed Sep 1, 2024
1 parent 4da95ba commit ab161b9
Show file tree
Hide file tree
Showing 125 changed files with 969 additions and 984 deletions.
2 changes: 1 addition & 1 deletion lib/api/account_api.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:async';

import 'package:rxdart/rxdart.dart';
import 'package:weekplanner/http/http.dart';
import 'package:weekplanner/models/enums/role_enum.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:weekplanner/persistence/persistence.dart';
import 'package:rxdart/rxdart.dart';

/// Hello world
/// All Account Endpoints
Expand Down
2 changes: 1 addition & 1 deletion lib/api/connectivity_api.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';

import 'package:weekplanner/api/status_api.dart';
import 'package:connectivity/connectivity.dart';
import 'package:weekplanner/api/status_api.dart';

/// Connectivity methods
class ConnectivityApi {
Expand Down
2 changes: 1 addition & 1 deletion lib/api/errorcode_translator.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:weekplanner/api/api_exception.dart';
import 'package:weekplanner/models/enums/error_key.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/widgets/giraf_notify_dialog.dart';

/// Class for translating error codes to readable messages for the users
Expand Down
2 changes: 1 addition & 1 deletion lib/api/pictogram_api.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:weekplanner/http/http.dart';
import 'package:weekplanner/models/pictogram_model.dart';
import 'package:flutter/material.dart';

/// Pictogram endpoints
class PictogramApi {
Expand Down
14 changes: 7 additions & 7 deletions lib/api/user_api.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:weekplanner/http/http.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:weekplanner/models/settings_model.dart';
import 'package:weekplanner/offline_database/offline_db_handler.dart';
import 'package:flutter/material.dart';

import 'connectivity_api.dart';

Expand Down Expand Up @@ -103,20 +103,20 @@ class UserApi {
/// Deletes the user icon for a given user
///
/// [id] Identifier for the user to which the icon should be deleted
// TODO: Offline mode needs to be implemented
// TODO(null): Offline mode needs to be implemented
Stream<bool> deleteIcon(String id) =>
_http.delete('/$id/icon').map((Response res) => res.statusCode() == 200);

/// Gets the raw user icon for a given user
///
/// [id] Identifier of the GirafUser to get icon for
// TODO: Offline mode needs to be implemented
// TODO(null): Offline mode needs to be implemented
Stream<Image> getIcon(String id) => _http
.get('/$id/icon/raw')
.map((Response res) => Image.memory(res.response.bodyBytes));

/// NYI
// TODO: Offline mode needs to be implemented
// TODO(null): Offline mode needs to be implemented
Stream<bool>? updateIcon() {
// TODO(boginw): implement this
return null;
Expand All @@ -126,7 +126,7 @@ class UserApi {
/// be a guardian
///
/// [id] Identifier of the GirafUser to get citizens for
// TODO: Offline mode needs to be implemented
// TODO(null): Offline mode needs to be implemented
Stream<List<DisplayNameModel>> getCitizens(String id) => _http
.get('/$id/citizens')
.map((Response res) => List<Map<String, dynamic>>.from(res.json['data'])
Expand All @@ -137,7 +137,7 @@ class UserApi {
/// provided id.
///
/// [id] Identifier for the citizen to get guardians for
/// TODO: Offline mode needs to be implemented
// TODO(null): Offline mode needs to be implemented
Stream<List<DisplayNameModel>> getGuardians(String id) => _http
.get('/$id/guardians')
.map((Response res) => List<Map<String, dynamic>>.from(res.json['data'])
Expand All @@ -149,7 +149,7 @@ class UserApi {
///
/// [guardianId] The guardian
/// [citizenId] The citizen to be added to the guardian
/// TODO: Offline mode needs to be implemented
// TODO(null): Offline mode needs to be implemented
Stream<bool> addCitizenToGuardian(String guardianId, String citizenId) =>
_http
.post('/$guardianId/citizens/$citizenId')
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/weekplan_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ class WeekplanBloc extends BlocBase {
final List<ActivityModel> localMarkedActivities = _markedActivities!.value;

localMarkedActivities.add(activityModel);
_markedActivities!.add(localMarkedActivities);
_markedActivities.add(localMarkedActivities);
}

/// Removes a marked activity from the stream
void removeMarkedActivity(ActivityModel activityModel) {
final List<ActivityModel> localMarkedActivities = _markedActivities!.value;

localMarkedActivities.remove(activityModel);
_markedActivities!.add(localMarkedActivities);
_markedActivities.add(localMarkedActivities);
}

/// Clears marked activities
Expand Down
4 changes: 4 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ void main() async {
}
}

/// The main application widget for the Giraf app.
class Giraf extends StatelessWidget {
/// Constructs a new instance of the Giraf widget.
const Giraf({Key? key}) : super(key: key);

@override
Expand All @@ -38,7 +40,9 @@ class Giraf extends StatelessWidget {
}
}

/// A widget that wraps the authentication logic.
class AuthWrapper extends StatefulWidget {
/// Constructs a new instance of the AuthWrapper widget.
const AuthWrapper({Key? key}) : super(key: key);

@override
Expand Down
8 changes: 4 additions & 4 deletions lib/offline_database/offline_db_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class OfflineDbHandler {

/// Retry sending the failed changes to the online database
Future<void> retryFailedTransactions() async {
// TODO: Is not implemented correctly
// TODO(null): Is not implemented correctly
/*final Database db = await database;
final List<Map<String, dynamic>> dbRes =
Expand Down Expand Up @@ -599,19 +599,19 @@ class OfflineDbHandler {

/// Return list of citizens from database based on guardian id
Future<List<DisplayNameModel>> getCitizens(String id) async {
// TODO: This needs to be implemented
// TODO(null): This needs to be implemented
throw UnimplementedError();
}

/// Return list of guardians from database based on citizen id
Future<List<DisplayNameModel>> getGuardians(String id) async {
// TODO: This needs to be implemented
// TODO(null): This needs to be implemented
throw UnimplementedError();
}

/// Add a [guardianId] to a [citizenId]
Future<bool> addCitizenToGuardian(String guardianId, String citizenId) async {
// TODO: This needs to be implemented
// TODO(null): This needs to be implemented
throw UnimplementedError();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/persistence/persistence_client.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:weekplanner/persistence/persistence.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:weekplanner/persistence/persistence.dart';

/// Provides persistence capabilities
class PersistenceClient implements Persistence {
Expand Down
6 changes: 3 additions & 3 deletions lib/screens/choose_citizen_screen.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'dart:async';

import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/enums/role_enum.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/auth_bloc.dart';
import 'package:weekplanner/blocs/choose_citizen_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/enums/app_bar_icons_enum.dart';
import 'package:weekplanner/models/enums/role_enum.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/screens/new_citizen_screen.dart';
import 'package:weekplanner/screens/settings_screens/user_settings_screen.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/copy_resolve_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import 'dart:async';

import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/copy_resolve_bloc.dart';
import 'package:weekplanner/blocs/copy_weekplan_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/screens/weekplan_selector_screen.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
Expand Down
5 changes: 3 additions & 2 deletions lib/screens/copy_to_citizens_screen.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// ignore_for_file: lines_longer_than_80_chars

import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/copy_weekplan_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/enums/app_bar_icons_enum.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:weekplanner/screens/copy_resolve_screen.dart';
import 'package:weekplanner/screens/weekplan_selector_screen.dart';
import 'package:weekplanner/widgets/citizen_avatar_widget.dart';
Expand All @@ -14,6 +14,7 @@ import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
import 'package:weekplanner/widgets/giraf_button_widget.dart';
import 'package:weekplanner/widgets/giraf_confirm_dialog.dart';
import 'package:weekplanner/widgets/giraf_notify_dialog.dart';

import '../routes.dart';
import '../style/custom_color.dart' as theme;

Expand Down
4 changes: 2 additions & 2 deletions lib/screens/edit_weekplan_screen.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/edit_weekplan_bloc.dart';
import 'package:weekplanner/blocs/weekplan_selector_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/exceptions/custom_exceptions.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
import 'package:weekplanner/widgets/giraf_button_widget.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/login_screen.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:async';
import 'dart:io';

import 'package:weekplanner/api/api_exception.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:weekplanner/api/api_exception.dart';
import 'package:weekplanner/blocs/auth_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/exceptions/custom_exceptions.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/new_citizen_screen.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'dart:io';
import 'dart:typed_data';

import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/api/errorcode_translator.dart';
import 'package:weekplanner/blocs/new_citizen_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/screens/new_pictogram_password_screen.dart';
import 'package:weekplanner/style/font_size.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/new_pictogram_password_screen.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:weekplanner/api/api.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:weekplanner/api/api.dart';
import 'package:weekplanner/api/errorcode_translator.dart';
import 'package:weekplanner/blocs/new_pictogram_password_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/style/custom_color.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
Expand Down
6 changes: 3 additions & 3 deletions lib/screens/new_weekplan_screen.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:weekplanner/models/week_name_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/new_weekplan_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/week_model.dart';
import 'package:weekplanner/models/week_name_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
import 'package:weekplanner/widgets/giraf_button_widget.dart';
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/pictogram_login_screen.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:weekplanner/api/api.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/api/api.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/screens/login_screen.dart';
import 'package:weekplanner/style/font_size.dart';
import 'package:weekplanner/widgets/pictogram_password_widgets/pictogram_password_widget.dart';

import '../di.dart';
import '../style/custom_color.dart' as theme;
import '../style/custom_color.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/pictogram_search_screen.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/pictogram_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/pictogram_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/pictogram_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/screens/upload_image_from_phone_screen.dart';
import 'package:weekplanner/widgets/bottom_app_bar_button_widget.dart';
Expand Down
6 changes: 4 additions & 2 deletions lib/screens/settings_screens/change_password_screen.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// ignore_for_file: must_be_immutable, public_member_api_docs

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:weekplanner/api/api.dart';
import 'package:weekplanner/api/api_exception.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/auth_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/enums/app_bar_icons_enum.dart';
import 'package:weekplanner/style/font_size.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
import 'package:weekplanner/widgets/giraf_notify_dialog.dart';

import '../../style/custom_color.dart' as theme;

/// Screen for changing password
Expand Down
8 changes: 5 additions & 3 deletions lib/screens/settings_screens/change_username_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:weekplanner/api/api.dart';
import 'package:weekplanner/api/api_exception.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/auth_bloc.dart';
import 'package:weekplanner/blocs/settings_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/giraf_user_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/style/font_size.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
import 'package:weekplanner/widgets/giraf_button_widget.dart';
import 'package:weekplanner/widgets/giraf_notify_dialog.dart';
import 'package:weekplanner/widgets/giraf_title_header.dart';

import '../../style/custom_color.dart' as theme;

/// Change username screen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/settings_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/settings_bloc.dart';
import 'package:weekplanner/di.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/settings_model.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/style/standard_week_colors.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/settings_bloc.dart';
import 'package:weekplanner/models/displayname_model.dart';
import 'package:weekplanner/models/enums/complete_mark_enum.dart';
import 'package:weekplanner/models/settings_model.dart';
import 'package:flutter/material.dart';
import 'package:weekplanner/blocs/settings_bloc.dart';
import 'package:weekplanner/routes.dart';
import 'package:weekplanner/widgets/giraf_app_bar_widget.dart';
import 'package:weekplanner/widgets/settings_widgets/settings_section.dart';
Expand Down
Loading

0 comments on commit ab161b9

Please sign in to comment.