🐛 Bug fixes

This commit is contained in:
LittleSheep 2024-02-10 20:55:46 +08:00
parent cb7256af23
commit 8e04230388
3 changed files with 33 additions and 25 deletions

View File

@ -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),

View File

@ -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(),
),
],
),
),
);

View File

@ -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(),
),
]),
);
}
}