Skip to content

Commit

Permalink
Merge pull request #35 from Topl/DAPP-400
Browse files Browse the repository at this point in the history
tests(DAPP-400): fixes broken tests
  • Loading branch information
Kelello authored Nov 23, 2023
2 parents 2e4451a + 58bae6e commit 3d0f6bf
Show file tree
Hide file tree
Showing 21 changed files with 683 additions and 538 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ web_build_and_host:

file_test:
@reset
@flutter test test/shared/widgets/mobile_footer_tests.dart
@flutter test test/
42 changes: 42 additions & 0 deletions lib/home/sections/custom_webview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import 'package:faucet/shared/extended-libraries/webviewx/providers/webview_provider.dart';
import 'package:faucet/shared/extended-libraries/webviewx/src/utils/source_type.dart';
import 'package:faucet/shared/extended-libraries/webviewx/src/view/impl/web.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:responsive_framework/responsive_breakpoints.dart';

class CustomWebview extends HookConsumerWidget {
static const recaptchaWidgetKey = Key('recaptcha-widget');
const CustomWebview({Key? key}) : super(key: key);

@override
Widget build(BuildContext context, WidgetRef ref) {
final initialContent = '<div></div>';
final isMobile = ResponsiveBreakpoints.of(context).equals(MOBILE);

final webView = ref.watch(webViewProvider);
final webViewNotifier = ref.watch(webViewProvider.notifier);

return Stack(
children: [
WebViewX(
key: recaptchaWidgetKey,
initialContent: initialContent,
initialSourceType: SourceType.html,
height: isMobile ? 110 : 220,
width: isMobile ? 200 : 440,
onWebViewCreated: (controller) => webViewNotifier.setController(controller),
dartCallBacks: const {},
),
webView.when(
data: (data) {
webViewNotifier.loadContent(data);
return Container();
},
error: (error, st) => const Center(child: Text('Error loading WebView')),
loading: () => const Center(child: CircularProgressIndicator()),
)
],
);
}
}
Loading

0 comments on commit 3d0f6bf

Please sign in to comment.