import 'dart:async';

import 'package:flutter_tts/flutter_tts.dart';

class RobotProvider {
  static final RobotProvider _singleton = RobotProvider._internal();
  var value;
  StreamController<Map> controller = StreamController<Map>.broadcast();
  FlutterTts flutterTts = FlutterTts();
  getData() {
    // return data;
  }
  intStream() {
    controller.add({});
  }

  setValue(Map data) {
    value = data;
    controller.add(value);
  }

  factory RobotProvider() {
    return _singleton;
  }

  RobotProvider._internal();
  speak(data) async {
    await flutterTts.speak(data);
  }
}
