forked from lxm_flutter/FlutterUnit
案例优化
This commit is contained in:
@@ -2,12 +2,11 @@
|
||||
/// create by 张风捷特烈 on 2020-04-15
|
||||
/// contact me by email 1981462002@qq.com
|
||||
/// 说明:
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'language/dart_languge.dart';
|
||||
|
||||
import 'high_light_code.dart';
|
||||
import 'highlighter_style.dart';
|
||||
import 'language/dart_languge.dart';
|
||||
|
||||
class CodeWidget extends StatelessWidget {
|
||||
CodeWidget({Key? key, required this.code,required this.style, this.fontSize = 13,this.fontFamily})
|
||||
@@ -21,10 +20,7 @@ class CodeWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget body;
|
||||
if (code == null) {
|
||||
return Container();
|
||||
} else {
|
||||
Widget _codeWidget;
|
||||
Widget _codeWidget;
|
||||
try {
|
||||
_codeWidget = RichText(
|
||||
text: TextSpan(
|
||||
@@ -49,7 +45,6 @@ class CodeWidget extends StatelessWidget {
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0))),
|
||||
),
|
||||
);
|
||||
}
|
||||
return body;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user