基础组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 lines
1.1 KiB

  1. import 'dart:convert';
  2. import 'package:flutter/material.dart';
  3. import 'package:zhiying_comm/zhiying_comm.dart';
  4. ///
  5. /// 通用模块的AppBar Widget
  6. ///
  7. class CustomAppBarWidget extends StatelessWidget {
  8. final Map<String, dynamic> data;
  9. Map<String, dynamic> model;
  10. CustomAppBarWidget(this.data, {Key key}) : super(key: key) {
  11. try {
  12. var dataItem = data['data'];
  13. if (!EmptyUtil.isEmpty(dataItem)) {
  14. model = dataItem is Map ? dataItem : dataItem is String ? jsonDecode(dataItem) : null;
  15. }
  16. } catch (e, s) {
  17. Logger.error(e, s);
  18. }
  19. }
  20. @override
  21. Widget build(BuildContext context) {
  22. return SliverAppBar(
  23. leading: IconButton(
  24. icon: Icon(
  25. Icons.arrow_back_ios,
  26. size: 22,
  27. color: HexColor.fromHex( '#333333'),
  28. ),
  29. onPressed: () => Navigator.maybePop(context),
  30. ),
  31. title: Text(
  32. '自定义页面',
  33. style: TextStyle(
  34. fontSize: 15,
  35. color: HexColor.fromHex('#333333'),
  36. fontWeight: FontWeight.bold,
  37. ),
  38. ),
  39. );
  40. }
  41. }