Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DAPP-411): changes chain name #38

Merged
merged 14 commits into from
Dec 13, 2023
Merged
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/
8 changes: 4 additions & 4 deletions lib/chain/models/chains.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ sealed class Chains with _$Chains {
@Default(443) int port,
@Default('toplnetKey') String key,
}) = ToplMainnet;
const factory Chains.valhalla_testnet({
@Default('Valhalla') String networkName,
@Default('testnet.topl.network') String hostUrl,
@Default(50051) int port,
const factory Chains.testnet({
@Default('TestNet') String networkName,
@Default('testnet.topl.co') String hostUrl,
@Default(443) int port,
@Default('valhallaKey') String key,
}) = ValhallaTestNet;
Kelz29 marked this conversation as resolved.
Show resolved Hide resolved
const factory Chains.private_network({
Expand Down
4 changes: 2 additions & 2 deletions lib/chain/providers/selected_chain_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ChainsNotifier extends StateNotifier<AsyncValue<List<Chains>>> {
// dev notes: This will have to be updated when we change the predetermined networks
final List<Chains> standardChains = [
const Chains.topl_mainnet(),
const Chains.valhalla_testnet(),
const Chains.testnet(),
const Chains.private_network(),
const Chains.dev_network(),
const Chains.mock(),
Expand All @@ -60,7 +60,7 @@ class ChainsNotifier extends StateNotifier<AsyncValue<List<Chains>>> {
switch (Chains) {
case Chains.topl_mainnet:
break;
case Chains.valhalla_testnet:
case Chains.testnet:
break;
case Chains.private_network:
break;
Expand Down
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