import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/font_weight.dart';

class StoreHtml extends StatefulWidget {
  final Map<String, dynamic> arguments;

  StoreHtml({this.arguments});

  @override
  State<StatefulWidget> createState() {
    return _StoreHtml();
  }
}

class _StoreHtml extends State<StoreHtml> with WidgetsBindingObserver {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      padding:EdgeInsets.only(top:MediaQuery.of(context).padding.top+17.h,left: 16.w,right: 16.w),
      child: Column(
        children: [
          Row(
            children: [
              GestureDetector(
                behavior: HitTestBehavior.opaque,
                onTap:(){
                  Navigator.of(context).pop();
                },
                child:Image.asset(
                  "assets/image/integral_return.webp",
                  height: 24,
                  width: 24,
                )
              ),
              Expanded(child:
              Container(
                alignment: Alignment.center,
                margin: EdgeInsets.only(right: 24.w),
                child: Text(
                  "店铺详情",
                  style: TextStyle(
                    color: Colors.black,
                    fontSize: 17.sp,
                    fontWeight: MyFontWeight.regular,
                  ),
                ),
              ),),
            ],
          ),
          Container(
            child: Html(
              data: widget.arguments["remark"] ?? "",
              customImageRenders: {
                networkSourceMatcher(): networkImageRender(
                  loadingWidget: () {
                    return Container();
                  },
                ),
              },
            ),
          )
        ],
      ),
    );
  }
}