Skip to content

Commit d15030c

Browse files
fix: make GsocProjectWidget and bottom sheet dark-mode friendly and blend white background logos
1 parent 716cf95 commit d15030c

1 file changed

Lines changed: 37 additions & 12 deletions

File tree

lib/widgets/gsoc/GsocProjectWidget.dart

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class GsocProjectWidget extends StatelessWidget {
102102
child: ElevatedButton(
103103
onPressed: () {
104104
showModalBottomSheet(
105-
backgroundColor: Colors.white,
105+
backgroundColor: isDarkMode ? Colors.grey.shade900 : Colors.white,
106106
showDragHandle: true,
107107
context: context,
108108
isScrollControlled: true,
@@ -117,14 +117,30 @@ class GsocProjectWidget extends StatelessWidget {
117117
CrossAxisAlignment.start,
118118
children: [
119119
Container(
120-
padding: EdgeInsets.all(20),
121-
color: Colors.grey[100],
120+
padding: const EdgeInsets.all(20),
121+
decoration: BoxDecoration(
122+
color: isDarkMode
123+
? Colors.grey.shade800
124+
: Colors.grey[100],
125+
borderRadius: BorderRadius.circular(12),
126+
),
122127
child: Center(
123-
child: Image.network(
124-
modal.imageUrl,
125-
width: 80,
126-
height: 80,
127-
),
128+
child: isDarkMode
129+
? ColorFiltered(
130+
colorFilter: ColorFilter.mode(
131+
Colors.grey.shade800,
132+
BlendMode.multiply),
133+
child: Image.network(
134+
modal.imageUrl,
135+
width: 80,
136+
height: 80,
137+
),
138+
)
139+
: Image.network(
140+
modal.imageUrl,
141+
width: 80,
142+
height: 80,
143+
),
128144
),
129145
),
130146
SizedBox(
@@ -141,6 +157,7 @@ class GsocProjectWidget extends StatelessWidget {
141157
itemCount: modal.projects.length,
142158
itemBuilder: (context, projectIndex) {
143159
return _buildProjectCard(
160+
context,
144161
modal.projects[projectIndex]);
145162
},
146163
)
@@ -163,9 +180,14 @@ class GsocProjectWidget extends StatelessWidget {
163180
);
164181
}
165182

166-
Widget _buildProjectCard(Project project) {
183+
Widget _buildProjectCard(BuildContext context, Project project) {
184+
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
185+
final cardColor = isDarkMode ? Colors.grey.shade800 : Colors.grey[100];
186+
final textColor = isDarkMode ? Colors.white70 : Colors.grey[700];
187+
final titleColor = isDarkMode ? Colors.white : Colors.black;
188+
167189
return Card(
168-
color: Colors.grey[100],
190+
color: cardColor,
169191
elevation: 0,
170192
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
171193
child: Padding(
@@ -175,13 +197,16 @@ class GsocProjectWidget extends StatelessWidget {
175197
children: [
176198
Text(
177199
project.title,
178-
style: TextStyle(fontWeight: FontWeight.w600),
200+
style: TextStyle(
201+
fontWeight: FontWeight.w600,
202+
color: titleColor,
203+
),
179204
),
180205
SizedBox(
181206
height: 10,
182207
),
183208
Text(project.shortDescription,
184-
style: TextStyle(color: Colors.grey[700])),
209+
style: TextStyle(color: textColor)),
185210
SizedBox(
186211
height: 10,
187212
),

0 commit comments

Comments
 (0)