- Download and install Flutter. Make sure to install the latest version of the release channel.
- Download and install any IDE to edit the code. Using Visual Studio Code or Android Studio is recommended.
- Download and install the Flutter and Dart plugins in your IDE.
- Create an empty
secrets.env
file on root level. - Run with
flutter run
for Android or iOS.flutter run -d chrome -t lib/main_web.dart
for web.flutter run -d macos
for macOS.
- Getting a valid
google-services.json
file- Create a Firebase project.
- Create an application with any name you desire. Ensure that the package name
com.crowncorp.smartdueldisk
so that it can be used to build the application. - Download the
google-services.json
for the application you created. - Copy the file over into
android/app
.
- Install all of the dependencies of the application using the command
flutter pub get
. - The pre built deck data is stored in the Firebase Firestore. It's possible to use mock data instead of data from the Firestore. If you insist on creating a working version of the Firestore collection yourself, please contact the owner on GitHub or Discord.
- Find the class
FirebaseCloudDatabaseProvider
. - Alter the method
getPreBuiltDeckCardIds
to return a Future with a list of card ids. A list of valid ids for speed duels is provided by the YgoPro Api Endpoint. Any card id can be included in the list but only the speed duel applicable cards will be selected from your list. (The app will throw an exception if your deck is empty, so ensure that all your cards are valid beforehand). An example implementation:
- Find the class
Future<Iterable<int>> getPreBuiltDeckCardIds(PreBuiltDeck deck) async {
return [46986414, 32207100]
}
You should now be able to build and run the app.
If you add a new route, set up a class for dependency injection, create a sealed class, ... you'll need to initialise the code generation.
To generate the code once, execute the following command: flutter pub run build_runner build --delete-conflicting-outputs
To generate the code every time you make a change, execute the following command: flutter pub run build_runner watch --delete-conflicting-outputs