3346463
/// 📋 构建代码块组件 - 🔧 修复版(使用正确的 SyntaxView)


Widget _buildCodeBlockWidget(String code, String? language, ThemeController themeController) {


print("🔧 构建代码块组件:");


print(" 代码内容: '$code'");


print(" 语言: '$language'");


print(" 代码长度: ${code.length}");



return Container(


margin: EdgeInsets.symmetric(vertical: ScreenUtilConfig.setHeight(12)),


child: ClipRRect(


borderRadius: BorderRadius.circular(ScreenUtilConfig.setRadius(8)),


child: SyntaxView(


code: code,


syntax: _mapLanguageToSyntax(language),


syntaxTheme: themeController.isDarkMode.value


? SyntaxTheme.vscodeDark()


: SyntaxTheme.vscodeLight(),


fontSize: 14.0,


withZoom: false,


withLinesCount: true,


expanded: false,


),


),


);


}


978878788878788

标签: HarmonyOS

添加新评论