| | |
| | | import 'dart:ui'; |
| | | |
| | | import 'package:flutter/material.dart'; |
| | | import 'package:flutter_html/flutter_html.dart'; |
| | | import 'package:flutter_spinkit/flutter_spinkit.dart'; |
| | | import 'package:html/dom.dart' as dom; |
| | | import 'package:locations/ui/common/browser.dart'; |
| | | import 'package:locations/utils/pageutils.dart'; |
| | | import 'package:locations/utils/ui_constant.dart'; |
| | | import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; |
| | | |
| | | //通用弹框 |
| | | class NotifyDialog extends Dialog { |
| | |
| | | {this.fontSize = 16.0, |
| | | this.richText = false, |
| | | this.height = 240, |
| | | this.contentColor = const Color(0xFF7E7E7E),this.cancelName="取消",this.sureName="确定"}); |
| | | this.contentColor = const Color(0xFF7E7E7E), |
| | | this.cancelName = "取消", |
| | | this.sureName = "确定"}); |
| | | |
| | | Widget getContent() { |
| | | Widget getContent(BuildContext context) { |
| | | if (richText) { |
| | | return SingleChildScrollView( |
| | | child: Html( |
| | | data: content, |
| | | style: { |
| | | "a": Style( |
| | | textDecoration: TextDecoration.none, |
| | | ) |
| | | }, |
| | | onLinkTap: (String? url, RenderContext context, |
| | | Map<String, String> attributes, dom.Element? element) {})); |
| | | child: HtmlWidget(content, onTapUrl: (String url) { |
| | | NavigatorUtil.navigateToNextPage( |
| | | context, |
| | | BrowserPage( |
| | | title: "", |
| | | url: url, |
| | | ), |
| | | (data) {}); |
| | | |
| | | return true; |
| | | })); |
| | | } else { |
| | | return Text( |
| | | content, |
| | |
| | | Expanded( |
| | | child: Container( |
| | | alignment: Alignment.center, |
| | | padding: EdgeInsets.fromLTRB(15, 5, 15, 5), |
| | | child: getContent(), |
| | | padding: const EdgeInsets.fromLTRB(15, 5, 15, 5), |
| | | child: getContent(context), |
| | | )), |
| | | |
| | | //------按钮区域-------- |