1. Problem to solve
It appears that the Mastodon API has already begun the transition to v2 endpoints, and several v1 endpoints have been designated as deprecated. In order for this library to follow this trend, the structure should be such that both v1 and v2 endpoints are compatible.
2. Proposal
Let's improve like below.
final mastodon = MastodonApi(
instance: 'MASTODON_INSTANCE',
bearerToken: 'BEARER_TOKEN',
);
// For v1 endpoint
mastodon.v1.timelines.xxxxxx;
// For v2 endpoint
mastodon.v2.timelines.xxxxxx;
3. More information