import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; import 'model/wallet_appbar_model.dart'; class WalletAppbar extends StatelessWidget { final Map data; const WalletAppbar({Key key, this.data}) : super(key: key); @override Widget build(BuildContext context) { var model = WalletAppbarModel.fromJson(json.decode(data['data'])); return Container( height: MediaQuery.of(context).padding.top + 56, child: AppBar( elevation: 0, leading: Navigator.canPop(context) ? IconButton( icon: Icon(Icons.arrow_back_ios), onPressed: () { Navigator.of(context).pop(); }) : Container(), backgroundColor: HexColor.fromHex(model.appBarBgColor??""), centerTitle: true, title: Text( model.appBarName??"", style: TextStyle(color: HexColor.fromHex(model.appBarNameColor??"")), ), ), ); } }