Skip to content

Commit

Permalink
Merge pull request #283 from vostpt/task/282-New_home_buttons
Browse files Browse the repository at this point in the history
Adds new home buttons
  • Loading branch information
Vanethos authored Feb 17, 2021
2 parents 8d2d1c5 + f092f05 commit e716238
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 95 deletions.
3 changes: 3 additions & 0 deletions assets/icon_coronavirus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icon_meteo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions lib/resources/icons_svg.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,22 @@ mixin SvgIcons {
width: width,
height: height,
);

static Widget meteoSvg(
{Color color = Covid19Colors.white, double size = 62.0}) =>
SvgPicture.asset(
'assets/icon_meteo.svg',
color: color,
width: size,
height: size,
);

static Widget coronavirusSvg(
{Color color = Covid19Colors.white, double size = 62.0}) =>
SvgPicture.asset(
'assets/icon_coronavirus.svg',
color: color,
width: size,
height: size,
);
}
4 changes: 2 additions & 2 deletions lib/resources/style/text_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ class TextStyles {
);

static TextStyle h3({
Color color = Covid19Colors.darkGrey,
Color color = Covid19Colors.darkGrey, FontWeight fontWeight = FontWeight.w900
}) =>
GoogleFonts.lato(
textStyle: TextStyle(
color: color,
fontSize: 16.0,
fontWeight: FontWeight.w900,
fontWeight: fontWeight,
),
);

Expand Down
12 changes: 12 additions & 0 deletions lib/ui/assets/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,16 @@ class Covid19Colors {

/// For use in overalaus
static const Color black50 = Color(0x80000000);

/// For use in the Covid button gradient - LEFT
static const Color blueCovid = Color(0xfFF205DF8);

/// For use in the Covid button gradient - RIGHT
static const Color blueCovidLight = Color(0xFF079DBE);

/// For use in the Meteo button gradient - LEFT
static const Color blueMeteo = Color(0xfFF5B41FA);

/// For use in the Meteo button gradient - RIGHT
static const Color blueMeteoLight = Color(0xFF037FF1);
}
93 changes: 93 additions & 0 deletions lib/ui/screens/home/components/home_info_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import 'package:covid19mobile/resources/style/text_styles.dart';
import 'package:covid19mobile/ui/assets/colors.dart';

/// This program is free software: you can redistribute it and/or modify
/// it under the terms of the GNU General Public License as published by
/// the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';

class HomeInfoButton extends StatelessWidget {
@required
final VoidCallback callback;

@required
final Color leftBackgroundColor;

@required
final Color rightBackgroundColor;

@required
final String title;

@required
final String subtitle;

@required
final Widget icon;

const HomeInfoButton({
Key key,
this.callback,
this.leftBackgroundColor,
this.rightBackgroundColor,
this.title,
this.subtitle,
this.icon,
}) : super(key: key);

@override
Widget build(BuildContext context) {
return InkWell(
onTap: callback,
child: Container(
padding: EdgeInsets.all(16.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
gradient: LinearGradient(
colors: [leftBackgroundColor, rightBackgroundColor],
),
),
child: Row(
children: [
SizedBox(
width: 8.0,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title.toUpperCase(),
style: TextStyles.h3(
color: Covid19Colors.white,
fontWeight: FontWeight.w400
)
),
SizedBox(height: 4.0),
Text(
subtitle,
style: TextStyles.h1(
color: Covid19Colors.white,
),
),
],
),
),
icon,
],
),
),
);
}
}
88 changes: 0 additions & 88 deletions lib/ui/screens/home/components/statistics_button.dart

This file was deleted.

Loading

0 comments on commit e716238

Please sign in to comment.