Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.90 KB | None | 0 0
  1. import 'package:ecommerce1/product.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:google_fonts/google_fonts.dart';
  4.  
  5. class DetailProduct extends StatelessWidget {
  6.   final Product product;
  7.   DetailProduct({this.product});
  8.  
  9.   @override
  10.   Widget build(BuildContext context) {
  11.     return Scaffold(
  12.       appBar: AppBar(
  13.         title: Text("Pickup",
  14.             style: GoogleFonts.roboto(
  15.                 // textStyle: TextStyle(c)
  16.                 )),
  17.         centerTitle: true,
  18.       ),
  19.       body: SafeArea(
  20.         child: SingleChildScrollView(
  21.           padding: EdgeInsets.all(19),
  22.           child: Column(
  23.             crossAxisAlignment: CrossAxisAlignment.start,
  24.             children: <Widget>[
  25.               SizedBox(height: 10),
  26.               Center(
  27.                 child: Container(
  28.                   child: Column(
  29.                     children: <Widget>[
  30.                       Hero(
  31.                         tag: product.name,
  32.                         child: Image.network(
  33.                           product.urlimage,
  34.                           fit: BoxFit.fill,
  35.                         ),
  36.                       ),
  37.                       Text(product.name,
  38.                           style: GoogleFonts.roboto(
  39.                               textStyle: TextStyle(
  40.                             fontSize: 25,
  41.                             fontWeight: FontWeight.bold,
  42.                             color: Colors.purple[100],
  43.                           ))),
  44.                       SizedBox(height: 12),
  45.                       Text("Rp. ${product.price}",
  46.                           style: GoogleFonts.roboto(
  47.                               textStyle: TextStyle(
  48.                             fontSize: 20,
  49.                             fontWeight: FontWeight.bold,
  50.                             color: Colors.purple[100],
  51.                           ))),
  52.                       SizedBox(height: 12),
  53.                       Text(product.description,
  54.                           style: GoogleFonts.roboto(
  55.                               textStyle: TextStyle(
  56.                             fontSize: 17,
  57.                             fontWeight: FontWeight.w500,
  58.                             color: Colors.white70,
  59.                           ))),
  60.                       SizedBox(height: 17),
  61.                       SizedBox(
  62.                         height: 50,
  63.                         width: 200,
  64.                         child: RaisedButton(
  65.                           shape: RoundedRectangleBorder(
  66.                               borderRadius: BorderRadius.circular(16)),
  67.                           color: Colors.orange,
  68.                           onPressed: () {},
  69.                           child: Text("Add to Cart"),
  70.                         ),
  71.                       )
  72.                     ],
  73.                   ),
  74.                 ),
  75.               )
  76.             ],
  77.           ),
  78.         ),
  79.       ),
  80.     );
  81.   }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement