# FriendsContext.fromUrl constructor Null safety

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'] == describeEnum(Order.asc)) {
        order = Order.asc;
      } else if (url.queryParameters['order'] == describeEnum(Order.desc)) {
        order = Order.desc;
      } else {
        order = null;
      }

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