Код: Выделить всё
import 'dart:async';
import 'package:flutter/material.dart';
class MyFile extends StatefulWidget {
const MyFile({super.key});
@override
State createState() => _MyFileState();
}
class _MyFileState extends State {
double _value = 0.0;
@override
void initState() {
super.initState();
Timer.periodic(const Duration(seconds: 1), (timer) {
setState(() {
_value += .2;
});
if (_value == 1) {
timer.cancel();
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: LinearProgressIndicator(
value: _value,
),
),
);
}
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... sindicator