mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
[compass_app/server] Misc consistency improvements (#2539)
This commit is contained in:
@@ -22,7 +22,7 @@ import '../model/booking/booking.dart';
|
|||||||
class BookingApi {
|
class BookingApi {
|
||||||
BookingApi() {
|
BookingApi() {
|
||||||
// Create a default booking
|
// Create a default booking
|
||||||
var destination = Assets.destinations.first;
|
final destination = Assets.destinations.first;
|
||||||
final activitiesRef = Assets.activities
|
final activitiesRef = Assets.activities
|
||||||
.where((activity) => activity.destinationRef == destination.ref)
|
.where((activity) => activity.destinationRef == destination.ref)
|
||||||
.map((activity) => activity.ref)
|
.map((activity) => activity.ref)
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:compass_server/config/constants.dart';
|
|
||||||
import 'package:shelf/shelf.dart';
|
import 'package:shelf/shelf.dart';
|
||||||
import 'package:shelf_router/shelf_router.dart';
|
import 'package:shelf_router/shelf_router.dart';
|
||||||
|
|
||||||
|
import '../config/constants.dart';
|
||||||
import '../model/login_request/login_request.dart';
|
import '../model/login_request/login_request.dart';
|
||||||
import '../model/login_response/login_response.dart';
|
import '../model/login_response/login_response.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:compass_server/config/constants.dart';
|
|
||||||
import 'package:shelf/shelf.dart';
|
import 'package:shelf/shelf.dart';
|
||||||
import 'package:shelf_router/shelf_router.dart';
|
import 'package:shelf_router/shelf_router.dart';
|
||||||
|
|
||||||
|
import '../config/constants.dart';
|
||||||
|
|
||||||
/// Implements a simple user API.
|
/// Implements a simple user API.
|
||||||
///
|
///
|
||||||
/// This API only returns a hardcoded user for demonstration purposes.
|
/// This API only returns a hardcoded user for demonstration purposes.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ dependencies:
|
|||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
http: ^1.1.0
|
http: ^1.1.0
|
||||||
lints: ^3.0.0
|
lints: ^5.0.0
|
||||||
test: ^1.24.0
|
test: ^1.24.0
|
||||||
build_runner: ^2.4.11
|
build_runner: ^2.4.11
|
||||||
freezed: ^2.5.7
|
freezed: ^2.5.7
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ void main() {
|
|||||||
final host = 'http://127.0.0.1:$port';
|
final host = 'http://127.0.0.1:$port';
|
||||||
late Process p;
|
late Process p;
|
||||||
|
|
||||||
var headers = {
|
final headers = {
|
||||||
'Authorization': 'Bearer ${Constants.token}',
|
'Authorization': 'Bearer ${Constants.token}',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ void main() {
|
|||||||
headers: headers,
|
headers: headers,
|
||||||
body: jsonEncode(
|
body: jsonEncode(
|
||||||
Booking(
|
Booking(
|
||||||
name: "DESTINATION, CONTINENT",
|
name: 'DESTINATION, CONTINENT',
|
||||||
startDate: DateTime(2024, 1, 1),
|
startDate: DateTime(2024, 1, 1),
|
||||||
endDate: DateTime(2024, 2, 2),
|
endDate: DateTime(2024, 2, 2),
|
||||||
destinationRef: 'REF',
|
destinationRef: 'REF',
|
||||||
@@ -139,7 +139,7 @@ void main() {
|
|||||||
headers: headers,
|
headers: headers,
|
||||||
body: jsonEncode(
|
body: jsonEncode(
|
||||||
Booking(
|
Booking(
|
||||||
name: "DESTINATION, CONTINENT",
|
name: 'DESTINATION, CONTINENT',
|
||||||
startDate: DateTime(2024, 1, 1),
|
startDate: DateTime(2024, 1, 1),
|
||||||
endDate: DateTime(2024, 2, 2),
|
endDate: DateTime(2024, 2, 2),
|
||||||
destinationRef: 'REF',
|
destinationRef: 'REF',
|
||||||
|
|||||||
Reference in New Issue
Block a user