Skip to content

Commit cf7f267

Browse files
Fix more warnings.
Add camera touch controls. It only works left-right for some reason, not sure why.
1 parent f9de1d7 commit cf7f267

File tree

13 files changed

+55
-36
lines changed

13 files changed

+55
-36
lines changed

analysis_options.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ linter:
1313
rules:
1414
always_put_required_named_parameters_first: true
1515
avoid_bool_literals_in_conditional_expressions: true
16+
# TODO: Enable this when we set up proper error handling
17+
avoid_catches_without_on_clauses: false
1618
avoid_classes_with_only_static_members: false
19+
# TODO: Enable this when we set up proper error handling
20+
avoid_dynamic_calls: false
1721
avoid_field_initializers_in_const_classes: true
1822
avoid_function_literals_in_foreach_calls: true
1923
avoid_positional_boolean_parameters: true

lib/authentication/service/auth_provider.dart

+5-2
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,13 @@ class AuthProvider with ChangeNotifier {
174174
User get currentUserFromCache => _currentUser;
175175

176176
Future<bool> signInAnonymously() async {
177-
return FirebaseAuth.instance.signInAnonymously().catchError((dynamic e) {
177+
try {
178+
await FirebaseAuth.instance.signInAnonymously();
179+
return true;
180+
} catch (e) {
178181
_errorHandler(e);
179182
return false;
180-
}).then((_) => true);
183+
}
181184
}
182185

183186
Future<bool> changePassword(String password) async {

lib/generated/l10n.dart

+10-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/pages/class_feedback/service/feedback_provider.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import 'package:acs_upb_mobile/pages/classes/model/class.dart';
21
import 'package:cloud_firestore/cloud_firestore.dart';
32
import 'package:flutter/cupertino.dart';
43

54
import '../../../generated/l10n.dart';
65
import '../../../resources/locale_provider.dart';
76
import '../../../widgets/toast.dart';
7+
import '../../classes/model/class.dart';
88
import '../../people/model/person.dart';
99
import '../model/class_feedback_answer.dart';
1010
import '../model/questions/question.dart';

lib/pages/class_feedback/view/class_feedback_checklist.dart

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import 'package:acs_upb_mobile/authentication/service/auth_provider.dart';
2-
import 'package:acs_upb_mobile/pages/class_feedback/service/feedback_provider.dart';
3-
import 'package:acs_upb_mobile/pages/class_feedback/view/class_feedback_view.dart';
4-
import 'package:acs_upb_mobile/pages/classes/model/class.dart';
5-
import 'package:acs_upb_mobile/pages/classes/service/class_provider.dart';
6-
import 'package:acs_upb_mobile/widgets/error_page.dart';
7-
import 'package:acs_upb_mobile/widgets/scaffold.dart';
8-
import 'package:acs_upb_mobile/widgets/toast.dart';
91
import 'package:flutter/cupertino.dart';
10-
import 'package:acs_upb_mobile/generated/l10n.dart';
112
import 'package:flutter/material.dart';
123
import 'package:provider/provider.dart';
134

5+
import '../../../authentication/service/auth_provider.dart';
6+
import '../../../generated/l10n.dart';
7+
import '../../../widgets/error_page.dart';
8+
import '../../../widgets/scaffold.dart';
9+
import '../../../widgets/toast.dart';
10+
import '../../classes/model/class.dart';
11+
import '../../classes/service/class_provider.dart';
12+
import '../service/feedback_provider.dart';
13+
import 'class_feedback_view.dart';
14+
1415
class ClassFeedbackChecklist extends StatefulWidget {
1516
const ClassFeedbackChecklist({Key key, this.classes}) : super(key: key);
1617
final Set<ClassHeader> classes;

lib/pages/classes/model/class.dart

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ extension ShortcutTypeExtension on ShortcutType {
1414
return S.current.shortcutTypeClassbook;
1515
case ShortcutType.resource:
1616
return S.current.shortcutTypeResource;
17+
case ShortcutType.other:
18+
return S.current.shortcutTypeOther;
1719
}
1820
return S.current.shortcutTypeOther;
1921
}

lib/pages/classes/view/class_view.dart

+2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ class _ClassViewState extends State<ClassView> {
193193
return FeatherIcons.book;
194194
case ShortcutType.resource:
195195
return Icons.insert_drive_file_outlined;
196+
case ShortcutType.other:
197+
return FeatherIcons.globe;
196198
}
197199
return FeatherIcons.globe;
198200
}

lib/pages/classes/view/classes_page.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import 'package:acs_upb_mobile/pages/class_feedback/view/class_feedback_checklist.dart';
2-
import 'package:acs_upb_mobile/resources/remote_config.dart';
31
import 'package:flutter/material.dart';
42
import 'package:pedantic/pedantic.dart';
53
import 'package:provider/provider.dart';
64

75
import '../../../authentication/service/auth_provider.dart';
86
import '../../../generated/l10n.dart';
7+
import '../../../resources/remote_config.dart';
98
import '../../../widgets/class_icon.dart';
109
import '../../../widgets/error_page.dart';
1110
import '../../../widgets/icon_text.dart';
1211
import '../../../widgets/scaffold.dart';
1312
import '../../../widgets/spoiler.dart';
13+
import '../../class_feedback/view/class_feedback_checklist.dart';
1414
import '../model/class.dart';
1515
import '../service/class_provider.dart';
1616
import 'class_view.dart';

lib/pages/home/feedback_nudge.dart

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import 'package:acs_upb_mobile/authentication/service/auth_provider.dart';
2-
import 'package:acs_upb_mobile/pages/class_feedback/service/feedback_provider.dart';
3-
import 'package:acs_upb_mobile/pages/class_feedback/view/class_feedback_checklist.dart';
4-
import 'package:acs_upb_mobile/pages/classes/model/class.dart';
5-
import 'package:acs_upb_mobile/pages/classes/service/class_provider.dart';
61
import 'package:flutter/cupertino.dart';
7-
import 'package:acs_upb_mobile/generated/l10n.dart';
82
import 'package:flutter/material.dart';
93
import 'package:provider/provider.dart';
104

5+
import '../../authentication/service/auth_provider.dart';
6+
import '../../generated/l10n.dart';
7+
import '../class_feedback/service/feedback_provider.dart';
8+
import '../class_feedback/view/class_feedback_checklist.dart';
9+
import '../classes/model/class.dart';
10+
import '../classes/service/class_provider.dart';
11+
1112
class FeedbackNudge extends StatefulWidget {
1213
@override
1314
_FeedbackNudgeState createState() => _FeedbackNudgeState();

lib/pages/home/home_page.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import 'package:acs_upb_mobile/pages/home/feedback_nudge.dart';
2-
import 'package:acs_upb_mobile/resources/remote_config.dart';
31
import 'package:flutter/cupertino.dart';
42
import 'package:flutter/material.dart';
53
import 'package:provider/provider.dart';
64

75
import '../../authentication/service/auth_provider.dart';
86
import '../../generated/l10n.dart';
97
import '../../navigation/routes.dart';
8+
import '../../resources/remote_config.dart';
109
import '../../widgets/scaffold.dart';
1110
import 'faq_card.dart';
1211
import 'favourite_websites_card.dart';
12+
import 'feedback_nudge.dart';
1313
import 'news_feed_card.dart';
1414
import 'profile_card.dart';
1515

lib/pages/portal/model/website.dart

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ extension WebsiteCategoryExtension on WebsiteCategory {
1818
return S.current.websiteCategoryAssociations;
1919
case WebsiteCategory.resource:
2020
return S.current.websiteCategoryResources;
21+
case WebsiteCategory.other:
22+
return S.current.websiteCategoryOthers;
2123
}
2224
return S.current.websiteCategoryOthers;
2325
}

lib/resources/storage/mobile_storage.dart

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ class StorageProvider {
1919
final Reference reference = FirebaseStorage.instance.ref().child(ref);
2020
bool result = false;
2121
final UploadTask uploadTask = reference.putData(file);
22-
await uploadTask.whenComplete(() => result = true).catchError(
23-
(dynamic error) async =>
24-
print('Mobile_Storage - StorageUploadTask - uploadImage $error'));
22+
await uploadTask
23+
.whenComplete(() => result = true)
24+
.catchError((dynamic error) async {
25+
print('Mobile_Storage - StorageUploadTask - uploadImage $error');
26+
});
2527
return result;
2628
} catch (e) {
2729
return false;

lib/resources/storage/web_storage.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ class StorageProvider {
2222
.put(file)
2323
.future
2424
.whenComplete(() => result = true)
25-
.catchError((dynamic error) async =>
26-
print('Web_Storage - StorageUploadTask - uploadImage $error'));
25+
.catchError((dynamic error) async {
26+
print('Web_Storage - StorageUploadTask - uploadImage $error');
27+
});
2728
return result;
2829
} catch (e) {
2930
return false;

0 commit comments

Comments
 (0)