Skip to content

Commit

Permalink
Merge pull request #11 from sistemaseltigre/fix/down-game
Browse files Browse the repository at this point in the history
fix/down-game
  • Loading branch information
dnielopez authored Oct 19, 2023
2 parents ab918f4 + 4bc0494 commit b1e6343
Show file tree
Hide file tree
Showing 15 changed files with 154 additions and 98 deletions.
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:label="DinoGrow"
android:name="${applicationName}"
Expand Down
14 changes: 11 additions & 3 deletions lib/pages/generate_phrase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(height: 60),
const Expanded(child: SizedBox()),
Container(
color: Colors.orange[700],
padding: const EdgeInsets.all(8),
Expand All @@ -51,7 +51,9 @@ class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
textAlign: TextAlign.center,
),
),
const Expanded(child: SizedBox()),
TextBoxWidget(text: _mnemonic),
const Expanded(child: SizedBox()),
IntroButtonWidget(
text: 'Copy phrase',
onPressed: () {
Expand All @@ -63,6 +65,7 @@ class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
ScaffoldMessenger.of(context).showSnackBar(snackBar);
},
),
const Expanded(child: SizedBox()),
Container(
decoration: const BoxDecoration(color: Colors.black),
child: Row(
Expand All @@ -76,9 +79,15 @@ class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
});
},
),
const Text("I have stored the recovery phrase securely"),
const Expanded(
child: Text(
"I have stored the recovery phrase securely",
textAlign: TextAlign.center,
),
),
],
)),
const Expanded(child: SizedBox()),
IntroButtonWidget(
text: 'Continue',
variant: _copied ? 'primary' : 'disabled',
Expand All @@ -95,7 +104,6 @@ class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
}
: () {},
),
const SizedBox(height: 60),
],
),
),
Expand Down
10 changes: 7 additions & 3 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ class _HomeScreenState extends State<HomeScreen> {

@override
Widget build(BuildContext context) {
final statusBarHeight = MediaQuery.of(context).viewPadding.top;

return DefaultTabController(
length: 4,
child: Scaffold(
appBar: AppBar(
backgroundColor: const Color.fromRGBO(241, 189, 57, 1),
elevation: 6,
toolbarHeight: 120,
toolbarHeight: 122 + (statusBarHeight > 0 ? 41 : 0) - statusBarHeight,
flexibleSpace: Column(
children: [
const SizedBox(height: 38),
SizedBox(height: statusBarHeight),
Card(
color: Colors.white,
shadowColor: Colors.white,
Expand All @@ -58,6 +60,7 @@ class _HomeScreenState extends State<HomeScreen> {
_publicKey == null
? 'Loading...'
: '${_publicKey!.substring(0, 6)}...${_publicKey!.substring(_publicKey!.length - 6, _publicKey!.length)}',
maxLines: 1,
style: const TextStyle(color: Colors.black),
)),
const SizedBox(width: 12),
Expand All @@ -71,6 +74,7 @@ class _HomeScreenState extends State<HomeScreen> {
_balance != null
? double.parse(_balance ?? '0').toStringAsFixed(2)
: 'Loading...',
maxLines: 1,
style: const TextStyle(color: Colors.black)),
const SizedBox(width: 3),
const Text('SOL',
Expand Down Expand Up @@ -119,7 +123,7 @@ class _HomeScreenState extends State<HomeScreen> {
physics: const NeverScrollableScrollPhysics(),
children: [
const MiniGamesScreen(),
RankingScreen(),
const RankingScreen(),
MydinogrowScreen(
address: _publicKey ?? '', getBalance: () => _getBalance()),
WalletScreen(
Expand Down
65 changes: 33 additions & 32 deletions lib/pages/input_phrase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class InputPhraseScreen extends StatefulWidget {

class _InputPhraseScreenState extends State<InputPhraseScreen> {
final _formKey = GlobalKey<FormState>();
bool validationFailed = false;
var controllers =
List<TextEditingController>.generate(12, (i) => TextEditingController());

Expand Down Expand Up @@ -70,50 +69,46 @@ class _InputPhraseScreenState extends State<InputPhraseScreen> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(height: 60),
const Expanded(child: SizedBox()),
const TextBoxWidget(
text: 'Please enter your recovery phrase'),
const Expanded(child: SizedBox()),
Center(
child: Form(
key: _formKey,
child: SizedBox(
width: 300,
child: GridView.count(
padding: const EdgeInsets.all(3),
crossAxisSpacing: 10,
mainAxisSpacing: 3,
shrinkWrap: true,
crossAxisCount: 3,
children: List.generate(12, (index) {
return SizedBox(
height: 50,
child: TextFormField(
controller: controllers[index],
decoration: InputDecoration(
filled: true,
fillColor: Colors.black,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
hintText: '${index + 1}',
),
textInputAction: TextInputAction.next,
padding: const EdgeInsets.all(3),
crossAxisSpacing: 10,
mainAxisSpacing: 3,
shrinkWrap: true,
crossAxisCount: 3,
children: List.generate(12, (index) {
return SizedBox(
height: 50,
child: TextFormField(
controller: controllers[index],
decoration: InputDecoration(
filled: true,
fillColor: Colors.black,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
);
}),
)),
hintText: '${index + 1}',
),
textInputAction: TextInputAction.next,
),
);
}),
)),
),
),
validationFailed
? const TextBoxWidget(text: 'Invalid keyphrase')
: const SizedBox(),
IntroButtonWidget(
text: 'Continue',
onPressed: () {
_onSubmit(context);
},
),
const SizedBox(height: 32),
],
),
),
Expand Down Expand Up @@ -147,9 +142,15 @@ class _InputPhraseScreenState extends State<InputPhraseScreen> {
},
);
} else {
setState(() {
validationFailed = true;
});
const snackBar = SnackBar(
content: Text(
'Error: Invalid keyphrase',
style: TextStyle(color: Colors.white),
),
backgroundColor: Colors.red,
);

ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions lib/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ class _LoginScreenState extends State<LoginScreen> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 60),
const Expanded(child: SizedBox()),
const IntroLogoWidget(),
const SizedBox(height: 30),
const Expanded(child: SizedBox()),
const TextBoxWidget(
text:
'To continue, please enter your current password'),
const SizedBox(height: 16),
const Expanded(child: SizedBox()),
Form(
key: _formKey,
child: Column(
Expand All @@ -81,13 +81,12 @@ class _LoginScreenState extends State<LoginScreen> {
),
),
),
const SizedBox(height: 8),
const SizedBox(height: 8),
const SizedBox(height: 12),
IntroButtonWidget(
text: 'Login',
onPressed: _onSubmit,
),
const SizedBox(height: 32),
const SizedBox(height: 12),
IntroButtonWidget(
text: 'Use different Account',
onPressed: () {
Expand All @@ -97,7 +96,7 @@ class _LoginScreenState extends State<LoginScreen> {
],
),
),
const SizedBox(height: 60),
const Expanded(child: SizedBox()),
]),
),
),
Expand Down
Loading

0 comments on commit b1e6343

Please sign in to comment.