@@ -21,112 +21,138 @@ class WelcomeView extends StatelessWidget {
2121 @override
2222 Widget build (BuildContext context) {
2323 final p = context.palette;
24- return Center (
25- child: ConstrainedBox (
26- constraints: const BoxConstraints (maxWidth: 520 ),
27- child: Column (
28- mainAxisSize: MainAxisSize .min,
29- children: [
30- const BrandMark (size: 64 ),
31- const SizedBox (height: 22 ),
32- Text (
33- 'Visual MD' ,
34- style: context.type.serif (
35- color: p.ink,
36- size: 40 ,
37- weight: FontWeight .w700,
38- height: 1.1 ,
39- ),
40- ),
41- const SizedBox (height: 10 ),
42- Text (
43- 'The last markdown reader you need.' ,
44- textAlign: TextAlign .center,
45- style: context.type.serif (
46- color: p.muted,
47- size: 19 ,
48- style: FontStyle .italic,
49- ),
50- ),
51- const SizedBox (height: 40 ),
52- Container (
53- width: double .infinity,
54- padding: const EdgeInsets .symmetric (vertical: 44 , horizontal: 24 ),
55- decoration: BoxDecoration (
56- color: p.panel.withValues (alpha: 0.6 ),
57- borderRadius: BorderRadius .circular (14 ),
58- border: Border .all (color: p.border, width: 1.5 ),
59- ),
60- child: Column (
61- children: [
62- Icon (
63- Icons .drive_folder_upload_outlined,
64- size: 30 ,
65- color: p.muted,
66- ),
67- const SizedBox (height: 14 ),
68- Text (
69- opening
70- ? 'Shelving your documents…'
71- : 'Drop a folder or markdown anywhere' ,
72- style: context.type.sans (
73- color: p.ink,
74- size: 15 ,
75- weight: FontWeight .w500,
24+ return LayoutBuilder (
25+ builder: (context, constraints) {
26+ const verticalInset = 24.0 ;
27+ final minimumHeight = constraints.hasBoundedHeight
28+ ? (constraints.maxHeight - verticalInset * 2 ).clamp (
29+ 0.0 ,
30+ double .infinity,
31+ )
32+ : 0.0 ;
33+ return SingleChildScrollView (
34+ padding: const EdgeInsets .symmetric (vertical: verticalInset),
35+ child: ConstrainedBox (
36+ constraints: BoxConstraints (minHeight: minimumHeight),
37+ child: Center (
38+ child: ConstrainedBox (
39+ constraints: const BoxConstraints (maxWidth: 520 ),
40+ child: Column (
41+ mainAxisSize: MainAxisSize .min,
42+ children: [
43+ const BrandMark (size: 64 ),
44+ const SizedBox (height: 22 ),
45+ Text (
46+ 'Visual MD' ,
47+ style: context.type.serif (
48+ color: p.ink,
49+ size: 40 ,
50+ weight: FontWeight .w700,
51+ height: 1.1 ,
52+ ),
53+ ),
54+ const SizedBox (height: 10 ),
55+ Text (
56+ 'The last markdown reader you need.' ,
57+ textAlign: TextAlign .center,
58+ style: context.type.serif (
59+ color: p.muted,
60+ size: 19 ,
61+ style: FontStyle .italic,
62+ ),
7663 ),
77- ),
78- const SizedBox (height: 6 ),
79- Text (
80- 'Open one file, or every markdown nested in a folder.' ,
81- textAlign: TextAlign .center,
82- style: context.type.sans (color: p.muted, size: 13 ),
83- ),
84- const SizedBox (height: 22 ),
85- FilledButton .icon (
86- onPressed: opening ? null : onOpenFolder,
87- style: FilledButton .styleFrom (
88- backgroundColor: p.accent,
89- foregroundColor: p.paper,
64+ const SizedBox (height: 40 ),
65+ Container (
66+ width: double .infinity,
9067 padding: const EdgeInsets .symmetric (
91- horizontal : 20 ,
92- vertical : 14 ,
68+ vertical : 44 ,
69+ horizontal : 24 ,
9370 ),
94- textStyle: context.type.sans (
95- color: p.paper,
96- size: 14 ,
97- weight: FontWeight .w600,
71+ decoration: BoxDecoration (
72+ color: p.panel.withValues (alpha: 0.6 ),
73+ borderRadius: BorderRadius .circular (14 ),
74+ border: Border .all (color: p.border, width: 1.5 ),
75+ ),
76+ child: Column (
77+ children: [
78+ Icon (
79+ Icons .drive_folder_upload_outlined,
80+ size: 30 ,
81+ color: p.muted,
82+ ),
83+ const SizedBox (height: 14 ),
84+ Text (
85+ opening
86+ ? 'Shelving your documents…'
87+ : 'Drop a folder or markdown anywhere' ,
88+ style: context.type.sans (
89+ color: p.ink,
90+ size: 15 ,
91+ weight: FontWeight .w500,
92+ ),
93+ ),
94+ const SizedBox (height: 6 ),
95+ Text (
96+ 'Open one file, or every markdown nested in a folder.' ,
97+ textAlign: TextAlign .center,
98+ style: context.type.sans (color: p.muted, size: 13 ),
99+ ),
100+ const SizedBox (height: 22 ),
101+ FilledButton .icon (
102+ onPressed: opening ? null : onOpenFolder,
103+ style: FilledButton .styleFrom (
104+ backgroundColor: p.accent,
105+ foregroundColor: p.paper,
106+ padding: const EdgeInsets .symmetric (
107+ horizontal: 20 ,
108+ vertical: 14 ,
109+ ),
110+ textStyle: context.type.sans (
111+ color: p.paper,
112+ size: 14 ,
113+ weight: FontWeight .w600,
114+ ),
115+ ),
116+ icon: const Icon (
117+ Icons .folder_open_outlined,
118+ size: 18 ,
119+ ),
120+ label: const Text ('Open a folder' ),
121+ ),
122+ ],
98123 ),
99124 ),
100- icon: const Icon (Icons .folder_open_outlined, size: 18 ),
101- label: const Text ('Open a folder' ),
102- ),
103- ],
104- ),
105- ),
106- const SizedBox (height: 18 ),
107- TextButton (
108- onPressed: opening ? null : onOpenSample,
109- child: Text (
110- 'or browse the sample library' ,
111- style: context.type.sans (
112- color: p.accent,
113- size: 13.5 ,
114- weight: FontWeight .w500,
125+ const SizedBox (height: 18 ),
126+ TextButton (
127+ onPressed: opening ? null : onOpenSample,
128+ child: Text (
129+ 'or browse the sample library' ,
130+ style: context.type.sans (
131+ color: p.accent,
132+ size: 13.5 ,
133+ weight: FontWeight .w500,
134+ ),
135+ ),
136+ ),
137+ if (error != null ) ...[
138+ const SizedBox (height: 8 ),
139+ Text (
140+ error! ,
141+ style: context.type.sans (color: p.accent, size: 13 ),
142+ ),
143+ ],
144+ const SizedBox (height: 28 ),
145+ Text (
146+ 'Nothing leaves your machine.' ,
147+ style: context.type.sans (color: p.muted, size: 12 ),
148+ ),
149+ ],
115150 ),
116151 ),
117152 ),
118- if (error != null ) ...[
119- const SizedBox (height: 8 ),
120- Text (error! , style: context.type.sans (color: p.accent, size: 13 )),
121- ],
122- const SizedBox (height: 28 ),
123- Text (
124- 'Nothing leaves your machine.' ,
125- style: context.type.sans (color: p.muted, size: 12 ),
126- ),
127- ],
128- ),
129- ),
153+ ),
154+ );
155+ },
130156 );
131157 }
132158}
0 commit comments