Advertisement
AnoTest

Flut_Backup_2_Class_FranceData

Feb 8th, 2021
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.54 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_svg/svg.dart';
  3. import 'package:hexcolor/hexcolor.dart';
  4. import 'package:sizer/sizer.dart';
  5.  
  6. class FranceDataDesign extends StatelessWidget {
  7.   final Map covidDataFranceAll;
  8.   final String nameField;
  9.   const FranceDataDesign({Key key, this.covidDataFranceAll, this.nameField})
  10.       : super(key: key);
  11.  
  12.   @override
  13.   Widget build(BuildContext context) {
  14.     double width = MediaQuery.of(context).size.width;
  15.  
  16.     return Container(
  17.       decoration: BoxDecoration(
  18.         borderRadius: BorderRadius.all(
  19.           Radius.circular(10),
  20.         ),
  21.         color: Colors.white,
  22.       ),
  23.       margin: EdgeInsets.all(5),
  24. //      height: 100,
  25.       width: width / 2,
  26.       child: Padding(
  27.         padding: const EdgeInsets.all(8.0),
  28.         child: Expanded(
  29.           child: Column(
  30.             mainAxisAlignment: MainAxisAlignment.center,
  31.             children: <Widget>[
  32.               Row(
  33.                 children: [
  34.                   SvgPicture.asset(
  35.                     'assets/icons/confirmed.svg',
  36.                     height: 2.0.h,
  37.                   ),
  38.                   SizedBox(
  39.                     width: 2.0.h,
  40.                   ),
  41.                   Text(
  42.                     nameField,
  43.                     style: TextStyle(
  44.                       fontWeight: FontWeight.bold,
  45.                       fontSize: 16,
  46.                       color: HexColor('a9abaf'),
  47.                     ),
  48.                   ),
  49.                 ],
  50.               ),
  51.               SizedBox(
  52.                 height: 2.0.h,
  53.               ),
  54.               Text(
  55.                 covidDataFranceAll['cases'].toString(),
  56.                 style: TextStyle(
  57.                   fontSize: 14,
  58.                   fontWeight: FontWeight.bold,
  59.                 ),
  60.               ),
  61.               RichText(
  62.                 text: TextSpan(
  63.                   style: TextStyle(color: Colors.black),
  64.                   children: [
  65.                     TextSpan(
  66.                       text: "\nPersonnes",
  67.                       style: TextStyle(
  68.                         fontSize: 13,
  69.                         fontWeight: FontWeight.bold,
  70.                         color: Colors.black.withOpacity(0.5),
  71.                         letterSpacing: 2.0,
  72.                         height: 1, //distance separant du 1 ere text et du 2em
  73.                       ),
  74.                     ),
  75.                   ],
  76.                 ),
  77.               ),
  78.             ],
  79.           ),
  80.         ), //exepanded
  81.       ),
  82.     );
  83.   }
  84. }
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement