bottom_summary.dart 2.1 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: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
  12. Checkbox(
  13. value: cartProvide.allCheckedState,
  14. onChanged: (checkState) {
  15. cartProvide.allCheckStateChange(checkState);
  16. },
  17. activeColor: Colors.pink),
  18. Text('全选', style: TextStyle(color: Colors.black, fontSize: 15.0)),
  19. // 合计价格
  20. Expanded(
  21. child: Container(
  22. padding: const EdgeInsets.symmetric(horizontal: 12.0),
  23. child: Column(
  24. crossAxisAlignment: CrossAxisAlignment.end,
  25. mainAxisAlignment: MainAxisAlignment.center,
  26. children: [
  27. Row(
  28. mainAxisAlignment: MainAxisAlignment.end,
  29. children: [
  30. Text('合计:',
  31. style:
  32. TextStyle(color: Colors.black, fontSize: 18.0)),
  33. Text('¥${cartProvide.allCheckedPrice}',
  34. style: TextStyle(
  35. color: Colors.red[700], fontSize: 16.0)),
  36. ],
  37. ),
  38. Text('满10元免费配送,预购免费配送',
  39. style: TextStyle(color: Colors.black, fontSize: 10.0))
  40. ],
  41. ))),
  42. // 结算按钮
  43. ElevatedButton(
  44. onPressed: () {},
  45. child: Text('结算(${cartProvide.allCheckedCount})',
  46. style: TextStyle(color: Colors.white)),
  47. style: ButtonStyle(
  48. backgroundColor: MaterialStateProperty.all(Colors.pink)),
  49. )
  50. ]),
  51. );
  52. }
  53. }