Flutter 读取和写入 rtf 文件

Pat*_*ick 6 rtf dart flutter

我最近发现了桌面应用程序的 Flutter。现在我想制作一个能够从中提取 RichText 并将其写入 rtf 文件的应用程序。

我有可能这样做吗?

小智 1

我无法从 asset 中读取 rtf 文件。我做了一些研究,但一无所获。Flutter 没有任何东西可以读取 .rtf 文件。

它显示这样的响应。

{\rtf1\ansi\ansicpg1252\cocoartf2513
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 ArialMT;}
{\colortbl;\red255\green255\blue255;\red83\green83\blue83;\red255\green255\blue255;}
{\*\expandedcolortbl;;\cssrgb\c40000\c40000\c40000;\cssrgb\c100000\c100000\c100000;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}
{\list\listtemplateid2\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid101\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listname ;}\listid2}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}{\listoverride\listid2\listoverridecount0\ls2}}
\paperw12240\paperh15840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\partightenfactor0

\f0\fs36 \cf2 \cb3 \expnd0\expndtw0\kerning0
1:1 Minecraft recreation of ALIEN ISOLATION\'a0You're traveling to Sevastopol Space Station, searching for information about your missing Mother. An devastating incident, however, caused caos ond anarchy at that commercial outpost of Seegson corporation.As Amanda Ripley, you're trying to get information, survive the situation and ultimately escape the station.\
\
\pard\pardeftab720\partightenfactor0
\cf2 \outl0\strokewidth0 This map is the result of more than 2500 hours of work.\'a0You're playing the protagonist of this adventure RPG, traveling through different facilities, facing different opponents, simple riddles and NPCs.\
\
\pard\pardeftab720\sl576\sa360\partightenfactor0
\cf2 THE MAP:\
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
\ls1\ilvl0\cf2 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226  }\expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 Storydriven adventure RPG\cb1 \
\ls1\ilvl0\cb3 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226  }\expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 Singleplayer\cb1 \
\ls1\ilvl0\cb3 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226  }\expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 Custom resources (16x16)\cb1 \
\ls1\ilvl0\cb3 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226  }\expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 Custom crafting system & unique items\cb1 \
\ls1\ilvl0\cb3 \kerning1\expnd0\expndtw0 \outl0\strokewidth0 {\listtext \uc0\u8226  }\expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 Unique Alien Add-On\cb1 \
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
\ls2\ilvl0\cf2 \outl0\strokewidth0 \
}
Run Code Online (Sandbox Code Playgroud)