import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';

import 'base/YSBase.dart';

class YSBodyPropose extends StatefulWidget {
  @override
  _YSBodyProposeState createState() => _YSBodyProposeState();
}

class _YSBodyProposeState extends State<YSBodyPropose> {
  @override
  Widget build(BuildContext context) {
    return YSBase(
      ystitle: '增重建议',
      yschild: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              width: MediaQuery.of(context).size.width,
              margin: EdgeInsets.all(20),
              child: Text('我的合理增重范围(单位：kg)',style: TextStyle(fontSize: 12,color: Color(0xFF292929),fontWeight: FontWeight.bold),),
            ),
            Container(
              height: 100,
              padding: EdgeInsets.only(left: 20,right: 20),
              margin: EdgeInsets.only(bottom: 40),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  for(int i = 0;i<3;i++)Stack(
                    children: [
                      Container(
                        height: 100,
                        width: 100,
                        child: Image.asset('lib/images/xuxian.png'),
                      ),
                      Container(
                        height: 100,
                        width: 100,
                        padding: EdgeInsets.all(10),
                        child: Column(
                          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          children: [
                            Text('孕前 孕早期',style: TextStyle(fontSize: 12,color: Color(0xFF292929)),textAlign: TextAlign.center,),
                            Text('0.5~2.0kg',style: TextStyle(fontSize: 14,color: Color(0xFFDB5278)),textAlign: TextAlign.center,)
                          ],
                        ),
                      )
                    ],
                  ),
                ],
              ),
            ),
            Text('整个孕期建议增重',style: TextStyle(fontSize: 12,color: Color(0xFFDB5278)),),
            RichText(
              text: TextSpan(
                  style: TextStyle(fontSize: 30,color: Color(0xFFDB5278),fontWeight: FontWeight.bold),
                  children: [
                    TextSpan(text: '5.0~9.0'),
                    TextSpan(text: ' kg',style: TextStyle(fontSize: 16,fontWeight: FontWeight.normal)),
                  ]
              ),
            ),
            CupertinoButton(
              padding: EdgeInsets.all(0),
              child: Container(
                height: 40,
                width: MediaQuery.of(context).size.width-150,
                decoration: BoxDecoration(
                    color: Color(0xFFDB5278),
                    borderRadius: BorderRadius.all(Radius.circular(20))
                ),
                alignment: Alignment.center,
                child: Text('开始管理体重',style: TextStyle(fontSize: 16,color: Colors.white),),
                margin: EdgeInsets.only(top: 150),
              ),
              onPressed: (){
                Navigator.pop(context);
                Navigator.pop(context);
              },
            )
          ],
        ),
      ),
    );
  }
}
