update to use dart:convert library for encoding

Encoding class moved to dart:convert package. This patch takes care of this update