diff --git a/evently/lib/evently_provider.dart b/evently/lib/evently_provider.dart index f4204f9c8a..c7f5e6b058 100644 --- a/evently/lib/evently_provider.dart +++ b/evently/lib/evently_provider.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:evently/main.dart'; import 'package:evently/models/denom.dart'; +import 'package:evently/models/events.dart'; import 'package:evently/models/picked_file_model.dart'; import 'package:evently/repository/repository.dart'; import 'package:evently/utils/constants.dart'; @@ -11,7 +12,6 @@ import 'package:flutter/widgets.dart'; import 'package:injectable/injectable.dart'; import 'package:pylons_sdk/low_level.dart'; -import 'models/events.dart'; enum FreeDrop { yes, no, unselected } @@ -195,14 +195,13 @@ class EventlyProvider extends ChangeNotifier { _recipeId = repository.autoGenerateEventlyId(); - return Future.value(true); } /// send createCookBook tx message to the wallet app /// return true or false depending on the response from the wallet app Future createCookbook() async { - _cookbookId = repository.autoGenerateEventlyId(); + _cookbookId = repository.autoGenerateCookbookId(); final cookBook1 = Cookbook( creator: "", id: _cookbookId, diff --git a/evently/lib/repository/repository.dart b/evently/lib/repository/repository.dart index 2cb8440741..2706d8d076 100644 --- a/evently/lib/repository/repository.dart +++ b/evently/lib/repository/repository.dart @@ -15,7 +15,7 @@ abstract class Repository { /// This method will generate evently Id for the event /// Output: [String] the id of the Event that is going to be added in the recipe - String autoGenerateEventlyId(); + String autoGenerateCookbookId(); /// This method will save the username of the cookbook generator /// Input: [username] the username of the user who created the cookbook @@ -29,6 +29,10 @@ abstract class Repository { /// This method will get the username of the cookbook generator /// Output: [String] returns whether the operation is successful or not String getCookBookGeneratorUsername(); + + /// This method will generate easel Id for the NFT + /// Output: [String] the id of the NFT that is going to be added in the recipe + String autoGenerateEventlyId(); } @LazySingleton(as: Repository) @@ -53,7 +57,7 @@ class RepositoryImp implements Repository { } @override - String autoGenerateEventlyId() => localDataSource.autoGenerateEventlyId(); + String autoGenerateCookbookId() => localDataSource.autoGenerateCookbookId(); @override Future saveCookBookGeneratorUsername(String username) { @@ -70,4 +74,9 @@ class RepositoryImp implements Repository { return localDataSource.getCookBookGeneratorUsername(); } + @override + String autoGenerateEventlyId() { + return localDataSource.autoGenerateEventlyId(); + } + } diff --git a/evently/lib/services/datasources/local_datasource.dart b/evently/lib/services/datasources/local_datasource.dart index 314e155d45..6bc64cef88 100644 --- a/evently/lib/services/datasources/local_datasource.dart +++ b/evently/lib/services/datasources/local_datasource.dart @@ -6,7 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart'; abstract class LocalDataSource { /// This method will generate Evently Id for the Event /// Output: [String] the id of the Event that is going to be added in the recipe - String autoGenerateEventlyId(); + String autoGenerateCookbookId(); /// This method will save the username of the cookbook generator /// Input: [username] the username of the user who created the cookbook @@ -20,6 +20,10 @@ abstract class LocalDataSource { /// This method will get the username of the cookbook generator /// Output: [String] returns whether the operation is successful or not String getCookBookGeneratorUsername(); + + /// This method will generate easel Id for the NFT + /// Output: [String] the id of the NFT that is going to be added in the recipe + String autoGenerateEventlyId(); } @LazySingleton(as: LocalDataSource) @@ -29,8 +33,8 @@ class LocalDataSourceImpl extends LocalDataSource { final SharedPreferences sharedPreferences; @override - String autoGenerateEventlyId() { - final String cookbookId = "Event_Recipe_auto_recipe_${getFullDateTime()}"; + String autoGenerateCookbookId() { + final String cookbookId = "Evently_CookBook_auto_cookbook_${getFullDateTime()}"; return cookbookId; } @@ -52,4 +56,11 @@ class LocalDataSourceImpl extends LocalDataSource { return sharedPreferences.getString(kUsername) ?? ''; } + /// auto generates easelID string + /// returns easelId + @override + String autoGenerateEventlyId() { + final String cookbookId = "Evently_Recipe_auto_recipe_${getFullDateTime()}"; + return cookbookId; + } }