styles.dart 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import 'package:flutter/material.dart';
  2. import 'button_factory.dart';
  3. class Styles {
  4. //默认的背景阴影和半径
  5. static const BoxDecoration cardDecoration = const BoxDecoration(
  6. color: Colors.white,
  7. boxShadow: [
  8. BoxShadow(color: Color(0x1A5b74FF), blurRadius: 4, spreadRadius: 2.4)
  9. ],
  10. borderRadius: BorderRadius.all(Radius.circular(8.0)));
  11. static Widget getBtn(BuildContext context, String title, Function callback) {
  12. // return InkWell(
  13. // child: Container(
  14. // child: Text(title, style: TextStyle(color: Color(0xFF00349c))),
  15. // height: 40,
  16. // width: MediaQuery.of(context).size.width - 100,
  17. // alignment: Alignment.center,
  18. // margin: EdgeInsets.only(bottom: 12),
  19. // decoration: Styles.cardDecoration),
  20. // onTap: () {
  21. // if (callback != null) {
  22. // callback();
  23. // }
  24. // });
  25. return ButtonFactory.getRoundLargeBtn(
  26. context,
  27. backgroundColor: Colors.white,
  28. text: title,
  29. textColor: Colors.white,
  30. onTap: () {
  31. if (callback != null) {
  32. callback();
  33. }
  34. },
  35. );
  36. }
  37. }