@@ -12,40 +12,57 @@ class AddProject extends StatelessWidget {
1212
1313 @override
1414 Widget build (BuildContext context) {
15- return Consumer2 <DashboardProvider ,SupabaseService >(builder: (context, provider,suprovider, child) {
16- return AlertDialog (
17- shape: RoundedRectangleBorder (borderRadius: BorderRadius .circular (12 )),
18- title: Text (
19- 'Create Project' ,
20- style: TextStyle (fontFamily: 'Frederik' ,fontSize: 28. sp ,fontWeight: FontWeight .bold),
21- ),
22- content: Column (
23- mainAxisSize: MainAxisSize .min,
24- children: [
25- BuildProject (
26- icon: PhosphorIconsRegular .plus,
27- label: 'Start Blank Project' ,
28- onTap: () async {
29- context.pop ();
30- provider.createNewProject (context);
31- },
32- txtColor: suprovider.isDark? Colors .white: Colors .black,
33- borderColor: suprovider.isDark? Colors .white: Colors .black,
15+ return Consumer2 <DashboardProvider , SupabaseService >(
16+ builder: (context, provider, suprovider, child) {
17+ return AlertDialog (
18+ shape: RoundedRectangleBorder (
19+ borderRadius: BorderRadius .circular (12 ),
20+ ),
21+ title: Text (
22+ 'Create Project' ,
23+ style: TextStyle (
24+ fontFamily: 'Frederik' ,
25+ fontSize: 28. sp,
26+ fontWeight: FontWeight .bold,
3427 ),
35- SizedBox (height: 16 ),
36- BuildProject (
37- icon: PhosphorIconsRegular .fileArrowDown,
38- label: 'Import Existing Project' ,
39- onTap: () async {
40- context.pop ();
41- provider.importExistingProject (context);
42- },
43- txtColor: suprovider.isDark? Colors .white: Colors .black,
44- borderColor: suprovider.isDark? Colors .white: Colors .black,
45- ),
46- ],
47- ),
48- );
49- });
28+ ),
29+ content: Column (
30+ mainAxisSize: MainAxisSize .min,
31+ children: [
32+ BuildProject (
33+ icon: PhosphorIconsRegular .plus,
34+ label: 'Start Blank Project' ,
35+ onTap: () async {
36+ String output = await provider.createNewProject (context);
37+ if (output != 'Workspace created successfully!!' ) {
38+ ScaffoldMessenger .of (context).showSnackBar (
39+ SnackBar (
40+ content: Text (output),
41+ backgroundColor: Colors .lightGreen,
42+ duration: const Duration (seconds: 3 ),
43+ ),
44+ );
45+ }
46+ context.pop ();
47+ },
48+ txtColor: suprovider.isDark ? Colors .white : Colors .black,
49+ borderColor: suprovider.isDark ? Colors .white : Colors .black,
50+ ),
51+ SizedBox (height: 16 ),
52+ BuildProject (
53+ icon: PhosphorIconsRegular .fileArrowDown,
54+ label: 'Import Existing Project' ,
55+ onTap: () async {
56+ context.pop ();
57+ provider.importExistingProject (context);
58+ },
59+ txtColor: suprovider.isDark ? Colors .white : Colors .black,
60+ borderColor: suprovider.isDark ? Colors .white : Colors .black,
61+ ),
62+ ],
63+ ),
64+ );
65+ },
66+ );
5067 }
51- }
68+ }
0 commit comments