import 'package:flutter/widgets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../../widgets/summary.dart'; Widget page({ required BuildContext context, required Size appbarSize, required void Function() handleClick}) { final _offset = 20.w; final width = MediaQuery.of(context).size.width; final height = MediaQuery.of(context).size.height - appbarSize.height - MediaQuery.of(context).padding.top; final _bannerHeight = 250.w; final img = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'; return Stack( alignment: Alignment.topCenter, children: [ // 第一个组件用来撑满全屏 SizedBox( width: width, height: height, ), Positioned( left: 0, top: 0, child: SizedBox( height: _bannerHeight, child: _banner(img), ), ), Positioned( left: 0, top: _bannerHeight - _offset, child: _content(context), ), ], ); } Widget _banner(String imgUrl) { return Image.network(imgUrl); } Widget _content(BuildContext context) { final _border = 20.w; return Container( width: MediaQuery.of(context).size.width, padding: EdgeInsets.only(top: 45.w, left: 15.w, right: 15.w, bottom: 20.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.vertical(top: Radius.circular(_border)) ), child: Column( children: [ summary(), ], ), ); }