Skip to content

Commit

Permalink
big update
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Jul 14, 2023
1 parent 2578902 commit f2b7add
Show file tree
Hide file tree
Showing 17 changed files with 588 additions and 404 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/dart.yml
@@ -1,4 +1,4 @@
# Created with package:mono_repo v6.4.1
# Created with package:mono_repo v6.5.7
name: Dart CI
on:
push:
Expand All @@ -21,30 +21,30 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@ac8075791e805656e71b4ba23325ace9e3421120
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.4.1
run: dart pub global activate mono_repo 6.5.7
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyze_and_format; PKGS: common, server, shelf_jwt_auth; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@ac8075791e805656e71b4ba23325ace9e3421120
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:common-server-shelf_jwt_auth;commands:format-analyze"
Expand All @@ -54,12 +54,12 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- id: common_pub_upgrade
name: common; dart pub upgrade
run: dart pub upgrade
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@ac8075791e805656e71b4ba23325ace9e3421120
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:common;commands:test"
Expand All @@ -114,12 +114,12 @@ jobs:
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
- id: common_pub_upgrade
name: common; dart pub upgrade
run: dart pub upgrade
Expand Down
3 changes: 1 addition & 2 deletions analysis_options.yaml
Expand Up @@ -32,6 +32,7 @@ linter:
- camel_case_extensions
- camel_case_types
- cancel_subscriptions
- collection_methods_unrelated_type
- comment_references
- constant_identifier_names
- control_flow_in_finally
Expand All @@ -44,12 +45,10 @@ linter:
- file_names
- hash_and_equals
- implementation_imports
- iterable_contains_unrelated_type
- join_return_with_assignment
- library_names
- library_prefixes
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_duplicate_case_values
Expand Down
5 changes: 2 additions & 3 deletions app/lib/main.dart
@@ -1,5 +1,4 @@
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
Expand Down Expand Up @@ -67,7 +66,7 @@ class _KnarlyApp extends StatelessWidget {
onPressed: _onSignOut,
child: const Icon(Icons.logout),
),
)
),
],
),
);
Expand All @@ -84,7 +83,7 @@ class _KnarlyApp extends StatelessWidget {
);

final _observers = [
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics())
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.instance),
];

Future<void> _onSignOut() async {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/src/user_voting_model.dart
Expand Up @@ -89,7 +89,7 @@ class UserVotingModel extends ChangeNotifier {

final newRank = _voteModel?.rank.toList();

FirebaseAnalytics().logEvent(
FirebaseAnalytics.instance.logEvent(
name: 'ballot updated',
parameters: {'election_id': _election.id},
).ignore();
Expand Down
4 changes: 2 additions & 2 deletions app/lib/src/widgets/login_widget.dart
Expand Up @@ -38,15 +38,15 @@ class LoginWidget extends StatelessWidget {
),
],
),
)
),
],
);

Future<void> _onSignIn() async {
try {
final googleProvider = GoogleAuthProvider()..addScope('email');
await FirebaseAuth.instance.signInWithPopup(googleProvider);
FirebaseAnalytics().logLogin(loginMethod: 'google').ignore();
FirebaseAnalytics.instance.logLogin(loginMethod: 'google').ignore();
} catch (error) {
print('Error caught during Firebase sign-in: $error');
}
Expand Down
11 changes: 5 additions & 6 deletions app/lib/src/widgets/vote_widget.dart
Expand Up @@ -137,7 +137,7 @@ Widget _buildLists(BuildContext _, VoteModel<String> model, __) => Row(
),
],
),
)
),
],
);

Expand Down Expand Up @@ -171,13 +171,13 @@ Widget _rankList(VoteModel<String> model, Iterable<String> items) =>
tooltip: 'Remove',
onPressed: () => model.removeCandidate(item),
),
const SizedBox(width: 10)
const SizedBox(width: 10),
],
),
),
),
onDoubleTap: () => model.removeCandidate(item),
)
),
],
);

Expand All @@ -198,7 +198,7 @@ Widget _remainingOptions(VoteModel<String> model, Iterable<String> items) =>
),
),
onDoubleTap: () => model.addCandidate(item),
)
),
],
);

Expand All @@ -225,8 +225,7 @@ Widget _valueProviderConsumer<T extends ChangeNotifier>({
BuildContext context,
T value,
Widget? child,
)
builder,
) builder,
}) =>
ChangeNotifierProvider<T>.value(
value: value,
Expand Down

0 comments on commit f2b7add

Please sign in to comment.