fix design request
This commit is contained in:
@@ -7,11 +7,11 @@ import UIKit
|
|||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
) -> Bool {
|
) -> Bool {
|
||||||
#if DEBUG
|
// #if DEBUG
|
||||||
var args = ProcessInfo.processInfo.arguments
|
// var args = ProcessInfo.processInfo.arguments
|
||||||
args.append("-FIRDebugEnabled")
|
// args.append("-FIRDebugEnabled")
|
||||||
ProcessInfo.processInfo.setValue(args, forKey: "arguments")
|
// ProcessInfo.processInfo.setValue(args, forKey: "arguments")
|
||||||
#endif
|
// #endif
|
||||||
GeneratedPluginRegistrant.register(with: self)
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,12 +305,14 @@ class DesignRequestDetailPage extends ConsumerWidget {
|
|||||||
value: request.subject,
|
value: request.subject,
|
||||||
),
|
),
|
||||||
|
|
||||||
if (request.plainDescription.isNotEmpty) ...[
|
if (request.description != null &&
|
||||||
|
request.description!.isNotEmpty) ...[
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
DescriptionItem(
|
DescriptionItem(
|
||||||
label: 'Mô tả chi tiết:',
|
label: 'Mô tả chi tiết:',
|
||||||
value: request.plainDescription,
|
value: request.description!,
|
||||||
isMultiLine: true,
|
isMultiLine: true,
|
||||||
|
isHtml: true,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
library;
|
library;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_html/flutter_html.dart';
|
||||||
|
|
||||||
/// Description Item Widget
|
/// Description Item Widget
|
||||||
///
|
///
|
||||||
/// Shows a label and value pair with:
|
/// Shows a label and value pair with:
|
||||||
/// - Inline layout (label: value) for single line
|
/// - Inline layout (label: value) for single line
|
||||||
/// - Stacked layout for multi-line values
|
/// - Stacked layout for multi-line values
|
||||||
|
/// - HTML rendering support for rich text content
|
||||||
/// - Theme-aware colors
|
/// - Theme-aware colors
|
||||||
class DescriptionItem extends StatelessWidget {
|
class DescriptionItem extends StatelessWidget {
|
||||||
const DescriptionItem({
|
const DescriptionItem({
|
||||||
@@ -17,11 +19,55 @@ class DescriptionItem extends StatelessWidget {
|
|||||||
required this.label,
|
required this.label,
|
||||||
required this.value,
|
required this.value,
|
||||||
this.isMultiLine = false,
|
this.isMultiLine = false,
|
||||||
|
this.isHtml = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final String value;
|
final String value;
|
||||||
final bool isMultiLine;
|
final bool isMultiLine;
|
||||||
|
final bool isHtml;
|
||||||
|
|
||||||
|
Widget _buildValueWidget(BuildContext context) {
|
||||||
|
final colorScheme = Theme.of(context).colorScheme;
|
||||||
|
|
||||||
|
if (isHtml) {
|
||||||
|
return Html(
|
||||||
|
data: value,
|
||||||
|
style: {
|
||||||
|
'body': Style(
|
||||||
|
fontSize: FontSize(15),
|
||||||
|
color: colorScheme.onSurface,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
lineHeight: const LineHeight(1.6),
|
||||||
|
margin: Margins.zero,
|
||||||
|
padding: HtmlPaddings.zero,
|
||||||
|
),
|
||||||
|
'p': Style(
|
||||||
|
margin: Margins.only(bottom: 8),
|
||||||
|
),
|
||||||
|
'ul': Style(
|
||||||
|
margin: Margins.only(left: 16, bottom: 8),
|
||||||
|
),
|
||||||
|
'ol': Style(
|
||||||
|
margin: Margins.only(left: 16, bottom: 8),
|
||||||
|
),
|
||||||
|
'li': Style(
|
||||||
|
margin: Margins.only(bottom: 4),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Text(
|
||||||
|
value,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: colorScheme.onSurface,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
height: 1.6,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -40,15 +86,7 @@ class DescriptionItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
_buildValueWidget(context),
|
||||||
value,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
color: colorScheme.onSurface,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
height: 1.6,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -75,15 +113,7 @@ class DescriptionItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: _buildValueWidget(context),
|
||||||
value,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15,
|
|
||||||
color: colorScheme.onSurface,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
height: 1.6,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user