基础组件库
 
 
 
 
 

97 lines
2.3 KiB

  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:zhiying_base_widget/pages/withdraw_page/bloc/withdraw_bloc.dart';
  4. import 'package:zhiying_comm/util/base_bloc.dart';
  5. /*提现页面*/
  6. class WithdrawPage extends StatefulWidget {
  7. final Map<String, dynamic> data;
  8. const WithdrawPage(this.data, {Key key}) : super(key: key);
  9. @override
  10. _WithdrawPageState createState() => _WithdrawPageState();
  11. }
  12. class _WithdrawPageState extends State<WithdrawPage> {
  13. @override
  14. Widget build(BuildContext context) {
  15. return Scaffold(
  16. appBar: _createNav(),
  17. body: SafeArea(
  18. child: BlocProvider<WithdrawBloc>(
  19. bloc: WithdrawBloc(),
  20. child: _WithdrawContainer(widget.data),
  21. ),
  22. ),
  23. );
  24. }
  25. // 导航栏
  26. Widget _createNav() {
  27. return CupertinoNavigationBar(
  28. leading: Navigator.canPop(context)
  29. ? GestureDetector(
  30. child: Container(
  31. padding: EdgeInsets.zero,
  32. child: Icon(
  33. Icons.arrow_back_ios,
  34. size: 20,
  35. ),
  36. ),
  37. onTap: () {
  38. if (Navigator.canPop(context)) {
  39. Navigator.pop(context);
  40. }
  41. },
  42. )
  43. : Container(),
  44. middle: Text(
  45. '提现',
  46. style: TextStyle(
  47. fontSize: 15,
  48. color: Color(0xff333333),
  49. ),
  50. ),
  51. trailing: GestureDetector(
  52. child: Text(
  53. '明细',
  54. style: TextStyle(fontSize: 13, color: Color(0xff333333)),
  55. ),
  56. onTap: () {},
  57. ),
  58. );
  59. }
  60. }
  61. class _WithdrawContainer extends StatefulWidget {
  62. final Map<String, dynamic> data;
  63. const _WithdrawContainer(this.data, {Key key}) : super(key: key);
  64. @override
  65. _WithdrawContainerState createState() => _WithdrawContainerState();
  66. }
  67. class _WithdrawContainerState extends State<_WithdrawContainer> {
  68. WithdrawBloc _bloc;
  69. @override
  70. void initState() {
  71. _bloc = BlocProvider.of<WithdrawBloc>(context);
  72. if (widget.data.containsKey('skip_identifier')) {
  73. _bloc.loadData(widget.data['skip_identifier']);
  74. }
  75. super.initState();
  76. }
  77. @override
  78. Widget build(BuildContext context) {
  79. return SingleChildScrollView(
  80. child: Column(
  81. children: <Widget>[],
  82. ),
  83. );
  84. }
  85. }