无法加载Flutter应用程序映像

vltsax25  于 2023-02-13  发布在  Flutter
关注(0)|答案(1)|浏览(179)

我尝试过Flutter从cloudinary中拍照,我使用Flutter的调整大小应用程序来避免应用程序的大尺寸,使用flutter build apk --split-per-abi,但安装应用程序后,应用程序无法像我在未调试的情况下直接进行测试时那样拍照

import 'package:faker/faker.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    var faker = new Faker();
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Test Scroll'),
        ),
        body: Scrollbar(
            child: ListView.builder(
          padding: EdgeInsets.all(15),
          itemCount: 1000,
          itemBuilder: (context, index) {
            return Container(
              height: 200,
              padding: EdgeInsets.symmetric(vertical: 10),
              child: Row(
                children: [
                  Container(
                    child: Image.network(
                        'https://res.cloudinary.com/tmart/image/upload/v1673656769/xnmqxoeruaq2yddwevpk.jpg'),
                  ),
                  Container(
                    child: Text(faker.person.name()),
                  ),
                ],
              ),
            );
          },
        )),
      ),
    );
  }
}
ztigrdn8

ztigrdn81#

使用此软件包,您可以识别错误https://pub.dev/packages/cached_network_image

Row(
     children: [
      Container(
      child:
      CachedNetworkImage(
      imageUrl: "https://res.cloudinary.com/tmart/image/upload/v1673656769/xnmqxoeruaq2yddwevpk.jpg",
        progressIndicatorBuilder: (context, url, downloadProgress) =>
            CircularProgressIndicator(value: downloadProgress.progress),
        errorWidget: (context, url, error) => Icon(Icons.error),
      ),

      Container(
        child: Text(faker.person.name()),
      ),
      ],
    ),

相关问题