empty_cart.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_note/provide/page_index_provide.dart';
  4. import 'package:provide/provide.dart';
  5. class EmptyShoppingCart extends StatelessWidget {
  6. @override
  7. Widget build(BuildContext context) {
  8. return Container(
  9. alignment: Alignment.center,
  10. child: Column(
  11. mainAxisAlignment: MainAxisAlignment.center,
  12. children: [
  13. DecoratedBox(
  14. decoration:
  15. ShapeDecoration(shape: CircleBorder(), color: Colors.black12),
  16. child: Padding(
  17. padding: const EdgeInsets.all(8.0),
  18. child: Icon(CupertinoIcons.shopping_cart,
  19. size: 50.0, color: Colors.white),
  20. )),
  21. Padding(
  22. padding: const EdgeInsets.symmetric(vertical: 4.0),
  23. child: Text('购物车还空着,快去挑选商品吧~',
  24. style: TextStyle(fontSize: 12.0, color: Colors.black26)),
  25. ),
  26. ElevatedButton(
  27. onPressed: () =>
  28. Provide.value<PageIndexProvide>(context).changePage(0),
  29. child: Text('随便逛逛', style: TextStyle(color: Colors.white)),
  30. style: ButtonStyle(
  31. backgroundColor: MaterialStateProperty.all(Colors.pink)),
  32. )
  33. ],
  34. ),
  35. );
  36. }
  37. }