File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,15 @@ class ApiClient {
48
48
Future <Map <String , dynamic >> getPowersyncToken () async {
49
49
final prefs = await SharedPreferences .getInstance ();
50
50
final apiData = json.decode (prefs.getString (PREFS_USER )! );
51
-
51
+ print ( 'posting our token "${ apiData [ "token" ]}" to $ baseUrl /api/v2/powersync-token' );
52
52
final response = await http.get (
53
53
Uri .parse ('$baseUrl /api/v2/powersync-token' ),
54
54
headers: {
55
55
HttpHeaders .contentTypeHeader: 'application/json' ,
56
56
HttpHeaders .authorizationHeader: 'Token ${apiData ["token" ]}' ,
57
57
},
58
58
);
59
+ print ('response: status ${response .statusCode }, body ${response .body }' );
59
60
if (response.statusCode == 200 ) {
60
61
log.log (Level .ALL , response.body);
61
62
return json.decode (response.body);
Original file line number Diff line number Diff line change 1
1
class AppConfig {
2
- static const String djangoUrl = 'http://10.0.2.2 :8000' ;
3
- static const String powersyncUrl = 'http://10.0.2.2 :8080' ;
2
+ static const String djangoUrl = 'http://192.168.1.195 :8000' ;
3
+ static const String powersyncUrl = 'http://192.168.1.195 :8080' ;
4
4
}
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ void main() async {
84
84
85
85
// Locator to initialize exerciseDB
86
86
await ServiceLocator ().configure ();
87
+ print ('running myapp' );
87
88
// Application
88
89
runApp (const MyApp ());
89
90
}
Original file line number Diff line number Diff line change @@ -74,10 +74,14 @@ class _HomeTabsScreenState extends State<HomeTabsScreen> with SingleTickerProvid
74
74
/// Load initial data from the server
75
75
Future <void > _loadEntries () async {
76
76
final connector = DjangoConnector (db);
77
- final credentials = await connector.fetchCredentials ();
78
- print ('----------' );
79
- print (credentials);
80
- print ('----------' );
77
+ try {
78
+ final credentials = await connector.fetchCredentials ();
79
+ print ('----------' );
80
+ print (credentials);
81
+ print ('----------' );
82
+ } catch (e) {
83
+ print ('fail' + e.toString ());
84
+ }
81
85
82
86
final authProvider = context.read <AuthProvider >();
83
87
You can’t perform that action at this time.
0 commit comments