Skip to content

Commit

Permalink
Merge pull request #2 from sistemaseltigre/refactor/new-ui-intro
Browse files Browse the repository at this point in the history
refactor/new-ui-intro
  • Loading branch information
sistemaseltigre authored Sep 22, 2023
2 parents fcf4648 + b12598f commit 5ddbaff
Show file tree
Hide file tree
Showing 42 changed files with 623 additions and 210 deletions.
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="dinogrow"
android:label="DinoGrow"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
5 changes: 5 additions & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_adaptive_back"/>
<foreground android:drawable="@mipmap/ic_launcher_adaptive_fore"/>
</adaptive-icon>
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/ui/config_jungle_bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/ui/intro_jungle_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
126 changes: 61 additions & 65 deletions lib/pages/generatePhrase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import 'package:flutter/services.dart';
import 'package:bip39/bip39.dart' as bip39;
import 'package:go_router/go_router.dart';

import '../ui/widgets/widgets.dart';

class GeneratePhraseScreen extends StatefulWidget {
const GeneratePhraseScreen({super.key});

Expand All @@ -12,7 +14,6 @@ class GeneratePhraseScreen extends StatefulWidget {

class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
String _mnemonic = "";
Icon iconButton = const Icon(Icons.copy);
bool _copied = false;

@override
Expand All @@ -21,79 +22,74 @@ class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
_generateMnemonic();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Recovery Phrase")),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Flexible(
child: Container(
// appBar: AppBar(title: Text("Recovery Phrase")),
extendBodyBehindAppBar: true,
appBar: appBar(context),
body: Container(
height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/ui/config_jungle_bg.jpg"),
fit: BoxFit.cover,
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const SizedBox(height: 60),
Container(
color: Colors.orange[700],
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
child: const Text(
'Important! Copy and save the recovery phrase in a secure location. This cannot be recovered later.',
style: TextStyle(fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Container(
padding: EdgeInsets.all(8),
child: Text(
_mnemonic,
textAlign: TextAlign.justify,
style: const TextStyle(
fontSize: 18,
height: 1.5,
TextBoxWidget(text: _mnemonic),
IntroButtonWidget(
text: 'Copy phrase',
onPressed: () {
Clipboard.setData(ClipboardData(text: _mnemonic));
const snackBar = SnackBar(
content: Text('Copied!'),
);

ScaffoldMessenger.of(context).showSnackBar(snackBar);
},
),
Container(
decoration: const BoxDecoration(color: Colors.black),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Checkbox(
value: _copied,
onChanged: (value) {
setState(() {
_copied = value!;
});
},
),
),
),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
onPressed: () {
Clipboard.setData(ClipboardData(text: _mnemonic));
setState(() {
iconButton = const Icon(Icons.check);
});
const Text("I have stored the recovery phrase securely"),
],
)),
IntroButtonWidget(
text: _copied ? 'Continue' : 'Go Back',
onPressed: _copied
? () {
GoRouter.of(context).push("/passwordSetup/$_mnemonic");
}
: () {
GoRouter.of(context).push("/");
},
icon: iconButton,
),
],
),
Row(
children: [
Checkbox(
value: _copied,
onChanged: (value) {
setState(() {
_copied = value!;
});
},
),
const Text("I have stored the recovery phrase securely"),
],
),
ElevatedButton(
onPressed: _copied
? () {
GoRouter.of(context).go("/passwordSetup/$_mnemonic");
}
: () {
GoRouter.of(context).go("/");
},
child: Text(_copied ? 'Continue' : 'Go Back'),
)
],
),
],
),
const SizedBox(height: 60),
],
),
),
);
}
Expand All @@ -105,4 +101,4 @@ class _GeneratePhraseScreenState extends State<GeneratePhraseScreen> {
_mnemonic = mnemonic;
});
}
}
}
36 changes: 11 additions & 25 deletions lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class _HomeScreenState extends State<HomeScreen> {

@override
Widget build(BuildContext context) {

return Scaffold(
appBar: AppBar(
title: const Text('DINOGROW'),
Expand All @@ -33,68 +32,57 @@ class _HomeScreenState extends State<HomeScreen> {
padding: const EdgeInsets.all(16),
child: ListView(
children: [

// User card
Card(
child: Padding(
padding: const EdgeInsets.all(8),
child: Column(
children: [

const Text('User'),

Text(_publicKey == null
? 'Loading...'
: '${_publicKey!.substring(0,4)}...${_publicKey!.substring(_publicKey!.length-3, _publicKey!.length)}'
),

Text(_publicKey == null
? 'Loading...'
: '${_publicKey!.substring(0, 4)}...${_publicKey!.substring(_publicKey!.length - 3, _publicKey!.length)}'),
Text(_balance ?? 'Loading...'),

],
),
),
),
),

// menu card
Card(
child: Padding(
padding: EdgeInsets.all(8),
child: Column(
children: [

TextButton(
child: Text('My Dinogrow'),
onPressed: () {
// My Dinos button
},
),

TextButton(
child: Text('Mini Games'),
onPressed: () {
GoRouter.of(context).go("/mini_games");
onPressed: () {
GoRouter.of(context).push("/mini_games");
},
),

TextButton(
child: Text('Wallet'),
onPressed: () {
// wallet button
},
),

TextButton(
child: Text('Ranking'),
child: Text('Ranking'),
onPressed: () {
// Ranking button
},
)

],
),
),
),

// logout card
Card(
child: Padding(
Expand All @@ -105,19 +93,17 @@ class _HomeScreenState extends State<HomeScreen> {
IconButton(
icon: Icon(Icons.logout),
onPressed: () {
GoRouter.of(context).go("/");
GoRouter.of(context).push("/");
},
)
],
),
),
),

],
),
),
);

}

void _readPk() async {
Expand Down Expand Up @@ -152,4 +138,4 @@ class _HomeScreenState extends State<HomeScreen> {
_balance = balance.toString();
});
}
}
}
Loading

0 comments on commit 5ddbaff

Please sign in to comment.