import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:bookatanker/common/settings.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:intl/intl.dart';

class CartSummary extends StatefulWidget {
  var details;
  var supplierDetails;
  CartSummary({this.details,this.supplierDetails});

  @override
  State<CartSummary> createState() => _CartSummaryState();
}

class _CartSummaryState extends State<CartSummary> {




  @override
  void initState() {
    super.initState();

  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color(0XFFFFFFFF),
      appBar: AppSettings.appBarWithoutActions(widget.supplierDetails.supplier_name),
      body: Padding(
        padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
        child: Column(
          children: [Container(
              width: double.infinity, // makes it expand within the Card's width
              decoration: BoxDecoration(
                borderRadius: BorderRadius.vertical(
                  bottom: Radius.circular(8),
                  top:Radius.circular(8),
                ), // match Card border
                gradient: LinearGradient(
                  colors: [
                    Color(0xFFFFF8DF),
                    Color(0xFFFFFFFF),
                  ],
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                ),
              ),
              padding: EdgeInsets.symmetric(vertical: 12),
              alignment: Alignment.center,
              child: Padding(
                padding: EdgeInsets.fromLTRB(12, 0, 12, 0),
                child:Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(widget.supplierDetails.supplier_name,
                        style: fontTextStyle(
                            16,
                            Color(0XFF2D2E30),
                            FontWeight.w600)),
                    Text(widget.supplierDetails.distanceInMeters
                        .toString() +
                        ' Km',
                        style: fontTextStyle(
                            16,
                            Color(0XFF2D2E30),
                            FontWeight.w600)),
                  ],
                ),
              )),],
        )
      ),

    );
  }
}
