Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item factory #20

Merged
merged 5 commits into from Mar 6, 2020
Merged

Item factory #20

merged 5 commits into from Mar 6, 2020

Conversation

@TortoiseWrath
Copy link
Member

TortoiseWrath commented Mar 6, 2020

Related to #16 . This factory will be used to create the MultaccItem for each database item when loading a contact.

Blocked on #17 .

The name contact_types was misleading since the classes in this package
are used to create different types of items, not contacts.
Previously, the only data stored besides the database key in a
MultaccItem was a `value` string. This commit modifies the MultaccItem
base class to replace this string with a `fromJson` constructor and
`toJson` method.

The TwitterItem class provides an example implementation. The user ID
and display name are stored in two instance variables in the TwitterItem
class. The JSON stored in the database will look like:
    {'at':'fckeveryword','id':'944864788336824321'}

This way, implementations of MultaccItem can store arbitrary data as
necessary for the given platform.
This commit removes extraneous @override annotations and adds some fat
arrows to make the code less Java-flavored and more Dart-flavored.
This factory will be used to create MultaccItem instances from stored
data. These are the MultaccItems that will be stored in each
MultaccContact when they are loaded.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 6, 2020

Frontend team should add something like getIcon to MultaccItem

// @todo Frontend team should add something like getIcon to MultaccItem
}
enum MultaccItemType {
Twitter,
Snapchat, // @todo Implement snapchat


This comment was generated by todo based on a todo comment in 3979589 in #20. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 6, 2020

Implement snapchat

Snapchat, // @todo Implement snapchat
Instagram, // @todo Implement instagram
Facebook, // @todo Implement facebook
Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 3979589 in #20. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 6, 2020

Implement instagram

Instagram, // @todo Implement instagram
Facebook, // @todo Implement facebook
Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 3979589 in #20. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 6, 2020

Implement facebook

Facebook, // @todo Implement facebook
Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 3979589 in #20. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 6, 2020

Implement discord

Discord, // @todo Implement discord
Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 3979589 in #20. cc @multacc.
@TortoiseWrath

This comment has been minimized.

Copy link
Member Author

TortoiseWrath commented Mar 6, 2020

oh no the bot

@todo

This comment has been minimized.

Copy link

todo bot commented Mar 6, 2020

Implement dogecoin

Dogecoin // @todo Implement dogecoin
}


This comment was generated by todo based on a todo comment in 3979589 in #20. cc @multacc.
@todo

This comment has been minimized.

Copy link

todo bot commented Mar 6, 2020

Implement Twitter launching

// @todo Implement Twitter launching
}
bool isLaunchable() => true;
}


This comment was generated by todo based on a todo comment in 3979589 in #20. cc @multacc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.