import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_api_new/api.dart'; import 'dart:convert'; class WebConfig extends StatefulWidget { final String? color; final String? label; final WebDTO initialValue; final ValueChanged onChanged; const WebConfig({ Key? key, this.color, this.label, required this.initialValue, required this.onChanged, }) : super(key: key); @override _WebConfigState createState() => _WebConfigState(); } class _WebConfigState extends State { late WebDTO resourceSource; // WebDTO == VideoDTO @override void initState() { WebDTO test = widget.initialValue; resourceSource = test; super.initState(); } @override Widget build(BuildContext context) { return StringInputContainer( label: widget.label!, initialValue: resourceSource.source_ == null ? '': resourceSource.source_, onChanged: (String url) { resourceSource.source_ = url; widget.onChanged(resourceSource); }, isUrl: true, maxLength: 100 ); } }