whats_json 1.0.4 copy "whats_json: ^1.0.4" to clipboard
whats_json: ^1.0.4 copied to clipboard

Extract messages from WhatsApp _chat.txt export file and convert them to JSON format

example/whats_json_example.dart

import 'dart:io';
import 'dart:convert';
import 'package:whats_json/whats_json.dart';

void main() async {
  // file location
  final path = "./example/_chat.txt";

  // load file
  final stream = File(path)
      .openRead()
      .transform(const Utf8Decoder())
      .transform(const LineSplitter());

  // get messages
  final messages = await whatsGetMessages(stream, skipSystem: true);
  print("messages count: ${messages.length}");

  // print messages
  for (final message in messages) {
    print(message);
  }
}
5
likes
150
points
54
downloads

Publisher

verified publisherstarkdev.org

Weekly Downloads

Extract messages from WhatsApp _chat.txt export file and convert them to JSON format

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

intl, mime

More

Packages that depend on whats_json