
import 'package:farmer_client/pages/machinery/widgets/DefLayout.dart';
import 'package:farmer_client/pages/machinery/widgets/RoundButton.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:farmer_client/widgets/amap/amap.dart';

import '../../widgets/summary.dart';

Widget page({ required BuildContext context, VoidCallback? handleClick}) {
  final _offset = 20.w;
  final width = MediaQuery.of(context).size.width;
  final mapHeight = 226.5.w;
  final cardHeight = 250.w;


  final img = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg';
  final LatLng position = LatLng(32.690712, 112.091892);

  return DefLayout(
      head: AMap(position: position),
      children: [
        DefLayout.card(
            top: DefLayout.headHeight - DefLayout.offset,
            height: DefLayout.headHeight,
            child: Image.network(img, fit: BoxFit.cover)
        ),
        DefLayout.card(
            top: (DefLayout.headHeight - DefLayout.offset) * 2,
            padding: EdgeInsets.only(top: 45.w, left: 15.w, right: 15.w, bottom: 20.w),
            child: _content(context, handleClick)
        ),
      ]
  );
}

Widget _content(BuildContext context, VoidCallback? handleClick) {
  return Column(
    children: [
      summary(),
      RoundButton(text: "预约", onPressed: handleClick,),
    ],
  );
}