random deadline

This commit is contained in:
Вячеслав Иванов 2024-09-10 23:49:54 +04:00
parent bcac3a5e03
commit ffcabca487

View File

@ -1,3 +1,5 @@
import 'dart:math';
import 'package:flutter/material.dart';
import 'weekManager.dart';
@ -36,8 +38,9 @@ class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
super.initState();
final random = Random();
_weekManagers = List.generate(5, (index) {
DateTime deadline = DateTime.now().add(Duration(days: (index + 1) * 7));
DateTime deadline = DateTime.now().add(Duration(days: random.nextInt(365)));
return WeekManager(deadline);
});
_updateDeadlines();