Files
apidash/packages/genai/lib/widgets/ai_config_bool.dart
Ankit Mahato 72fea1ba65 Refactor genai package to new modular interface
Reorganized the genai package by removing legacy LLM-related files and introducing a new modular interface under the 'interface' directory. Added provider-specific model classes, centralized constants, and updated the example to use the new API and data structures. Updated exports in genai.dart and improved dependency management.
2025-08-27 02:08:36 +05:30

27 lines
635 B
Dart

import 'package:flutter/material.dart';
import '../models/models.dart';
class AIConfigBool extends StatelessWidget {
final ModelConfig configuration;
final Function(ModelConfig) onConfigUpdated;
final bool readonly;
const AIConfigBool({
super.key,
required this.configuration,
required this.onConfigUpdated,
this.readonly = false,
});
@override
Widget build(BuildContext context) {
return Switch(
value: configuration.value.value as bool,
onChanged: (x) {
if (readonly) return;
configuration.value.value = x;
onConfigUpdated(configuration);
},
);
}
}