Wait 2 sec before refresh ressources (on create)

This commit is contained in:
Thomas Fransolet 2024-03-14 15:04:43 +01:00
parent 8824609fad
commit fb0a8674d1
2 changed files with 19 additions and 12 deletions

View File

@ -42,6 +42,9 @@ class _SliderInputContainerState extends State<SliderInputContainer> {
), ),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: SliderTheme(
data: SliderThemeData(
showValueIndicator: ShowValueIndicator.always),
child: Slider( child: Slider(
value: currentValue!, value: currentValue!,
onChanged: (value) { onChanged: (value) {
@ -55,6 +58,7 @@ class _SliderInputContainerState extends State<SliderInputContainer> {
activeColor: widget.color, activeColor: widget.color,
), ),
), ),
),
], ],
), ),
); );

View File

@ -68,7 +68,10 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
if (result != null) if (result != null)
{ {
await create(result[0], result[1], result[2], appContext, context); await create(result[0], result[1], result[2], appContext, context);
setState(() {}); // For refresh Future.delayed(Duration(seconds: 2), () {
setState(() {});
});
// For refresh
} }
} else { } else {
var result = await showResource(value, appContext, context, size); var result = await showResource(value, appContext, context, size);