Fakultas Ilmu Komputer UI

Commit 091a1eb8 authored by Fakhira Devina's avatar Fakhira Devina
Browse files

[REFACTOR] implement pedantic linter

parent 2530a4f2
Pipeline #37281 failed with stages
in 2 minutes and 22 seconds
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"google_maps_flutter","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.24+1\\\\","dependencies":[]},{"name":"location","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.5.3\\\\","dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-1.0.6\\\\","dependencies":[]},{"name":"google_maps_flutter","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.24+1\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.5.3\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"google_maps_flutter","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","dependencies":[]}],"date_created":"2020-03-25 13:25:56.091885","version":"1.15.17"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"google_maps_flutter","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.24+1\\\\","dependencies":[]},{"name":"location","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.5.3\\\\","dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-1.0.6\\\\","dependencies":[]},{"name":"google_maps_flutter","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.24+1\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.5.3\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"google_maps_flutter","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","dependencies":[]}],"date_created":"2020-03-25 16:26:56.154526","version":"1.15.17"}
\ No newline at end of file
include: package:pedantic/analysis_options.yaml
analyzer:
exclude:
- "**/*.g.dart"
\ No newline at end of file
......@@ -82,10 +82,10 @@ class BisaGoDrawer extends StatelessWidget {
Navigator.pop(context);
},
),
decoration: new BoxDecoration(
decoration: BoxDecoration(
color: greenPrimary,
border: new Border(
bottom: new BorderSide(color: Colors.white),
border: Border(
bottom: BorderSide(color: Colors.white),
),
),
);
......
......@@ -34,7 +34,7 @@ class DashboardState extends State<Dashboard> {
@override
void initState() {
super.initState();
location = new Location();
location = Location();
enableLocationService();
location.onLocationChanged().listen((LocationData cLoc) {
currentLocation = cLoc;
......@@ -161,7 +161,7 @@ class DashboardState extends State<Dashboard> {
target: LatLng(currentLocation.latitude, currentLocation.longitude),
);
final GoogleMapController controller = await _controller.future;
controller.animateCamera(CameraUpdate.newCameraPosition(cPosition));
await controller.animateCamera(CameraUpdate.newCameraPosition(cPosition));
setState(() {
var pinPosition =
LatLng(currentLocation.latitude, currentLocation.longitude);
......
......@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:mockito/mockito.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ppl_disabilitas/page/dashboard/dashboard.dart';
import 'package:pedantic/pedantic.dart';
class MockNavigatorObserver extends Mock implements NavigatorObserver {}
......@@ -17,7 +18,7 @@ void main() {
Future<Null> _buildDashboardPage(WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(
home: Dashboard(),
/// This mocked observer will now receive all navigation events
/// that happen in our app.
navigatorObservers: [mockObserver],
......@@ -36,29 +37,29 @@ void main() {
testWidgets(
'when tapping text form field, should navigate to pencarina page',
(WidgetTester tester) async {
(WidgetTester tester) async {
final textFieldKeyPencarian = Key("Text Field Mau Kemana");
await _buildDashboardPage(tester);
await _navigateToPencarianPage(tester);
verify(mockObserver.didPush(any, any));
expect(find.byKey(textFieldKeyPencarian), findsOneWidget);
});
});
testWidgets('tapping the back button should navigate back to the dashboard',
(WidgetTester tester) async {
(WidgetTester tester) async {
final backIconKey = Key("Back Icon Key");
await _buildDashboardPage(tester);
await _navigateToPencarianPage(tester);
final Route pushedRoute =verify(mockObserver.didPush(captureAny, any)).captured.single;
String popResult;
pushedRoute.popped.then((result) => popResult = result);
unawaited(pushedRoute.popped.then((result) => popResult = result));
await tester.tap(find.byKey(backIconKey));
await tester.pumpAndSettle();
expect(popResult, 'Take me back');
});
});
});
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ void main() {
await tester.pumpWidget(MaterialApp(home: Dashboard()));
// Search for the childWidget in the tree and verify it exists.
expect(find.byType(Scaffold), findsOneWidget);
expect(find.byType(Stack), findsNWidgets(3));
expect(find.byType(Stack), findsNWidgets(2));
expect(find.byType(TextFormField), findsOneWidget);
expect(find.byType(Icon), findsNWidgets(3));
expect(find.text('Kamu mau kemana?'), findsOneWidget);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment