@@ -26,60 +26,61 @@ class BaseInfoPage extends StatelessWidget {
2626
2727 @override
2828 Widget build (BuildContext context) {
29- // TODO Adaptive feature - remove left-right side bg,
29+ // TODO Adaptive feature - remove left-right side bg,
3030 // and set this image as vertical fullscreen bg with
3131 // geometric logo on top (like in mobile version from Figma)
3232 // but with more dimmed brightness
3333
3434 return Scaffold (
3535 backgroundColor: Colors .black,
36- body: Row (
37- mainAxisAlignment: MainAxisAlignment .spaceBetween,
38- crossAxisAlignment: CrossAxisAlignment .center,
39- children: [
40- Container (
41- width: 256.0 ,
42- padding: EdgeInsets .only (
43- left: 32.0 , top: 32.0 , right: 32.0 , bottom: 96.0 ),
44- decoration: BoxDecoration (
45- image: DecorationImage (
46- image: AssetImage (mainImageAsset),
36+ body: _buildAdaptiveBody (title, mainImageAsset, logoImageAsset, content,
37+ isScrollable, isPaddingEnabled, subtitle, accentFilterColor),
38+ );
39+ }
40+
41+ // // print("AHTUNG = ${constraints.maxWidth}"); 365 width triggering vertical layout
42+
43+ Widget _buildAdaptiveBody (
44+ String title,
45+ String mainImageAsset,
46+ String logoImageAsset,
47+ Widget content,
48+ bool isScrollable,
49+ bool isPaddingEnabled,
50+ String ? subtitle,
51+ Color ? accentFilterColorx) {
52+ return LayoutBuilder (
53+ builder: (BuildContext context, BoxConstraints constraints) {
54+ print ("AHTUNG = ${constraints .maxWidth }" );
55+ bool isNeedToSwitchVertical = constraints.maxWidth <= 940 ;
56+
57+ if (isNeedToSwitchVertical) {
58+ return Stack (
59+ children: [
60+ Image .asset (
61+ mainImageAsset,
62+ height: double .infinity,
63+ width: double .infinity,
64+ alignment: Alignment .center,
4765 fit: BoxFit .cover,
48- )),
49- child: Align (
50- alignment: Alignment .center,
51- child: accentFilterColor != null ? ColorFiltered (
52- colorFilter: ColorFilter .mode (accentFilterColor! , BlendMode .srcATop),
53- child: Image .asset (logoImageAsset),
54- ) : Image .asset (logoImageAsset)
55- ),
56- // Stack(
57- // children: [
58- // Align(
59- // alignment: Alignment.center,
60- // child: accentFilterColor != null ? ColorFiltered(
61- // colorFilter: ColorFilter.mode(accentFilterColor!, BlendMode.srcATop),
62- // child: Image.asset(logoImageAsset),
63- // ) : Image.asset(logoImageAsset)
64- // ),
65- // Align(
66- // alignment: Alignment.bottomCenter,
67- // child: TextTitleBig(
68- // text: title,
69- // textColor: accentFilterColor ?? AppColors.ContentWhite,
70- // ),
71- // )
72- // ],
73- // ),
74- ),
75- Expanded (
76- child: Container (
77- alignment: Alignment .topLeft,
78- child: _buildMainContent (content)),
79- ),
80- Transform .flip (
81- flipX: true ,
82- child: Container (
66+ color: Colors .black54,
67+ colorBlendMode: BlendMode .darken,
68+ ),
69+ _buildMainContent (content)
70+ ],
71+ // decoration: BoxDecoration(
72+ // image: DecorationImage(
73+ // image: AssetImage(mainImageAsset),
74+ // fit: BoxFit.cover,
75+ // )),
76+ // child: TextTitle(text: "VERTICAL"),
77+ );
78+ } else {
79+ return Row (
80+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
81+ crossAxisAlignment: CrossAxisAlignment .center,
82+ children: [
83+ Container (
8384 width: 256.0 ,
8485 padding: EdgeInsets .only (
8586 left: 32.0 , top: 32.0 , right: 32.0 , bottom: 96.0 ),
@@ -90,33 +91,80 @@ class BaseInfoPage extends StatelessWidget {
9091 )),
9192 child: Align (
9293 alignment: Alignment .center,
93- child: accentFilterColor != null ? ColorFiltered (
94- colorFilter: ColorFilter .mode (accentFilterColor! , BlendMode .srcATop),
95- child: Image .asset (logoImageAsset),
96- ) : Image .asset (logoImageAsset)
97- )
98- // Stack( children: [
99- // Align(
100- // alignment: Alignment.center,
101- // child: accentFilterColor != null ? ColorFiltered(
102- // colorFilter: ColorFilter.mode(accentFilterColor!, BlendMode.srcATop),
103- // child: Image.asset(logoImageAsset),
104- // ) : Image.asset(logoImageAsset)
105- // ),
106- // Align(
107- // alignment: Alignment.bottomCenter,
108- // child: TextTitleBig(
109- // text: title,
110- // textColor: accentFilterColor ?? AppColors.ContentWhite,
111- // ),
112- // )
113- // ],
114- // ),
94+ child: accentFilterColor != null
95+ ? ColorFiltered (
96+ colorFilter: ColorFilter .mode (
97+ accentFilterColor! , BlendMode .srcATop),
98+ child: Image .asset (logoImageAsset),
99+ )
100+ : Image .asset (logoImageAsset)),
101+ // Stack(
102+ // children: [
103+ // Align(
104+ // alignment: Alignment.center,
105+ // child: accentFilterColor != null ? ColorFiltered(
106+ // colorFilter: ColorFilter.mode(accentFilterColor!, BlendMode.srcATop),
107+ // child: Image.asset(logoImageAsset),
108+ // ) : Image.asset(logoImageAsset)
109+ // ),
110+ // Align(
111+ // alignment: Alignment.bottomCenter,
112+ // child: TextTitleBig(
113+ // text: title,
114+ // textColor: accentFilterColor ?? AppColors.ContentWhite,
115+ // ),
116+ // )
117+ // ],
118+ // ),
115119 ),
116- ),
117- ],
118- ),
119- );
120+ Expanded (
121+ child: Container (
122+ alignment: Alignment .topLeft,
123+ child: _buildMainContent (content)),
124+ ),
125+ Transform .flip (
126+ flipX: true ,
127+ child: Container (
128+ width: 256.0 ,
129+ padding: EdgeInsets .only (
130+ left: 32.0 , top: 32.0 , right: 32.0 , bottom: 96.0 ),
131+ decoration: BoxDecoration (
132+ image: DecorationImage (
133+ image: AssetImage (mainImageAsset),
134+ fit: BoxFit .cover,
135+ )),
136+ child: Align (
137+ alignment: Alignment .center,
138+ child: accentFilterColor != null
139+ ? ColorFiltered (
140+ colorFilter: ColorFilter .mode (
141+ accentFilterColor! , BlendMode .srcATop),
142+ child: Image .asset (logoImageAsset),
143+ )
144+ : Image .asset (logoImageAsset))
145+ // Stack( children: [
146+ // Align(
147+ // alignment: Alignment.center,
148+ // child: accentFilterColor != null ? ColorFiltered(
149+ // colorFilter: ColorFilter.mode(accentFilterColor!, BlendMode.srcATop),
150+ // child: Image.asset(logoImageAsset),
151+ // ) : Image.asset(logoImageAsset)
152+ // ),
153+ // Align(
154+ // alignment: Alignment.bottomCenter,
155+ // child: TextTitleBig(
156+ // text: title,
157+ // textColor: accentFilterColor ?? AppColors.ContentWhite,
158+ // ),
159+ // )
160+ // ],
161+ // ),
162+ ),
163+ ),
164+ ],
165+ );
166+ }
167+ });
120168 }
121169
122170 Widget _buildMainContent (Widget content) {
0 commit comments