Skip to content

Commit

Permalink
Merge pull request #25 from yihong1120/feature/dashboard-display
Browse files Browse the repository at this point in the history
Feature/dashboard display
  • Loading branch information
yihong1120 authored Dec 30, 2023
2 parents 9cb66e3 + 2aaae95 commit 5238499
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/services/report_service.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:logger/logger.dart';
import '../models/traffic_violation.dart';

var logger = Logger();

class ReportService {
final String apiUrl = 'https://your-api-url.com/reports';

Expand Down Expand Up @@ -30,11 +33,11 @@ class ReportService {
if (response.statusCode == 200) {
return true;
} else {
print('Failed to create report: ${response.statusCode}');
logger.d('Failed to create report: ${response.statusCode}');
return false;
}
} catch (e) {
print('Caught error: $e');
logger.d('Caught error: $e');
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/services/social_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SocialService {
final String loginUrl = '$baseUrl/social/login/${provider.id}';

// 使用 url_launcher 打开浏览器窗口
if (await canLaunch(loginUrl)) {
if (await canLaunchUrl(loginUrl)) {
await launch(loginUrl);
} else {
throw 'Could not launch $loginUrl';
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies:
intl: ^0.17.0
provider: ^6.0.1
http: ^0.13.3
logger: ^1.1.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 5238499

Please sign in to comment.