HyM attachments resolve: #2 #3
					 2 changed files with 10 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
import 'dart:convert';
 | 
			
		||||
import 'package:crab_ui/api_service.dart';
 | 
			
		||||
import 'package:crab_ui/home_page.dart';
 | 
			
		||||
// import 'package:crab_ui/api_service.dart';
 | 
			
		||||
import 'api_service.dart';
 | 
			
		||||
import 'home_page.dart';
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
// import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
 | 
			
		||||
import 'package:http/http.dart' as http;
 | 
			
		||||
| 
						 | 
				
			
			@ -11,7 +12,9 @@ class AuthService {
 | 
			
		|||
  Future<bool> isUserLoggedIn() async {
 | 
			
		||||
    try {
 | 
			
		||||
      final response =
 | 
			
		||||
          await http.get(Uri.parse('http://localhost:6823/read-config'));
 | 
			
		||||
          await http.get(Uri.http('localhost:6823', 'read-config'));
 | 
			
		||||
      // await http.get(Uri.parse('http://localhost:6823/read-config'));
 | 
			
		||||
 | 
			
		||||
      print(response.statusCode);
 | 
			
		||||
      print(response.body);
 | 
			
		||||
      if (response.statusCode == 200) {
 | 
			
		||||
| 
						 | 
				
			
			@ -27,7 +30,9 @@ class AuthService {
 | 
			
		|||
            Map<String, dynamic> json = jsonDecode(jsonOuter);
 | 
			
		||||
            // print(json["is_logged_in"]);
 | 
			
		||||
            ApiService.ip = data['ip'];
 | 
			
		||||
            print("setting ip " + ApiService.ip);
 | 
			
		||||
            ApiService.port = data['port'];
 | 
			
		||||
            print("setting port " + data['port']);
 | 
			
		||||
            return json["is_logged_in"];
 | 
			
		||||
          }
 | 
			
		||||
        } catch (er) {
 | 
			
		||||
| 
						 | 
				
			
			@ -35,6 +40,7 @@ class AuthService {
 | 
			
		|||
        }
 | 
			
		||||
      }
 | 
			
		||||
    } catch (e) {
 | 
			
		||||
      print('caughtther');
 | 
			
		||||
      print(e);
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,7 +61,7 @@ class _SerializableMessageListScreenState extends State<SerializableMessageListS
 | 
			
		|||
          ),
 | 
			
		||||
          trailing: Text(message.date),
 | 
			
		||||
          onTap: () async {
 | 
			
		||||
            String emailContent = await apiService.fetchEmailContent([message.id]);
 | 
			
		||||
            String emailContent = await apiService.fetchEmailContent([message.id], message.list);
 | 
			
		||||
            Navigator.push(
 | 
			
		||||
              context,
 | 
			
		||||
              MaterialPageRoute(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue