@@ -3,23 +3,53 @@ import 'package:fluent_ui/fluent_ui.dart';
33class AssignTasksDialog {
44 /// Pops up a dialog asking the user to confirm removal.
55 /// Returns true if “Remove” was pressed, false if “Cancel” (or null if dismissed).
6- static Future <bool ?> show (BuildContext context) {
7- return showDialog <bool >(
6+ static Future <double ?> show (BuildContext context) {
7+ double dueDateWeight = 5.0 ;
8+ return showDialog <double >(
89 context: context,
9- builder: (ctx) => ContentDialog (
10- title: const Text ('Assign Tasks?' ),
11- content: Text ('Are you sure you want to Assign Tasks?' ),
12- actions: [
13- Button (
14- child: const Text ('Cancel' ),
15- onPressed: () => Navigator .pop (ctx, false ),
10+ builder: (_) {
11+ return StatefulBuilder (
12+ builder: (ctx, dialogSetState) => ContentDialog (
13+ title: const Text ('Assign Tasks?' ),
14+ content: IntrinsicHeight (
15+ child: Column (children: [
16+ Text ('Are you sure you want to Assign Tasks?' ),
17+ const SizedBox (height: 12 ),
18+ Text ("Duedate weight compared to priority weight" ),
19+ const SizedBox (height: 4 ),
20+ Row (
21+ crossAxisAlignment: CrossAxisAlignment .center,
22+ children: [
23+ const Text ("🚨" ),
24+ Expanded (
25+ child: Slider (
26+ label: dueDateWeight.toString (),
27+ value: dueDateWeight.toDouble (),
28+ min: 1.0 ,
29+ max: 10.0 ,
30+ divisions: 9 ,
31+ onChanged: (v) =>
32+ dialogSetState (() => dueDateWeight = v.toDouble ()),
33+ ),
34+ ),
35+ const Text ("📆" ),
36+ ],
37+ ),
38+ ]),
39+ ),
40+ actions: [
41+ Button (
42+ child: const Text ('Cancel' ),
43+ onPressed: () => Navigator .pop (ctx, null ),
44+ ),
45+ FilledButton (
46+ child: const Text ('Assign' ),
47+ onPressed: () => Navigator .pop (ctx, dueDateWeight),
48+ ),
49+ ],
1650 ),
17- FilledButton (
18- child: const Text ('Assign' ),
19- onPressed: () => Navigator .pop (ctx, true ),
20- ),
21- ],
22- ),
51+ );
52+ },
2353 );
2454 }
2555}
0 commit comments