Fix gRPC Timestamp conversion and finalize API migration

- Use protobuf well_known_types Timestamp for gRPC compatibility
- Fix ApiError.network() to include required message parameter
- Complete migration from HTTP to gRPC with cqrs_services proto
- App now successfully connects to gRPC backend at 192.168.88.228:5011
- Mobile UX optimization with toggleable deliveries overlay functional

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mathias Beaulieu-Duncan 2026-01-20 15:12:36 -05:00
parent 46048307ea
commit 554b26cfd1

View File

@ -2,7 +2,7 @@ import 'dart:async';
import 'package:fixnum/fixnum.dart';
import 'package:grpc/grpc.dart';
import 'package:protobuf/protobuf.dart' as $protobuf;
import 'package:protobuf/well_known_types/google/protobuf/timestamp.pb.dart' as $timestamp;
import '../generated/cqrs_services.pb.dart' as $pb;
import '../generated/cqrs_services.pbgrpc.dart';
@ -298,8 +298,8 @@ class GrpcCqrsApiClient {
// Extension to convert DateTime to protobuf Timestamp
extension DateTimeToProto on DateTime {
$pb.Timestamp toProto3Timestamp() {
return $pb.Timestamp()
$timestamp.Timestamp toProto3Timestamp() {
return $timestamp.Timestamp()
..seconds = Int64(millisecondsSinceEpoch ~/ 1000)
..nanos = ((millisecondsSinceEpoch % 1000) * 1000000).toInt();
}