title: How can i print to thermal bluetooth printer?
body: <p>I develop a mobile point of sale with flutter, but I don't know how to print the receipt on a Bluetooth thermal printer</p>
  
  <p>I currently develop a plugin for it but it doesn't work yet</p>
  
  <pre><code>protected void printBill() {
         if(btsocket == null){
            btsocket = DeviceList.getSocket();
            Intent BTIntent = new Intent(getApplicationContext(),        DeviceList.class);
            this.startActivityForResult(BTIntent, DeviceList.REQUEST_CONNECT_BT);
          Toast.makeText(activity,"tes",Toast.LENGTH_LONG).show();
      }
      else{
          OutputStream opstream = null;
          try {
              opstream = btsocket.getOutputStream();
          } catch (IOException e) {
              e.printStackTrace();
          }
          outputStream = opstream;
  
          //print command
          try {
              try {
                  Thread.sleep(1000);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
              outputStream = btsocket.getOutputStream();
              byte[] printformat = new byte[]{0x1B,0x21,0x03};
              outputStream.write(printformat);
  
  
              printCustom("Fair Group BD",2,1);
              printCustom("Pepperoni Foods Ltd.",0,1);
              printCustom("H-123, R-123, Dhanmondi, Dhaka-1212",0,1);
              printCustom("Hot Line: +88000 000000",0,1);
              printCustom("Vat Reg : 0000000000,Mushak : 11",0,1);
              String dateTime[] = getDateTime();
              printText(leftRightAlign(dateTime[0], dateTime[1]));
              printText(leftRightAlign("Qty: Name" , "Price "));
              printCustom(new String(new char[32]).replace("\0", "."),0,1);
              printText(leftRightAlign("Total" , "2,0000/="));
              printNewLine();
              printCustom("Thank you for coming &amp; we look",0,1);
              printCustom("forward to serve you again",0,1);
              printNewLine();
              printNewLine();
  
              outputStream.flush();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>The source code can be found <a href="https://github.com/kakzaki/print_esc_flutter" rel="nofollow noreferrer">here</a></p>
  
  <p>Please help me develop this plugin, at least it can print text</p>