From ffcabca4877740b8128fb03383f6cf5a7fa5a3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D1=8F=D1=87=D0=B5=D1=81=D0=BB=D0=B0=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Tue, 10 Sep 2024 23:49:54 +0400 Subject: [PATCH] random deadline --- lib/main.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 3c7aad5..eb05b1d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:flutter/material.dart'; import 'weekManager.dart'; @@ -36,8 +38,9 @@ class _MyHomePageState extends State { @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();