1
1
import 'dart:convert' ;
2
-
3
2
import 'package:firebase_remote_config/firebase_remote_config.dart' ;
4
3
import 'package:flutter/material.dart' ;
5
4
import 'package:flutter_ui_challenges/core/data/models/survey.dart' ;
5
+ import 'package:flutter_ui_challenges/core/presentation/res/assets.dart' ;
6
6
import 'package:flutter_ui_challenges/core/presentation/res/functions.dart' ;
7
+ import 'package:flutter_ui_challenges/core/presentation/res/text_styles.dart' ;
8
+ import 'package:flutter_ui_challenges/core/presentation/widgets/rounded_bordered_container.dart' ;
7
9
import 'package:flutter_ui_challenges/core/presentation/widgets/survey_widget.dart' ;
8
10
import 'package:flutter_ui_challenges/features/announcements/data/model/announcement.dart' ;
9
11
import 'package:flutter_ui_challenges/features/announcements/widgets/announcement_slider.dart' ;
@@ -72,11 +74,53 @@ class _NewHomePageState extends State<NewHomePage>
72
74
appBar: customAppBar (context: context),
73
75
body: ListView (
74
76
children: < Widget > [
75
- Padding (
76
- padding: const EdgeInsets .fromLTRB (16.0 ,0 ,16.0 ,16.0 ),
77
- child: FeaturedCategoryItem (
78
- title: "UI Challenges" ,
79
- onPressed: () => Navigator .pushNamed (context, 'challenge_home' ),
77
+ RoundedContainer (
78
+ borderRadius: BorderRadius .circular (10.0 ),
79
+ margin: const EdgeInsets .symmetric (
80
+ vertical: 8.0 ,
81
+ horizontal: 16.0 ,
82
+ ),
83
+ padding: const EdgeInsets .all (0 ),
84
+ height: 250 ,
85
+ child: InkWell (
86
+ borderRadius: BorderRadius .circular (10.0 ),
87
+ onTap: () => Navigator .pushNamed (context, 'challenge_home' ),
88
+ child: Column (
89
+ children: < Widget > [
90
+ Expanded (
91
+ child: ClipRRect (
92
+ borderRadius: BorderRadius .only (
93
+ topLeft: Radius .circular (10.0 ),
94
+ topRight: Radius .circular (10.0 ),
95
+ ),
96
+ child: Image .asset (
97
+ appFeatureImage,
98
+ fit: BoxFit .cover,
99
+ ),
100
+ ),
101
+ ),
102
+ const SizedBox (height: 10.0 ),
103
+ Row (
104
+ mainAxisSize: MainAxisSize .min,
105
+ children: < Widget > [
106
+ Text (
107
+ "UI Challenges" ,
108
+ style: buttonText.copyWith (
109
+ color: Theme .of (context).primaryColor,
110
+ fontWeight: FontWeight .bold,
111
+ fontSize: 20.0 ,
112
+ ),
113
+ ),
114
+ const SizedBox (width: 10.0 ),
115
+ Icon (
116
+ Icons .arrow_forward,
117
+ color: Theme .of (context).primaryColor,
118
+ ),
119
+ ],
120
+ ),
121
+ const SizedBox (height: 10.0 ),
122
+ ],
123
+ ),
80
124
),
81
125
),
82
126
if (announcements.length > 0 ) ...[
@@ -164,6 +208,7 @@ class CategoryItem extends StatelessWidget {
164
208
);
165
209
}
166
210
}
211
+
167
212
class FeaturedCategoryItem extends StatelessWidget {
168
213
final TextStyle buttonText = boldText.copyWith (
169
214
fontSize: 16.0 ,
@@ -186,7 +231,7 @@ class FeaturedCategoryItem extends StatelessWidget {
186
231
highlightColor: Theme .of (context).primaryColor,
187
232
highlightElevation: 0 ,
188
233
elevation: 0 ,
189
- padding: const EdgeInsets .symmetric (horizontal: 24.0 ,vertical: 32.0 ),
234
+ padding: const EdgeInsets .symmetric (horizontal: 24.0 , vertical: 32.0 ),
190
235
child: Row (
191
236
children: < Widget > [
192
237
if (icon != null ) ...[
@@ -196,9 +241,7 @@ class FeaturedCategoryItem extends StatelessWidget {
196
241
Text (
197
242
title,
198
243
style: buttonText.copyWith (
199
- fontSize: 24.0 ,
200
- fontWeight: FontWeight .w300
201
- ),
244
+ fontSize: 24.0 , fontWeight: FontWeight .w300),
202
245
),
203
246
Spacer (),
204
247
Icon (Icons .keyboard_arrow_right),
0 commit comments