From 23af61c1d0b25a2529e785e2e2af1d6e93355e2f Mon Sep 17 00:00:00 2001 From: Dan Lopez Date: Thu, 5 Oct 2023 15:20:38 -0500 Subject: [PATCH] refactor: change readme and some texts in home and my dino screens --- README.md | 82 ++++++++++++++++++++--- lib/pages/home.dart | 90 ++------------------------ lib/pages/input_phrase.dart | 2 +- lib/pages/my-dinogrow/my_dinogrow.dart | 2 +- 4 files changed, 81 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index 855dae8..0a018da 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,80 @@ -# dinogrow +# DINOGROW -A new Flutter project. +![DINOGROW Logo](https://github.com/sistemaseltigre/dinogrow/raw/master/assets/images/logo.jpeg) + +DINOGROW is an exciting mobile game developed in Flutter that combines the fun of dinosaur games with the power of the Solana blockchain. In this game, players can create a new wallet on the Solana blockchain as their in-game identity, allowing them to interact with the blockchain quickly and transparently. + +## Key Features + +- Solana Login: Players can log in to the game and generate a new wallet on the Solana blockchain, which acts as their avatar in the game. +- NFTs and Paid Games: Players who own NFTs can participate in paid matches and compete for rewards. Rewards are divided among the top 3 players on the leaderboard every 24 hours. +- Offline Mode: DINOGROW allows players to enjoy the game without an internet connection. You can play anywhere and decide when to synchronize blockchain transactions later. +- Dinosaur Games: The project focuses on creating a series of dinosaur mini-games that interact with the Solana blockchain, providing a unique gaming experience. + +## Objectives + +- Hackathon Participation: Our main goal is to develop at least one dinosaur mini-game before the end of the Solana Hyperdrive Hackathon. + +- Open Source: This project is entirely open source. Anyone can download and use it as a foundation for creating their own mobile blockchain game. We are using Flutter and Flutter Flame, along with the Solana and Solana Web3 libraries to ensure functionality and stability. + +## Quicknode Integration + +In this project, we utilize Quicknode and its NFT API to seamlessly access Solana NFTs. Quicknode provides a fast and easy way to interact with the Solana blockchain, enhancing the user experience. + +## Set up .env + +Create a .env File: You need to create a .env file at the root of your project directory. This file should contain the following two environment variables: +QUICKNODE_RPC_URL and QUICKNODE_RPC_WSS with the appropriate RPC URL and WebSocket URL that you want to use. + +```bash +QUICKNODE_RPC_URL=https://your-quicknode-rpc-url.com +QUICKNODE_RPC_WSS=wss://your-quicknode-websocket-url.com +``` + +Note: These settings will enable your application to connect to Quicknode's Solana API for NFT functionality. If you use other RPCs, obtaining data from the nft may not work the same way. + +Example .env content: ## Getting Started -This project is a starting point for a Flutter application. +If you want to try DINOGROW or contribute to the project, follow these steps: + +- Clone the Repository: Clone this repository to your local machine using the following command: + +```bash + git clone https://github.com/YourUsername/DINOGROW.git +``` + +- Install Dependencies: Make sure you have Flutter and the Solana and Solana Web3 libraries installed. Then, install the project's dependencies: + +```bash + flutter pub get +``` + +- Run the Game: Start the game on your device or emulator with the following command: + +```bash + flutter run +``` + +## Contributions + +We welcome contributions from the community! If you'd like to collaborate on the project, please follow these guidelines: + +Fork the repository. +Make your changes in a new branch. +Submit a pull request (PR) describing your changes concisely. + +## License + +This project is licensed under the MIT License. See the LICENSE file for more details. + +## Contact + +If you have any questions or suggestions, feel free to contact us: -A few resources to get you started if this is your first Flutter project: +Email: dinogrow@​yahoo.com -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) +Twitter: @DIN0GR0W -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +We hope you enjoy DINOGROW, and we hope this project inspires others to create mobile SOLANA blockchain games. Have fun playing and developing! diff --git a/lib/pages/home.dart b/lib/pages/home.dart index 46facfd..c49f1c5 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -47,7 +47,7 @@ class _HomeScreenState extends State { child: Row( children: [ const Text( - 'Wallet: ', + 'User: ', style: TextStyle( fontWeight: FontWeight.bold, color: Colors.black), ), @@ -91,14 +91,14 @@ class _HomeScreenState extends State { icon: Icon(Icons.emoji_events), text: 'Ranking', ), - Tab( - icon: Icon(Icons.wallet), - text: 'Wallet', - ), Tab( icon: Icon(Icons.pets), text: 'My Dino', ), + Tab( + icon: Icon(Icons.wallet), + text: 'Wallet', + ), ], ), ], @@ -115,91 +115,13 @@ class _HomeScreenState extends State { children: [ const MiniGamesScreen(), RankingScreen(), - WalletScreen(address: _publicKey, balance: _balance), const MydinogrowScreen(), + WalletScreen(address: _publicKey, balance: _balance), ], ), ), ), ); - - // Scaffold( - // body: Padding( - // 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(_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).push("/mini_games"); - // }, - // ), - // TextButton( - // child: Text('Wallet'), - // onPressed: () { - // // wallet button - // }, - // ), - // TextButton( - // child: Text('Ranking'), - // onPressed: () { - // // Ranking button - // }, - // ) - // ], - // ), - // ), - // ), - - // // logout card - // Card( - // child: Padding( - // padding: EdgeInsets.all(8), - // child: Row( - // children: [ - // Text('Log Out'), - // IconButton( - // icon: Icon(Icons.logout), - // onPressed: () { - // GoRouter.of(context).push("/"); - // }, - // ) - // ], - // ), - // ), - // ), - // ], - // ), - // ), - // ); } void _readPk() async { diff --git a/lib/pages/input_phrase.dart b/lib/pages/input_phrase.dart index 71d8970..0c1e543 100644 --- a/lib/pages/input_phrase.dart +++ b/lib/pages/input_phrase.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:bip39/bip39.dart' as bip39; -import 'package:dinogrow/pages/setupPassword.dart'; +import 'package:dinogrow/pages/setup_password.dart'; import '../ui/widgets/widgets.dart'; class InputPhraseScreen extends StatefulWidget { diff --git a/lib/pages/my-dinogrow/my_dinogrow.dart b/lib/pages/my-dinogrow/my_dinogrow.dart index e19e8b4..61e7f68 100644 --- a/lib/pages/my-dinogrow/my_dinogrow.dart +++ b/lib/pages/my-dinogrow/my_dinogrow.dart @@ -33,7 +33,7 @@ class _MydinogrowScreenState extends State { color: Colors.orange[700], padding: const EdgeInsets.all(8), child: const Text( - 'Wait ... you must to have a Dino to start play our games, so "Claim your Dino" is our last step to auto-generate your first NFT free!', + 'Wait ... you must to have a Dino to start play our games, so "Claim your Dino" is our last step to auto-generate your first NFT!', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), textAlign: TextAlign.center, ),