小编Mar*_*arc的帖子

如何在我的flutter应用程序中使用预先填充的sqlite数据库

正如标题中的问题所说.

我的数据库文件可能非常大,所以我不想不必要地复制它,我当然不想在原位构建它.

如果db文件是一个颤动的资产,sqlite有没有办法直接访问它?

我已经看到了一些建议,我应该将资产的原始数据复制到文件中,然后访问它,但这会浪费存储空间.或者我可以删除资产吗?

有没有一种简单的方法将数据库部署为资源以外的其他东西,即作为原始文件?

sqlite mobile flutter

6
推荐指数
1
解决办法
2544
查看次数

在Flutter中使用DefaultTextStyle

我正在尝试应用DefaultTextStyle,但是即使样式已定义且可用(通过调用建立DefaultTextStyle.of(context).style),默认情况下也不会应用于子Text对象。那么,我在做什么错了,还是听不懂?

这是build我的调用类中的方法,其中定义了我的方法DefaultTextStyle

  Widget build(BuildContext context) {
    return new MaterialApp(
      onGenerateTitle: (BuildContext context) =>
      Strings.of(context).getStr('app_title'),
      localizationsDelegates: [
        const StringsDelegate(),
        GlobalWidgetsLocalizations.delegate,
      ],
      localeResolutionCallback: Strings.resolveLocale,
      // Watch out: MaterialApp creates a Localizations widget
      // with the specified delegates. DemoLocalizations.of()
      // will only find the app's Localizations widget if its
      // context is a child of the app.
      theme: new ThemeData(
        primarySwatch: Colors.blue,
        ),
      home: new DefaultTextStyle(
        style: new TextStyle(
          fontWeight: FontWeight.bold,
          decoration: TextDecoration.underline, …
Run Code Online (Sandbox Code Playgroud)

flutter

6
推荐指数
2
解决办法
2865
查看次数

标签 统计

flutter ×2

mobile ×1

sqlite ×1