bottom_summary.dart 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_note/provide/cart_provide.dart';
  3. class BottomCartSummary extends StatelessWidget {
  4. final CartProvide cartProvide;
  5. BottomCartSummary({Key key, this.cartProvide}) : super(key: key);
  6. @override
  7. Widget build(BuildContext context) {
  8. return Container(
  9. padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
  10. height: 60.0,
  11. child:
  12. Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
  13. Checkbox(
  14. value: cartProvide.allCheckedState,
  15. onChanged: (checkState) {
  16. cartProvide.allCheckStateChange(checkState);
  17. },
  18. activeColor: Colors.pink),
  19. Text('全选', style: TextStyle(color: Colors.black, fontSize: 15.0)),
  20. // 合计价格
  21. Expanded(
  22. child: Container(
  23. padding: const EdgeInsets.symmetric(horizontal: 12.0),
  24. child: Column(
  25. crossAxisAlignment: CrossAxisAlignment.end,
  26. mainAxisAlignment: MainAxisAlignment.center,
  27. children: [
  28. Row(
  29. mainAxisAlignment: MainAxisAlignment.end,
  30. children: [
  31. Text('合计:',
  32. style:
  33. TextStyle(color: Colors.black, fontSize: 18.0)),
  34. Text('¥${cartProvide.allCheckedPrice}',
  35. style: TextStyle(
  36. color: Colors.red[700], fontSize: 16.0)),
  37. ],
  38. ),
  39. Text('满10元免费配送,预购免费配送',
  40. style: TextStyle(color: Colors.black, fontSize: 10.0))
  41. ],
  42. ))),
  43. // 结算按钮
  44. RaisedButton(
  45. onPressed: () {},
  46. child: Text('结算(${cartProvide.allCheckedCount})',
  47. style: TextStyle(color: Colors.white)),
  48. color: Colors.pink,
  49. )
  50. ]),
  51. );
  52. }
  53. }