This repository contains a FlutterFlow-generated Flutter demo and custom Dart actions for sending chat messages to Groq. It is for Flutter and FlutterFlow developers who want to inspect the actions, run the exported demo, or adapt the source in their own project.
Clone the actual repository from GitHub:
git clone https://github.com/sgardoll/groqFlutterFlow.git
cd groqFlutterFlowThis is an exported Flutter project. Cloning it does not import a library into the FlutterFlow editor.
Install the Flutter SDK and Chrome for the web demo. The root pubspec.yaml declares Dart >=3.0.0 <4.0.0 and the Flutter dependencies. From the cloned repository root:
flutter pub get
flutter run -d chromeThe project includes web/ and opens the Demo page. The Chrome command follows Flutter's web setup instructions. These are setup commands, not a claim that this checkout has been built or tested with your SDK.
- Obtain your own Groq API key using Groq's quickstart.
- Use a chat model API ID currently available to your account; check Groq's model documentation. The bundled model registry is a static list, not a live availability check.
- In the demo, open the key icon and submit your key. Select a model from the dropdown, enter a text message, and press the send arrow. Choose a listed model that your account still supports; the direct Dart example below accepts your chosen API ID without relying on that list.
The demo passes the key through FFAppState().groqApiKey and persists it using the storage code in app_state.dart. The actions make requests directly from the app to Groq; they do not read a server environment variable. Use your own key for local experimentation and do not commit it or include it in shared examples.
Use this helper inside the exported project, for example from a widget event handler. Pass the key supplied by the user and a current chat model API ID as arguments; no credential or model ID is hardcoded here.
import 'package:groq_agentic_tools/custom_code/actions/index.dart' as actions;
Future<String> tryGroq(String apiKey, String modelId) async {
final setup = await actions.validateGroqSetup(apiKey, modelId, null);
if (!setup.success) {
return setup.errorMessage;
}
return await actions.sendGroqMessage(
'Explain what a Flutter widget is in one sentence.',
apiKey,
modelId,
null,
);
}This makes two API requests: validation sends a fixed test message, then the simple action sends the example prompt. Passing null omits optional search settings. validateGroqSetup returns a GroqResponseStruct; check success and errorMessage before proceeding. sendGroqMessage returns the assistant text, or a string beginning Groq API error: on failure, so callers must handle that result rather than assume every returned string is an answer.
| Action | Inputs, in order | Result |
|---|---|---|
| validateGroqSetup | String apiKey, String model, SearchSettingsStruct? searchSettings |
Future<GroqResponseStruct> with validation status, content, token counts and error details |
| sendGroqMessage | String message, String apiKey, String model, SearchSettingsStruct? searchSettings |
Future<String> containing assistant text or an error string |
| sendGroqMessageAdvanced | String message, String apiKey, String model, List<String>? chatHistory, SearchSettingsStruct? searchSettings, FFUploadedFile? imageFile |
Future<GroqResponseStruct> with content, token counts, success/error and executed tools when returned by Groq |
The actions are exported by actions/index.dart; generated data types live in schema/structs. Search settings map nonempty include/exclude domains and country into the request. The advanced action sends each supplied history string as a user message; it does not accept role-tagged conversation history. Image checks use the bundled registry, so model capabilities there also need checking against the provider's current documentation.
This repository provides action source and a demo, not a verified FlutterFlow Marketplace installation link or library ID. To adapt the actions, inspect their imports, generated structs and model registry together; copying an action file alone does not include those dependencies.
All three actions call Groq's chat-completions endpoint. Provider access, model availability, optional search/image support and live responses depend on your account and the selected model. This documentation describes the checked-in source contract; it does not establish live API success, mobile-device support or a production-ready credential design.