🐛 Bug fixes
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
			
		||||
import 'package:flutter/material.dart';
 | 
			
		||||
import 'package:go_router/go_router.dart';
 | 
			
		||||
import 'package:goatagent/auth.dart';
 | 
			
		||||
import 'package:goatagent/screens/about.dart';
 | 
			
		||||
import 'package:goatagent/widgets/name_card.dart';
 | 
			
		||||
 | 
			
		||||
class AccountScreen extends StatefulWidget {
 | 
			
		||||
@@ -78,7 +79,9 @@ class _AccountScreenState extends State<AccountScreen> {
 | 
			
		||||
                    child: InkWell(
 | 
			
		||||
                      splashColor: Colors.indigo.withAlpha(30),
 | 
			
		||||
                      onTap: () {
 | 
			
		||||
                        GoRouter.of(context).push("/about");
 | 
			
		||||
                        Navigator.push(context, MaterialPageRoute(
 | 
			
		||||
                          builder: (context) => const AboutScreen(),
 | 
			
		||||
                        ));
 | 
			
		||||
                      },
 | 
			
		||||
                      child: const ListTile(
 | 
			
		||||
                        leading: Icon(Icons.info_outline),
 | 
			
		||||
 
 | 
			
		||||
@@ -15,15 +15,18 @@ class ApplicationScreen extends StatelessWidget {
 | 
			
		||||
          child: Padding(
 | 
			
		||||
            padding: const EdgeInsets.symmetric(horizontal: 18),
 | 
			
		||||
            child: AppBar(),
 | 
			
		||||
          )
 | 
			
		||||
      ),
 | 
			
		||||
          )),
 | 
			
		||||
      body: SafeArea(
 | 
			
		||||
        child: WebViewWidget(
 | 
			
		||||
          controller: WebViewController()
 | 
			
		||||
            ..setJavaScriptMode(JavaScriptMode.unrestricted)
 | 
			
		||||
            ..setBackgroundColor(Colors.white)
 | 
			
		||||
            ..loadRequest(link)
 | 
			
		||||
            ..clearCache(),
 | 
			
		||||
        child: Stack(
 | 
			
		||||
          children: [
 | 
			
		||||
            WebViewWidget(
 | 
			
		||||
              controller: WebViewController()
 | 
			
		||||
                ..setJavaScriptMode(JavaScriptMode.unrestricted)
 | 
			
		||||
                ..setBackgroundColor(Colors.white)
 | 
			
		||||
                ..loadRequest(link)
 | 
			
		||||
                ..clearCache(),
 | 
			
		||||
            ),
 | 
			
		||||
          ],
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
 
 | 
			
		||||
@@ -12,22 +12,24 @@ class AuthorizationScreen extends StatelessWidget {
 | 
			
		||||
      appBar: AppBar(
 | 
			
		||||
        title: const Text('Connect with Goatpass'),
 | 
			
		||||
      ),
 | 
			
		||||
      body: WebViewWidget(
 | 
			
		||||
        controller: WebViewController()
 | 
			
		||||
          ..setJavaScriptMode(JavaScriptMode.unrestricted)
 | 
			
		||||
          ..setBackgroundColor(Colors.white)
 | 
			
		||||
          ..setNavigationDelegate(NavigationDelegate(
 | 
			
		||||
            onNavigationRequest: (NavigationRequest request) {
 | 
			
		||||
              if (request.url.startsWith('goatagent://auth')) {
 | 
			
		||||
                Navigator.of(context).pop(request.url);
 | 
			
		||||
                return NavigationDecision.prevent;
 | 
			
		||||
              }
 | 
			
		||||
              return NavigationDecision.navigate;
 | 
			
		||||
            },
 | 
			
		||||
          ))
 | 
			
		||||
          ..loadRequest(authorizationUrl)
 | 
			
		||||
          ..clearCache(),
 | 
			
		||||
      ),
 | 
			
		||||
      body: Stack(children: [
 | 
			
		||||
        WebViewWidget(
 | 
			
		||||
          controller: WebViewController()
 | 
			
		||||
            ..setJavaScriptMode(JavaScriptMode.unrestricted)
 | 
			
		||||
            ..setBackgroundColor(Colors.white)
 | 
			
		||||
            ..setNavigationDelegate(NavigationDelegate(
 | 
			
		||||
              onNavigationRequest: (NavigationRequest request) {
 | 
			
		||||
                if (request.url.startsWith('goatagent://auth')) {
 | 
			
		||||
                  Navigator.of(context).pop(request.url);
 | 
			
		||||
                  return NavigationDecision.prevent;
 | 
			
		||||
                }
 | 
			
		||||
                return NavigationDecision.navigate;
 | 
			
		||||
              },
 | 
			
		||||
            ))
 | 
			
		||||
            ..loadRequest(authorizationUrl)
 | 
			
		||||
            ..clearCache(),
 | 
			
		||||
        ),
 | 
			
		||||
      ]),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user