小编Xih*_*uny的帖子

如何构建符合Google Play 64位要求的应用程序?

将apk上传到Play商店后,收到以下警告。我应该做出哪些更改才能发布带有fld sdk的apk版本以满足64位要求?

查看图像以查看警告消息。

https://pasteboard.co/Id8Vqoi.png

android dart flutter

24
推荐指数
2
解决办法
2万
查看次数

如何在 Flutter 中使用 Open Type Font (OTF)?

我在pubspec.yamlAny 中添加了字体True Type Font很好用。但是,当我添加Open Type Font它时,它不起作用。

这是我添加字体的方式 pubspec.yaml

  fonts:
    - family: Kufyan
      fonts:
        - asset: assets/fonts/Kufyan.otf

Run Code Online (Sandbox Code Playgroud)

flutter

17
推荐指数
4
解决办法
6314
查看次数

是否可以将隐藏的小部件导出为图像?

我知道如何使用将可见小部件保存到图像中RepaintBoundary

widget我想要的是一种将用户不可见的文件保存为image.

android dart flutter flutter-layout

7
推荐指数
1
解决办法
873
查看次数

BouncingScrollPhysics 不适用于“shrinkWrap: true”

我有一个ListViewshrinkWrap: true

另外,我申请BouncingScrollPhysics()ListView

问题是反弹物理仅适用于ListView. 当我滚动到顶部时,它不会显示反弹效果。

dart flutter flutter-layout

7
推荐指数
2
解决办法
3090
查看次数

Flutter Listview 滑动以更改 TabBar 索引

我已经在TabBar没有TabBarView. 我使用的是单个选项卡ListViewbody因为选择选项卡后的布局对于所有选项卡都是相同的。

我想要实现的是,在列表视图中向左/向右滑动时更改选项卡。我怎样才能做到这一点?

标签栏

TabBar(
        indicatorWeight: 3,
        indicatorSize: TabBarIndicatorSize.label,
        onTap: (index) {
          categoryId = newsProvider.categories[index].id;
          page = 1;
          fetchPosts(newsProvider);
        },
        isScrollable: true,
        tabs: [
          for (Category category in newsProvider.categories)
            Padding(
              padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
              child: Text(
                category.name,
                style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
              ),
            ),
        ],
      ),
Run Code Online (Sandbox Code Playgroud)

身体

ListView.builder(
                    padding: EdgeInsets.only(bottom: 60),
                    physics: BouncingScrollPhysics(),
                    controller: _scrollController,
                    itemCount: newsProvider.posts.length,
                    itemBuilder: (context, index) {
                      return GestureDetector(
                        onTap: () {
                          Navigator.of(context).push(MaterialPageRoute(
                            builder: (BuildContext context) …
Run Code Online (Sandbox Code Playgroud)

dart flutter

5
推荐指数
1
解决办法
1398
查看次数

如何仅对flutter中的TextField禁用splashColor?

我正在尝试禁用上的涟漪效应TextField

splashColor: Colors.transparent 消除其他小部件上的涟漪效应。

我只想删除上的涟漪效应TextField

dart flutter

3
推荐指数
1
解决办法
302
查看次数

如何从 Flutter 中的另一个小部件访问有状态小部件动画控制器?

我希望计数器小部件onTap在家里显示widget。另外,animation每次点击都要从头开始。

计数器小部件

class Counter extends StatefulWidget {
  @override
  _CounterState createState() => _CounterState();
}

class _CounterState extends State<Counter> with SingleTickerProviderStateMixin {
  AnimationController animationController;
  Animation<double> animation;

  @override
  void initState() {
    super.initState();
    animationController = AnimationController(
      vsync: this,
      duration: Duration(milliseconds: 1000),
    )
      ..addListener(() => setState(() {}));

    animation = CurvedAnimation(
      parent: animationController,
      curve: Curves.elasticOut,
    );

    animationController.forward();
  }

  @override
  Widget build(BuildContext context) {
    return ScaleTransition(
      child: Container(
        height: 100,
        width: 100,
        color: Colors.blue,
      ),
      scale: animation,
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

主页小部件 …

flutter flutter-animation

3
推荐指数
1
解决办法
1873
查看次数

如何在颤动中制作小部件下滑动画?

我想slide-down为小部件制作动画。我在互联网上看到了很多例子,但没有一个符合我的要求。这是我需要的。下面是我制作的自定义小部件。

Widget Toast(String content, ToastType type) {
  return Column(
    children: <Widget>[
      Padding(
        padding: const EdgeInsets.all(50),
        child: Card(
          elevation: 10,
          shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
          color: ToastColors[type.index],
          child: Padding(
            padding: const EdgeInsets.only(left: 15, right: 20, top: 10, bottom: 10),
            child: Row(
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                ToastIcons[type.index],
                SizedBox(
                  width: 15,
                ),
                Flexible(
                  child: Text(
                    content,
                    style: TextStyle(
                      color: Colors.white,
                      fontWeight: FontWeight.w400,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    ],
  );
}
Run Code Online (Sandbox Code Playgroud)

这是一个吐司布局。我希望可以从应用程序内的任何地方访问它。这就是为什么我dart为此创建了单独的文件。

我想要的是? 当显示小部件时,我希望 toast 布局向下滑动。我不想循环或反转动画。动画完成后,widget 必须静止在结束位置。

dart flutter flutter-layout flutter-animation

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

如何在展开的ListView中设置容器宽度

Container当我包裹在小部件ListView内时,我无法设置宽度Expanded

Widget build(BuildContext context) {
return Center(
  child: Column(
    children: [
      Padding(
        padding: EdgeInsets.only(top: 30, bottom: 30),
        child: Text(
          'Transactions History',
          style: TextStyle(
            fontWeight: FontWeight.bold,
            fontSize: 25,
          ),
        ),
      ),
      Expanded(
        child: ListView.builder(
          physics: BouncingScrollPhysics(),
          itemCount: 30,
          itemBuilder: (BuildContext context, int index) {
            return Container(
              width: 100,
              color: Colors.red,
              child: Card(
                child: Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 15),
                ),
              ),
            );
          },
        ),
      ),
    ],
  ),
);
}
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout

2
推荐指数
1
解决办法
637
查看次数

ClipboardManager 在 Android Q 上不起作用。有什么解决方法吗?

Android Q 阻止后台剪贴板访问。有什么办法可以在我的应用程序中使用此服务吗?有没有权限开启这个功能?

java android

0
推荐指数
1
解决办法
764
查看次数