getDummyLogin method
Returns a stub login response for development, without hitting the network.
Simulates a 1-second network delay and returns a well-formed OAuth2 token payload. Replace with login once the real API endpoint is ready.
Implementation
Future<Response<dynamic>> getDummyLogin() async {
await Future<void>.delayed(const Duration(seconds: 1));
final int now = DateTime.now().millisecondsSinceEpoch;
return Response<dynamic>(
data: <String, dynamic>{
'access_token': 'dummy_access_token_$now',
'refresh_token': 'dummy_refresh_token_$now',
'token_type': 'Bearer',
'expires_in': 3600, // 1 hour in seconds
'refresh_expires_in': 604800, // 7 days in seconds
},
statusCode: 200,
requestOptions: RequestOptions(path: '/api/login'),
);
}