Skip to content

Commit 67b3c5f

Browse files
committed
design updates
1 parent 2643e9a commit 67b3c5f

File tree

4 files changed

+58
-12
lines changed

4 files changed

+58
-12
lines changed

assets/icon/feature_store.jpg

133 KB
Loading

lib/core/presentation/res/assets.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const String appLogo = 'assets/icon/icon.png';
2+
const String appFeatureImage = 'assets/icon/feature_store.jpg';
23
const String fishtail =
34
'https://firebasestorage.googleapis.com/v0/b/dl-flutter-ui-challenges.appspot.com/o/travel%2Ffishtail.jpg?alt=media';
45
const String mountEverest =
@@ -142,4 +143,4 @@ const List<String> introIllus = [
142143
'https://firebasestorage.googleapis.com/v0/b/dl-flutter-ui-challenges.appspot.com/o/intro%2F1.png?alt=media',
143144
'https://firebasestorage.googleapis.com/v0/b/dl-flutter-ui-challenges.appspot.com/o/intro%2F2.png?alt=media',
144145
'https://firebasestorage.googleapis.com/v0/b/dl-flutter-ui-challenges.appspot.com/o/intro%2F3.png?alt=media'
145-
];
146+
];

lib/core/presentation/widgets/rounded_bordered_container.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ class RoundedContainer extends StatelessWidget {
1010
this.color = Colors.white,
1111
this.padding = const EdgeInsets.all(16.0),
1212
this.margin,
13+
this.borderRadius,
1314
}) : super(key: key);
1415
final Widget child;
1516
final double width;
1617
final double height;
1718
final Color color;
1819
final EdgeInsets padding;
1920
final EdgeInsets margin;
21+
final BorderRadius borderRadius;
2022

2123
@override
2224
Widget build(BuildContext context) {
@@ -27,7 +29,7 @@ class RoundedContainer extends StatelessWidget {
2729
margin: margin,
2830
decoration: BoxDecoration(
2931
color: color,
30-
borderRadius: BorderRadius.circular(20.0),
32+
borderRadius: borderRadius ?? BorderRadius.circular(20.0),
3133
border: Border.all(
3234
color: borderColor,
3335
width: 0.5,

lib/features/home/presentation/pages/new_home.dart

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import 'dart:convert';
2-
32
import 'package:firebase_remote_config/firebase_remote_config.dart';
43
import 'package:flutter/material.dart';
54
import 'package:flutter_ui_challenges/core/data/models/survey.dart';
5+
import 'package:flutter_ui_challenges/core/presentation/res/assets.dart';
66
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';
79
import 'package:flutter_ui_challenges/core/presentation/widgets/survey_widget.dart';
810
import 'package:flutter_ui_challenges/features/announcements/data/model/announcement.dart';
911
import 'package:flutter_ui_challenges/features/announcements/widgets/announcement_slider.dart';
@@ -72,11 +74,53 @@ class _NewHomePageState extends State<NewHomePage>
7274
appBar: customAppBar(context: context),
7375
body: ListView(
7476
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+
),
80124
),
81125
),
82126
if (announcements.length > 0) ...[
@@ -164,6 +208,7 @@ class CategoryItem extends StatelessWidget {
164208
);
165209
}
166210
}
211+
167212
class FeaturedCategoryItem extends StatelessWidget {
168213
final TextStyle buttonText = boldText.copyWith(
169214
fontSize: 16.0,
@@ -186,7 +231,7 @@ class FeaturedCategoryItem extends StatelessWidget {
186231
highlightColor: Theme.of(context).primaryColor,
187232
highlightElevation: 0,
188233
elevation: 0,
189-
padding: const EdgeInsets.symmetric(horizontal: 24.0,vertical: 32.0),
234+
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 32.0),
190235
child: Row(
191236
children: <Widget>[
192237
if (icon != null) ...[
@@ -196,9 +241,7 @@ class FeaturedCategoryItem extends StatelessWidget {
196241
Text(
197242
title,
198243
style: buttonText.copyWith(
199-
fontSize: 24.0,
200-
fontWeight: FontWeight.w300
201-
),
244+
fontSize: 24.0, fontWeight: FontWeight.w300),
202245
),
203246
Spacer(),
204247
Icon(Icons.keyboard_arrow_right),

0 commit comments

Comments
 (0)