IOxxy

Untitled

Jun 12th, 2020
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 6.27 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() {
  4.   runApp(MyApp());
  5. }
  6.  
  7. class MyApp extends StatelessWidget {
  8.   // This widget is the root of your application.
  9.   @override
  10.   Widget build(BuildContext context) {
  11.     return MaterialApp(
  12.       debugShowCheckedModeBanner: false,
  13.       title: 'ISP Yolo',
  14.       theme: ThemeData(
  15.         primarySwatch: Colors.green,
  16.         visualDensity: VisualDensity.adaptivePlatformDensity,
  17.       ),
  18.       home: MyHomePage(title: 'ISP Yolo'),
  19.     );
  20.   }
  21. }
  22.  
  23. class MyHomePage extends StatefulWidget {
  24.   MyHomePage({Key key, this.title}) : super(key: key);
  25.  
  26.   final String title;
  27.  
  28.   @override
  29.   _MyHomePageState createState() => _MyHomePageState();
  30. }
  31.  
  32. class _MyHomePageState extends State<MyHomePage> {
  33.  
  34.   @override
  35.   Widget build(BuildContext context) {
  36.     return Scaffold(
  37.       body: SafeArea(
  38.         child: Stack(
  39.           children: <Widget>[
  40.             SingleChildScrollView(
  41.               physics: BouncingScrollPhysics(),
  42.               scrollDirection: Axis.vertical,
  43.               child: Column(
  44.                 mainAxisAlignment: MainAxisAlignment.center,
  45.                 children: <Widget>[
  46.                   Padding(
  47.                     padding: EdgeInsets.all(20),
  48.                     child: Row(
  49.                       mainAxisAlignment: MainAxisAlignment.end,
  50.                       mainAxisSize: MainAxisSize.max,
  51.                       children: <Widget>[
  52.                         IconButton(icon: Icon(Icons.clear, size: 35,), onPressed: (){})
  53.                       ],
  54.                     ),
  55.                   ),
  56.                   Stack(
  57.                     children: <Widget>[
  58.                       Container(
  59.                         width: double.infinity,
  60.                         margin: EdgeInsets.only(left: 20, right: 20, top: 50, bottom: 20),
  61.                         padding: EdgeInsets.symmetric(horizontal: 20, vertical: 50),
  62.                         decoration: BoxDecoration(
  63.                           color: Colors.grey[200],
  64.                           borderRadius: BorderRadius.circular(10)
  65.                         ),
  66.                         child: Column(
  67.                           children: <Widget>[
  68.                             Text("Proteggi la tua passione per gli sport sulla neve!", textAlign: TextAlign.center, style: TextStyle(fontSize: 24, color: Colors.blue),),
  69.                             SizedBox(height: 20,),
  70.                             Text(
  71.                               "La stagione invernale entra nel vivo. Divertiti senza pensieri sulla neve insieme alla tua famiglia e ai tuoi amici. Scopri come proteggerti con Yolo da sito e app in pochi clic.",
  72.                               textAlign: TextAlign.center,
  73.                               style: TextStyle(fontSize: 16, fontWeight: FontWeight.w300),
  74.                             )
  75.                           ],
  76.                         ),
  77.                       ),
  78.                       Align(
  79.                         alignment: Alignment.topCenter,
  80.                         child: Image(image: AssetImage("images/umbrella.png"), height: 100, width: 100,)
  81.                       ),
  82.                     ],
  83.                   ),
  84.                   Text("Attività per cui sono protetto", textAlign: TextAlign.center, style: TextStyle(fontSize: 20),),
  85.                   Padding(
  86.                     padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 20),
  87.                     child: Column(
  88.                       children: <Widget>[
  89.                         Row(
  90.                           children: <Widget>[
  91.                             Card(title: "Sci", image: "ic_sci.png"),
  92.                             SizedBox(width: 10,),
  93.                             Card(title: "Snowboard", image: "ic_snowboard.png")
  94.                           ],
  95.                         ),
  96.                         SizedBox(height: 10,),
  97.                         Row(
  98.                           children: <Widget>[
  99.                             Card(title: "Pattinaggio", image: "ic_pattini.png"),
  100.                             SizedBox(width: 10,),
  101.                             Card(title: "Ciaspole", image: "ic_ciaspole.png")
  102.                           ],
  103.                         ),
  104.                       ],
  105.                     ),
  106.                   ),
  107.                   Padding(
  108.                     padding: const EdgeInsets.all(30),
  109.                     child: Text(
  110.                       "YOLO è un broker assicurativo partner di Intesa Sanpaolo specializzato nella proposizione di soluzioni assicurative in modalità digitale.",
  111.                       textAlign: TextAlign.center,
  112.                       style: TextStyle(fontSize: 12),
  113.                     ),
  114.                   )
  115.                 ],
  116.               ),
  117.             ),
  118.  
  119.             Align(
  120.               alignment: Alignment.bottomCenter,
  121.               child: MaterialButton(
  122.                 onPressed: (){},
  123.                 shape: StadiumBorder(),
  124.                 color: Colors.green[700],
  125.                 child: Text("SCOPRI YOLO", style: TextStyle(color: Colors.white, fontWeight: FontWeight.w700),),
  126.                 padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
  127.               ),
  128.             )
  129.           ],
  130.         ),
  131.       ), // This trailing comma makes auto-formatting nicer for build methods.
  132.     );
  133.   }
  134. }
  135.  
  136. class Card extends StatelessWidget {
  137.  
  138.   String title;
  139.   String image;
  140.  
  141.   Card({this.title, this.image});
  142.  
  143.   @override
  144.   Widget build(BuildContext context) {
  145.     return Flexible(
  146.       fit: FlexFit.loose,
  147.       child: Container(
  148.         height: 80,
  149.         padding: EdgeInsets.all(0),
  150.         decoration: BoxDecoration(
  151.             color: Colors.grey[200],
  152.             borderRadius: BorderRadius.circular(10)
  153.         ),
  154.         alignment: Alignment.center,
  155.         child: Row(
  156.           mainAxisAlignment: MainAxisAlignment.spaceBetween,
  157.           crossAxisAlignment: CrossAxisAlignment.center,
  158.           children: <Widget>[
  159.             Padding(
  160.               padding: EdgeInsets.only(left: 20),
  161.               child: Text(title, style: TextStyle(color: Colors.blue),),
  162.             ),
  163.             Image(image: AssetImage("images/" + image), height: 80, width: 60, fit: BoxFit.cover, alignment: Alignment.topLeft,)
  164.           ],
  165.         ),
  166.       ),
  167.     );
  168.   }
  169. }
Add Comment
Please, Sign In to add comment