Please not that you need to get working api key from OpenAi to enable ChatGpt

Sample Usage:

import 'package:flutter/material.dart';
import 'package:chatgpt_package/chatgpt_module.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // Replace with your OpenAI API key
    String openaiApiKey = 'YOUR_OPENAI_API_KEY';

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('ChatGPT Demo'),
        ),
        body: Center(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: ChatgptModule(token: openaiApiKey),
          ),
        ),
      ),
    );
  }
}

Libraries

chatgpt_package