mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 18:57:05 +08:00
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.
37 lines
919 B
Dart
37 lines
919 B
Dart
import 'package:flutter/material.dart';
|
|
import '../models/models.dart';
|
|
|
|
class AIConfigSlider extends StatelessWidget {
|
|
final ModelConfig configuration;
|
|
final Function(ModelConfig) onSliderUpdated;
|
|
final bool readonly;
|
|
const AIConfigSlider({
|
|
super.key,
|
|
required this.configuration,
|
|
required this.onSliderUpdated,
|
|
this.readonly = false,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final val = configuration.value.value as (double, double, double);
|
|
return Row(
|
|
children: [
|
|
Expanded(
|
|
child: Slider(
|
|
min: val.$1,
|
|
value: val.$2,
|
|
max: val.$3,
|
|
onChanged: (x) {
|
|
if (readonly) return;
|
|
configuration.value.value = (val.$1, x, val.$3);
|
|
onSliderUpdated(configuration);
|
|
},
|
|
),
|
|
),
|
|
Text(val.$2.toStringAsFixed(2)),
|
|
],
|
|
);
|
|
}
|
|
}
|