wd portal, empty page, closes #7

This commit is contained in:
2023-07-07 15:55:46 +05:30
parent 6b7fe0af5d
commit 16e81cc7ef
4 changed files with 83 additions and 19 deletions

View File

@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
import '../main.dart';
class Dialogs{
@@ -71,4 +72,38 @@ class Dialogs{
return route.settings.name!="Progress";
});
}
static void ShowCoinbaseDialog(BuildContext context){
// set up the AlertDialog
AlertDialog alert = AlertDialog(
backgroundColor: Color(0xFF1F1F1F),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40)),
title: Text("Coinbase Address",textAlign: TextAlign.center,),
content: Text("Enter your coinbase account address here (ex: johndoe@gmail.com)\nThis account will be used for withdrawals.\n\nIf you don't have a coinbase account yet, Create one by pressing 'New Account'",textAlign: TextAlign.center,),
actions: [
TextButton(
child: Text("New Account"),
onPressed: () {
launchUrl(Uri.parse('https://coinbase.com/signup'));
},
),
TextButton(
child: Text("OK"),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
}

View File

@@ -1,5 +1,6 @@
import 'package:external_app_launcher/external_app_launcher.dart';
import 'package:fhub/backend/DataManager.dart';
import 'package:fhub/backend/Dialogs.dart';
import 'package:fhub/backend/helpers.dart';
import 'package:fhub/src/CustomWidgets.dart';
import 'package:flutter/material.dart';
@@ -61,6 +62,7 @@ class _GameInfoPageState extends State<GameInfoPage> with WidgetsBindingObserver
@override
Widget build(BuildContext context) {
bool linked = DataManager.LinkedGamesJson.contains(widget.gameJson);
String howto = "Install this game from playstore and login with the same google account to Link the game to this FaucetHub Automatically.\n\nTo Link manually, Navigate to 'Link to FH' in game settings, Then Enter '${DataManager.UserJson['id']}' As FH ID.\n\n Then enjoy your earnings from playing this game!";
return Scaffold(
backgroundColor: Colors.black,
body: CustomBody(child: SafeArea(child: Padding(
@@ -116,7 +118,7 @@ class _GameInfoPageState extends State<GameInfoPage> with WidgetsBindingObserver
Icon(Icons.g_mobiledata_rounded,size: 40),
Text("Open on Playstore"),
],
), width: 200,height: 50),
), width: 200,height: 50,color: Colors.greenAccent),
SizedBox(height: 35,),
Text(widget.gameJson['description'],textAlign: TextAlign.center),
SizedBox(height: 20,),
@@ -125,7 +127,16 @@ class _GameInfoPageState extends State<GameInfoPage> with WidgetsBindingObserver
Text("Your FH ID"),
Text(DataManager.UserJson['id'], style: TextStyle(fontSize: 50, fontWeight: FontWeight.bold)),
SizedBox(height: 20,),
Text("Install this game from playstore and login with the same google account to Link the game to this FaucetHub Automatically.\n\nTo Link manually, Navigate to 'Link to FH' in game settings, Then Enter '${DataManager.UserJson['id']}' As FH ID.\n\n Then enjoy your earnings from playing this game!",textAlign: TextAlign.center)
GlassButton(onTap: ()async{
Dialogs.showAlertDialog(context, "How to Link", howto);
}, child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.help_outline_sharp,size: 30),
Text("How to Link"),
],
), width: 200,height: 50,color: Colors.lightBlueAccent)
// Text("",textAlign: TextAlign.center)
],
),
],),

View File

@@ -587,7 +587,7 @@ class _HomeState extends State<Home> with WidgetsBindingObserver {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Coinbase Address"),
InkWell(onTap: (){Dialogs.showAlertDialog(context, "Coinbase Address", "Withdrawals will be accounted to this address");},child: Icon(Icons.help))
InkWell(onTap: (){Dialogs.ShowCoinbaseDialog(context);},child: Icon(Icons.help))
],
),
TextField(controller: TxtCoinbaseAddress, onChanged: (e){setState(() {

View File

@@ -92,27 +92,45 @@ class _WithdrawalHistoryPageState extends State<WithdrawalHistoryPage> {
height: 50,
),
(loaded) ?
Padding(
(wd_requests.length > 0) ? Padding(
padding: const EdgeInsets.all(20.0),
child: GlassCard(child: Container(
height: screenHeight * 0.6,
constraints: BoxConstraints(maxHeight: screenHeight * 0.6),
padding: EdgeInsets.all(12),
child: Column(
children: [
ListView.builder(
shrinkWrap: true,
controller: scrollController,
itemCount: wd_requests.length,
itemBuilder: (BuildContext context, int index) {
return WdRequestItem(
wd_requests[index]);
},
),
],
child: SingleChildScrollView(
child: Column(
children: [
Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Date Requested"),
Text("Amount"),
Text("Status")
],),
),
SizedBox(height: 10,),
ListView.builder(
shrinkWrap: true,
controller: scrollController,
itemCount: wd_requests.length,
itemBuilder: (BuildContext context, int index) {
return WdRequestItem(
wd_requests[index]);
},
),
],
),
),
)),
)
) : Container(height: screenHeight * 0.6,child: Center(child: Column(mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.account_balance_outlined,size: 100,color: Colors.white60,),
SizedBox(height: 20,),
Text("No Withdrawal Requests"),
],
)))
:Container(height: screenHeight * 0.6,child: Center(child: Text("Loading...")))
],