widgetsString property

Future<String> get widgetsString

Returns the meta data for the widgets for comparison during the approval test

Implementation

Future<String> get widgetsString async {
  final completer = Completer<String>();
  assert(_widgetNames != null, '''
  Looks like Approved.initialize() was not called before running an approvalTest. Typically,
  this issue is solved by calling Approved.initialize() from within setUpAll:

      void setUpAll(() async {
        await Approved.initialize();
      });
''');

  await widgets_meta_data
      .collectWidgetsMetaData(
    this,
    outputMeta: true,
    verbose: false,
    widgetNames: ApprovalWidgets.widgetNames,
  )
      .then((stringList) {
    completer.complete(stringList.join('\n'));
  });

  return completer.future;
}