2

Why does import 'dart:convert' show BASE64; give me an error?

import 'dart:convert' show BASE64;
    
var output = BASE64.encode(digest.bytes)

Undefined name 'BASE64'.

Thanks

  • 1
    You have a duplicated question. Check here the solution: https://stackoverflow.com/questions/52876399/flutter-base64-class-not-found – dpapadopoulos Feb 20 '19 at 07:12

1 Answers1

3

In Dart 2 such SCREAMING_CASE constant names were changed to lowerCamelCase

Just change BASE64 to base64. Similar with JSON -> json and a few more.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567