moveme_score 1.3.1 copy "moveme_score: ^1.3.1" to clipboard
moveme_score: ^1.3.1 copied to clipboard

SDK oficial MoveMe para o Score Service — avaliações desacopladas (motorista/passageiro), score público, unmatch e rating protection.

moveme_score #

SDK oficial Dart / Flutter para o MoveMe Score Service.

Avaliações desacopladas (motorista ↔ passageiro), score público, unmatch e rating protection.

Install #

dependencies:
  moveme_score: ^1.3.0
flutter pub add moveme_score
# ou
dart pub add moveme_score

Uso rápido #

import 'package:moveme_score/moveme_score.dart';

final score = ScoreClient(
  baseUrl: 'https://score.example.com', // URL do score-service
  apiKey: const String.fromEnvironment('SCORE_API_KEY'),
);

// Cadastro
final alice = await score.registerUser(
  name: 'Alice',
  uidExternal: 'app-user-123',
);

// Score público
final publicScore = await score.getScore(alice.id);
print(publicScore?.avgScore);

// Viagem + avaliação
final trip = await score.createTrip(
  driverId: alice.id,
  riderId: bob.id,
  price: 42,
);
await score.startTrip(trip.id);
await score.completeTrip(trip.id);

await score.submitRating(
  tripId: trip.id,
  fromUserId: bob.id,
  score: 5,
  comment: 'Ótimo!',
);

Auth #

Todas as rotas (exceto /health) exigem header:

apikey: <SCORE_API_KEY>

O SDK envia automaticamente apikey e x-api-key.

API coberta #

Método Recurso
Users register, get, getByUidExternal
Scores getScore
Trips create, accept, startPickup, arrivePickup, start, arriveStop, completeStop, complete, cancel, getTrip, listStops, listTripEvents, canCreateTrip, listTripsForUser
Ratings submit, reasons, pending, received, given
Blocked listBlocked
Analytics hotspots, topUsers, demand
Zones createZone, getZone, listZones, updateZone, deleteZone, checkAvailability

Zonas de disponibilidade #

await score.createZone(
  name: 'Luanda Centro',
  points: [
    ZonePointInput(lat: -8.81, lng: 13.22, orderIndex: 0),
    ZonePointInput(lat: -8.81, lng: 13.26, orderIndex: 1),
    ZonePointInput(lat: -8.85, lng: 13.26, orderIndex: 2),
    ZonePointInput(lat: -8.85, lng: 13.22, orderIndex: 3),
  ],
);

final ok = await score.checkAvailability(lat: -8.83, lng: 13.24); // true|false

Paragens / phase #

Enquanto status = accepted ou in_progress:

phase Significado
to_pickup Busca do passageiro (a caminho do ponto de encontro)
at_pickup Chegou ao ponto de encontro
to_stop A caminho de uma paragem
at_stop Chegou / está na paragem
to_destination A caminho do destino
final trip = await score.createTrip(
  driverId: a.id,
  riderId: b.id,
  endLocation: 'Destino',
  stops: [
    TripStopInput(location: 'Paragem 1'),
  ],
);
await score.acceptTrip(trip.id);       // status=accepted
await score.startPickup(trip.id);      // phase=to_pickup (busca)
await score.arrivePickup(trip.id);     // phase=at_pickup (ponto de encontro)
await score.startTrip(trip.id);        // phase=to_stop (embarque)
await score.arriveStop(trip.id);
await score.completeStop(trip.id);
await score.completeTrip(trip.id);

License #

MIT

0
likes
150
points
19
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

SDK oficial MoveMe para o Score Service — avaliações desacopladas (motorista/passageiro), score público, unmatch e rating protection.

Homepage
Repository (GitHub)
View/report issues

Topics

#score #rating #moveme #flutter #api-client

License

MIT (license)

Dependencies

http, meta

More

Packages that depend on moveme_score