基础组件库
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

37 rader
1.2 KiB

  1. import 'package:flutter/cupertino.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:provider/provider.dart';
  4. import 'package:zhiying_base_widget/widgets/mine/mine_header/mine_header_bloc.dart';
  5. import 'package:zhiying_base_widget/widgets/mine/mine_header/mine_header_container.dart';
  6. import 'package:zhiying_base_widget/widgets/mine/mine_header/mine_header_static_container.dart';
  7. import 'package:zhiying_comm/util/base_bloc.dart';
  8. import 'package:zhiying_comm/zhiying_comm.dart';
  9. class MineHeader extends StatefulWidget {
  10. final Map<String, dynamic> data;
  11. const MineHeader(this.data, {Key key}) : super(key: key);
  12. @override
  13. _MineHeaderState createState() => _MineHeaderState();
  14. }
  15. class _MineHeaderState extends State<MineHeader> {
  16. @override
  17. Widget build(BuildContext context) {
  18. // if (_isSketelon) {
  19. // return MineHeaderSkeleton();
  20. // }
  21. UserInfoModel user = Provider.of<UserInfoNotifier>(context).userInfo;
  22. if (user == null || user.token == null || user.token == '') {
  23. // 未登录
  24. return MineStaticContainer(widget.data);
  25. }
  26. return BlocProvider<MineHeaderBloc>(
  27. bloc: MineHeaderBloc(),
  28. child: MineHeaderContainer(widget.data),
  29. );
  30. }
  31. }