Skip to content

Commit

Permalink
Port starter architecture dependencies to null safety (#10)
Browse files Browse the repository at this point in the history
* Update alert_dialogs to null safety

* Update custom_buttons to null safety

* Update string_validators to null safety

* Fix return type in ShowExceptionAlertDialog

* Update email & password code

* Start porting email & password tests

* Disable email & password tests until solution found for mocking with null safety

* Restore git dependencies to other packages

* Update firestore_service to null safety

* Fix email & password tests by adding codegen step for mocks

* Depend on null-safety branch

* Update packages to null-safe dependencies

* snapshot.data() is nullable, so should be the builder arguments

* Change a function argument to nullable
  • Loading branch information
bizz84 committed Mar 5, 2021
1 parent b3a1d31 commit d40f4cc
Show file tree
Hide file tree
Showing 21 changed files with 753 additions and 310 deletions.
12 changes: 6 additions & 6 deletions packages/alert_dialogs/lib/show_alert_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
part of alert_dialogs;

Future<bool> showAlertDialog({
@required BuildContext context,
@required String title,
@required String content,
String cancelActionText,
@required String defaultActionText,
Future<bool?> showAlertDialog({
required BuildContext context,
required String title,
required String content,
String? cancelActionText,
required String defaultActionText,
}) async {
if (kIsWeb || !Platform.isIOS) {
return showDialog(
Expand Down
10 changes: 5 additions & 5 deletions packages/alert_dialogs/lib/show_exception_alert_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
part of alert_dialogs;

Future<void> showExceptionAlertDialog({
@required BuildContext context,
@required String title,
@required dynamic exception,
required BuildContext context,
required String title,
required dynamic exception,
}) =>
showAlertDialog(
context: context,
Expand All @@ -14,10 +14,10 @@ Future<void> showExceptionAlertDialog({

String _message(dynamic exception) {
if (exception is FirebaseException) {
return exception.message;
return exception.message ?? exception.toString();
}
if (exception is PlatformException) {
return exception.message;
return exception.message ?? exception.toString();
}
return exception.toString();
}
Expand Down
85 changes: 25 additions & 60 deletions packages/alert_dialogs/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,77 +7,70 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.13"
version: "1.15.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
firebase:
dependency: transitive
description:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "7.3.0"
version: "1.2.0"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
version: "1.0.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "4.0.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
version: "1.0.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -93,69 +86,41 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
version: "0.6.3"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.8"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
version: "1.8.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.0.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -167,56 +132,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.17"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.12.13+hotfix.5"
6 changes: 3 additions & 3 deletions packages/alert_dialogs/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: alert_dialogs
description: Helper methods for showing alert dialogs
version: 0.1.0
version: 0.2.0
author: Andrea Bizzotto
homepage: https://www.codewithandrea.com

environment:
sdk: ">=2.7.0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
firebase_core: ^0.5.0
firebase_core: ^1.0.0

dev_dependencies:
flutter_test:
Expand Down
10 changes: 5 additions & 5 deletions packages/custom_buttons/lib/custom_raised_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ part of custom_buttons;
@immutable
class CustomRaisedButton extends StatelessWidget {
const CustomRaisedButton({
Key key,
@required this.child,
Key? key,
required this.child,
this.color,
this.textColor,
this.height = 50.0,
Expand All @@ -13,12 +13,12 @@ class CustomRaisedButton extends StatelessWidget {
this.onPressed,
}) : super(key: key);
final Widget child;
final Color color;
final Color textColor;
final Color? color;
final Color? textColor;
final double height;
final double borderRadius;
final bool loading;
final VoidCallback onPressed;
final VoidCallback? onPressed;

Widget buildSpinner(BuildContext context) {
final ThemeData data = Theme.of(context);
Expand Down
6 changes: 3 additions & 3 deletions packages/custom_buttons/lib/form_submit_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ part of custom_buttons;

class FormSubmitButton extends CustomRaisedButton {
FormSubmitButton({
Key key,
String text,
Key? key,
required String text,
bool loading = false,
VoidCallback onPressed,
VoidCallback? onPressed,
}) : super(
key: key,
child: Text(
Expand Down

0 comments on commit d40f4cc

Please sign in to comment.