Skip to content

Commit

Permalink
Updated firebase_analytics for sound null safety & added analyze/test…
Browse files Browse the repository at this point in the history
… CI steps
  • Loading branch information
Drakota committed Apr 8, 2021
1 parent c0e18b7 commit e495716
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/flutter-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ jobs:
- name: Run formatter
run: flutter format --set-exit-if-changed .

- name: Run analyzer
run: flutter analyze .

- name: Run tests
run: flutter test

- name: Build release APKs
run: flutter build apk --split-per-abi
env:
Expand Down
1 change: 0 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:bttvstickers/constants.dart';
import 'package:bttvstickers/models/pack.dart';
import 'package:bttvstickers/models/settings.dart';
Expand Down
12 changes: 6 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,35 +77,35 @@ packages:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.0"
version: "9.0.1"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "7.1.1"
version: "8.0.0-dev.2"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "2.0.0-dev.0"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0+1"
version: "0.3.0-dev.0"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.0.3"
firebase_core_platform_interface:
dependency: transitive
description:
Expand All @@ -119,7 +119,7 @@ packages:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.0.2"
flutter:
dependency: "direct main"
description: flutter
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies:
path_provider: ^2.0.1
transparent_image: ^2.0.0-nullsafety.0
firebase_core: ^1.0.1
firebase_analytics: ^7.1.1
firebase_analytics: ^8.0.0-dev.2

dev_dependencies:
flutter_test:
Expand Down
40 changes: 16 additions & 24 deletions test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:bttvstickers/main.dart';
import 'package:bttvstickers/models/pack.dart';
import 'package:bttvstickers/models/settings.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:bttvstickers/main.dart';
import 'package:provider/provider.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(App());

// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);

// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();

// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
testWidgets('Main page loads smoke test', (WidgetTester tester) async {
await tester.pumpWidget(
MultiProvider(
providers: [
ChangeNotifierProvider(create: (context) => Settings()),
ChangeNotifierProvider(create: (context) => Pack()),
],
child: Builder(
builder: (_) => App(),
),
),
);
});
}

0 comments on commit e495716

Please sign in to comment.