AiCompletion class

A class that provides AI completion functionality. Click here for documentation: AICompletion

Example usage:

import 'package:flutter/material.dart';
import 'package:code_crafter/code_crafter.dart';

final aiCompletion = AiCompletion(
   model: Gemini(
       apiKey: "Your API Key",
   )
)

Then pass the aiCompletion instance to the CodeCrafter widget:

CodeCrafter(
   controller: controller,
   theme: anOldHopeTheme,
   aiCompletion: aiCompletion, // Pass the AI completion instance here
),

Constructors

AiCompletion({required Models model, CompletionType completionType = CompletionType.auto, int debounceTime = 1000, bool enableCompletion = true})

Properties

completionType CompletionType
Whether the completion is auto or manual Use CompletionType.auto for automatic completion and CompletionType.manual to invoke the completion on a callback or CompletionType.mixed for both. Defaults to CompletionType.auto
getter/setter pair
debounceTime int
The debounce time in milliseconds for AI completion requests. Defaults to 1000ms.
getter/setter pair
enableCompletion bool
Whether to enable AI completion. Defaults to true.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
model Models
The model to use for AI completion.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited