Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:ui';
- import 'package:flutter/material.dart';
- import 'package:flutter_svg/flutter_svg.dart';
- import 'package:RunAppTest/cards_data.dart';
- import 'package:RunAppTest/prevent.dart';
- import 'package:hexcolor/hexcolor.dart';
- import 'package:sizer/sizer.dart';
- class WorldData extends StatelessWidget {
- final Map covidDataFrance;
- const WorldData({
- Key key,
- this.covidDataFrance,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- body: Column(
- children: [
- Container(
- padding: EdgeInsets.only(left: 20, top: 20, right: 20, bottom: 40),
- width: double.infinity,
- /* decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.blueAccent,
- //blurRadius: 3, //3
- //offset: Offset(2, 1), //2.4
- ),
- ],
- //color: kPrimaryColor.withOpacity(0.80),
- color: Colors.blueAccent.withOpacity(0.5),
- borderRadius: BorderRadius.only(
- bottomLeft: Radius.circular(50),
- bottomRight: Radius.circular(50),
- ),
- ),*/
- child: Wrap(
- runSpacing: 20, //espace entre les cards
- spacing: 20,
- children: [
- Design(
- svgpicIcons: SvgPicture.asset(
- "assets/icons/case_1.svg",
- color: Colors.blue,
- height: 20,
- width: 20,
- ),
- coloricon: Colors.blue,
- title: 'TotalConfirmed',
- count: covidDataFrance['cases'].toString(),
- ),
- Design(
- svgpicIcons: SvgPicture.asset(
- "assets/icons/death.svg",
- color: Colors.red,
- height: 20,
- width: 20,
- ),
- coloricon: Colors.redAccent,
- title: 'TotalDeaths',
- count: covidDataFrance['deaths'].toString(),
- ),
- Design(
- svgpicIcons: SvgPicture.asset(
- "assets/icons/heart.svg",
- // color: Colors.green,
- height: 20,
- width: 20,
- ),
- coloricon: Colors.greenAccent,
- title: 'TotalRecovered',
- count: covidDataFrance['recovered'].toString(),
- ),
- // DateOneCard(),
- ],
- ),
- ),
- //Appelle de l'affiche des préventions
- //Prevent(),
- ],
- ),
- //),
- );
- }
- }
- class Design extends StatelessWidget {
- final String count;
- final String title;
- final Color coloricon;
- final SvgPicture svgpicIcons;
- const Design({
- Key key,
- this.count,
- this.title,
- this.coloricon,
- this.svgpicIcons,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- return LayoutBuilder(builder: (context, constraints) {
- return Container(
- width: constraints.maxWidth / 2 - 10, //permet d'afficher sur 2
- //Il permet de donne la taill dispo pour le wdget
- decoration: BoxDecoration(
- color: Colors
- .white, //Couleur du container qui contient text cas confirmé
- borderRadius: BorderRadius.circular(8),
- boxShadow: [
- BoxShadow(
- color: Colors.cyanAccent,
- //blurRadius: 1.5,
- //offset: Offset(3, 4),
- ),
- ],
- ),
- child: Column(
- children: <Widget>[
- Padding(
- padding: const EdgeInsets.all(10.0),
- child: Row(
- children: <Widget>[
- Container(
- //image svg dans un container
- alignment: Alignment.center,
- height: 3.5.h,
- width: 30,
- decoration: BoxDecoration(
- color: Color(0xFFFF9C00).withOpacity(0.12),
- shape: BoxShape.circle,
- ),
- child: svgpicIcons,
- //color: Color.fromRGBO(252, 140, 4, 1),
- //color: Colors.blueAccent,
- //color: coloricon,
- //height: 12,
- //width: 12,
- //),
- ),
- SizedBox(
- width:
- 5, //espace entre l'icon svg et le text 'cas confirmé'
- ),
- Text(
- title
- .toString(), //Titre soit cas confirmé ou Mort ou recovered
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyle(
- fontWeight: FontWeight.bold,
- color: HexColor('a9abaf'),
- //color: Colors.blueAccent,
- ),
- ),
- ],
- ),
- ),
- Padding(
- padding: const EdgeInsets.all(2.0), //a changer
- child: Row(
- //2eme ligne
- children: [
- Padding(
- padding: const EdgeInsets.all(10.0),
- child: RichText(
- text: TextSpan(
- style: TextStyle(color: Colors.black),
- children: [
- TextSpan(
- text: count.toString(),
- style:
- Theme.of(context).textTheme.bodyText1.copyWith(
- fontWeight: FontWeight.bold,
- color: HexColor('3a3e49'),
- fontSize: 20, //taille des resultat
- ),
- ),
- TextSpan(
- text: "\nPersonnes",
- style: TextStyle(
- fontSize: 12,
- fontWeight: FontWeight.bold,
- color: Colors.black.withOpacity(0.5),
- letterSpacing: 2.0,
- height:
- 2, //distance separant du 1 ere text et du 2em
- ),
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- ],
- ),
- );
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement