FriendsContext.fromUrl constructor

FriendsContext.fromUrl(
  1. Uri url
)

Implementation

FriendsContext.fromUrl(this.url) {
  offset = int.parse(url.queryParameters['offset']!);
  limit = int.parse(url.queryParameters['limit']!);

  if (url.queryParameters['order'] == Order.asc.name) {
    order = Order.asc;
  } else if (url.queryParameters['order'] == Order.desc.name) {
    order = Order.desc;
  } else {
    order = null;
  }

  if (url.queryParameters['friend_order'] == FriendOrder.nickname.name) {
    friendOrder = FriendOrder.nickname;
  } else if (url.queryParameters['friend_order'] ==
      FriendOrder.favorite.name) {
    friendOrder = FriendOrder.favorite;
  } else {
    friendOrder = null;
  }
}