问:
Flutter: How to select multiple options in checkboxlisttile
```<code>class PickLabelScreen extends StatefulWidget {
  const PickLabelScreen({
    Key? key,
    required this.labelTitle,
  }) : super(key: key);

  final String labelTitle;

  @override
  State<PickLabelScreen> createState() => _PickLabelScreenState();
}

class _PickLabelScreenState extends State<PickLabelScreen> {
  late String _labelChoosed;

  @override
  void initState() {
    super.initState();
    _labelChoosed = widget.labelTitle;
  }

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        Navigator.of(context).pop(_labelChoosed);
        return false;
      },
      child: Scaffold(
        appBar: AppBar(
          leading: IconButton(
            icon: const Icon(
              Icons.arrow_back,
            ),
            onPressed: () {
              Navigator.of(context).pop(_labelChoosed);
            },
          ),
          actions: [
            IconButton(
              onPressed: () async {
                final String newLabel = await showDialog(
                  context: context,
                  barrierDismissible: false,
                  builder: (context) => const DialogLabelWidget(),
                );
                setState(() {
                  if (newLabel.isNotEmpty) _labelChoosed = newLabel;
                });
              },
              icon: const Icon(Icons.add),
            ),
          ],
        ),
        body: Consumer<LabelProvider>(
          builder: (context, labelProvider, child) =>
          labelProvider.items.isEmpty
              ? child!
              : ListView.builder(
            itemBuilder: (context, index) {
              final currentLabel = labelProvider.items[index];
              return CheckboxListTile(
                value: _labelChoosed == currentLabel.title,
                title: Text(
                  currentLabel.title,
                  style: TextStyleConstants.titleStyle3,
                ),
                secondary: const Icon(Icons.label_outline),
                onChanged: (value) {
                  setState(() {
                    if (value == true) {
                      _labelChoosed = currentLabel.title;
                    } else {
                      _labelChoosed = '';
                    }
                  });
                },
                activeColor: ColorsConstant.blueColor,
              );
            },
            itemCount: labelProvider.items.length,
          ),
          child: const SizedBox.shrink(),
        ),
      ),
    );
  }
}

</code>```

This is a flutter note app, and I am trying to label the notes.
Can anyone tell me how to select several options to label notes?
This code can create multiple options with dialoge, but cannot click them at once.
What I want is to create, select more than one checkbox, and save them to database.
Here is pick_label_screen.dart code.

Body:
class PickLabelScreen extends StatefulWidget {
  const PickLabelScreen({
    Key? key,
    required this.labelTitle,
  }) : super(key: key);

  final String labelTitle;

  @override
  State<PickLabelScreen> createState() => _PickLabelScreenState();
}

class _PickLabelScreenState extends State<PickLabelScreen> {
  late String _labelChoosed;

  @override
  void initState() {
    super.initState();
    _labelChoosed = widget.labelTitle;
  }

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        Navigator.of(context).pop(_labelChoosed);
        return false;
      },
      child: Scaffold(
        appBar: AppBar(
          leading: IconButton(
            icon: const Icon(
              Icons.arrow_back,
            ),
            onPressed: () {
              Navigator.of(context).pop(_labelChoosed);
            },
          ),
          actions: [
            IconButton(
              onPressed: () async {
                final String newLabel = await showDialog(
                  context: context,
                  barrierDismissible: false,
                  builder: (context) => const DialogLabelWidget(),
                );
                setState(() {
                  if (newLabel.isNotEmpty) _labelChoosed = newLabel;
                });
              },
              icon: const Icon(Icons.add),
            ),
          ],
        ),
        body: Consumer<LabelProvider>(
          builder: (context, labelProvider, child) =>
          labelProvider.items.isEmpty
              ? child!
              : ListView.builder(
            itemBuilder: (context, index) {
              final currentLabel = labelProvider.items[index];
              return CheckboxListTile(
                value: _labelChoosed == currentLabel.title,
                title: Text(
                  currentLabel.title,
                  style: TextStyleConstants.titleStyle3,
                ),
                secondary: const Icon(Icons.label_outline),
                onChanged: (value) {
                  setState(() {
                    if (value == true) {
                      _labelChoosed = currentLabel.title;
                    } else {
                      _labelChoosed = '';
                    }
                  });
                },
                activeColor: ColorsConstant.blueColor,
              );
            },
            itemCount: labelProvider.items.length,
          ),
          child: const SizedBox.shrink(),
        ),
      ),
    );
  }
}

This is a flutter note app, and I am trying to label the notes.
Can anyone tell me how to select several options to label notes?
This code can create multiple options with dialoge, but cannot click them at once.
What I want is to create, select more than one checkbox, and save them to database.
Here is pick_label_screen.dart code.


来源: stackexchange

问:
Issues with Server Logs and Server Downtime IIS .Net Core application
I was given a dump of logs in 2 folders (so like 200 individual files from a server that I cannot access), to see what errors/exceptions were occurring
and causing server downtime/other issues?

I have tried HTTPLogParser which cannot read the files and I have LogParser 2.2 from Microsoft (old) but I have too many files to look through individually.

I have no access to the server so cannot connect anything which sucks.

Any good ideas on how to load a folder of these 2022-11-xx.log files and get some analyses done?

An example of the data in the files are:

```<code>G:\LogFiles\W9BVC3\u_ex20113046.log:204:2022-10-30 00:00:18 1112.23.3.12 GET /cool-website - 80 - 147.115.242.13 Pingdom.com_bot_version_1.4_   (http://www.pingdom.com/) - 200 0 0 0
G:\LogFiles\W9BVC3\u_ex20113046.log:982:2022-10-30 00:01:18 1112.23.3.12 GET /cool-website - 80 - 147.115.242.13 Pingdom.com_bot_version_1.4_   (http://www.pingdom.com/) - 200 0 0 0
G:\LogFiles\W9BVC3\u_ex20113046.log:1061:2022-10-30 00:01:31 1112.23.3.12 GET /cool-website/api/v2/status/day - 80 - 147.115.242.13     Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/105.0.0.0+Safari/517.36
https://examplewebsite.com/cool-website/ 200 0 0 0
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I was given a dump of logs in 2 folders (so like 200 individual files from a server that I cannot access), to see what errors/exceptions were occurring
and causing server downtime/other issues?

I have tried HTTPLogParser which cannot read the files and I have LogParser 2.2 from Microsoft (old) but I have too many files to look through individually.

I have no access to the server so cannot connect anything which sucks.

Any good ideas on how to load a folder of these 2022-11-xx.log files and get some analyses done?

An example of the data in the files are:

G:\LogFiles\W9BVC3\u_ex20113046.log:204:2022-10-30 00:00:18 1112.23.3.12 GET /cool-website - 80 - 147.115.242.13 Pingdom.com_bot_version_1.4_   (http://www.pingdom.com/) - 200 0 0 0
G:\LogFiles\W9BVC3\u_ex20113046.log:982:2022-10-30 00:01:18 1112.23.3.12 GET /cool-website - 80 - 147.115.242.13 Pingdom.com_bot_version_1.4_   (http://www.pingdom.com/) - 200 0 0 0
G:\LogFiles\W9BVC3\u_ex20113046.log:1061:2022-10-30 00:01:31 1112.23.3.12 GET /cool-website/api/v2/status/day - 80 - 147.115.242.13     Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/105.0.0.0+Safari/517.36
https://examplewebsite.com/cool-website/ 200 0 0 0


问:
Excluding Custom Taxonomy Terms from a CPT Archive Page
After referring to all the other posts about similar subjects, and attempting to Frankenstein together a solution, I've decided to do the thing I never do and ask for help. :)

I need to have specific posts tagged with specific terms from a custom taxonomy excluded on a Custom Post Type Archive page only (so they still show up in their own individual archive pages)

The CPT: 'Guest' - default slug is 'guest' -but the archive slug is set to 'guests' (I've tried using both)

The Taxonomy: Guest Type - slug is also set to 'guests'*

**Code I've come up with so far: **

```<code>  // Guest Archive Category Exclusions --->
  function exclude_posts( $query ) {
      if ( $query->is_archive('guest') ) {
          $query->set( 'guests', array( -180, -205, -179 ) ); //Exclude inMemorium, Postponed, Alumni
    }
  }
  add_action( 'pre_get_posts', 'exclude_posts' );

  //END Guest Archives Category Exclusions <--
</code>```

Thank You so much for your help!

*totally off-topic explanation for the curious - the slugs were both set to 'guests' on purpose since there is no archive page set for a taxonomy type. Bonus points if you know how to activate one.

I've tried multiple things from the other threads on similar topics.

They either break the site or do nothing.

Body:
After referring to all the other posts about similar subjects, and attempting to Frankenstein together a solution, I've decided to do the thing I never do and ask for help. :)

I need to have specific posts tagged with specific terms from a custom taxonomy excluded on a Custom Post Type Archive page only (so they still show up in their own individual archive pages)

The CPT: 'Guest' - default slug is 'guest' -but the archive slug is set to 'guests' (I've tried using both)

The Taxonomy: Guest Type - slug is also set to 'guests'*

**Code I've come up with so far: **

  // Guest Archive Category Exclusions --->
  function exclude_posts( $query ) {
      if ( $query->is_archive('guest') ) {
          $query->set( 'guests', array( -180, -205, -179 ) ); //Exclude inMemorium, Postponed, Alumni
    }
  }
  add_action( 'pre_get_posts', 'exclude_posts' );

  //END Guest Archives Category Exclusions <--

Thank You so much for your help!

*totally off-topic explanation for the curious - the slugs were both set to 'guests' on purpose since there is no archive page set for a taxonomy type. Bonus points if you know how to activate one.

I've tried multiple things from the other threads on similar topics.

They either break the site or do nothing.


问:
Cann't find the table when execting query in TDengine
I have a series of tables in TDengine database. If I execute "show tables", I can see all of them. However, when I execute some queries on a table, it reports "Fail to get table info".

You can see the error information on the picture.

enter image description here

What may be the problem?


问:
Assign a type to JSONField in Django
I'm using a property of type JSONField in my model:

```<code>from django.db import models

class MyClass(models.Model):
  variables = models.JSONField()
</code>```

I want to avoid as much as possible using strings to access variables properties, is there any way to specify the type of variables, so that I can use obj.variables.prop_name rather than obj.variables['prop_name']?

Title: Assign a type to JSONField in Django

Body:
I'm using a property of type JSONField in my model:

from django.db import models

class MyClass(models.Model):
  variables = models.JSONField()

I want to avoid as much as possible using strings to access variables properties, is there any way to specify the type of variables, so that I can use obj.variables.prop_name rather than obj.variables['prop_name']?


问:
Python : What is my mistake in my inner class to set the init method?
I have an Uuter class with few instaces variables and i want to set one to the Inner class.
The code :

```<code>class AutoComplete :

    def __init__(self, ocr_all_doc_text , pdf_id, connection ) :
        self.ocr_text   = ocr_all_doc_text
        self.pdf_id     = pdf_id
        self.connection = connection

        self.dataregex = self.DataRegex(self, ocr_all_doc_text)

    def show(self):
        print(self.pdf_id)

    class DataRegex :

        def __init__(self, ocr_all_doc_text) :
            self.ocr_all_doc_text = ocr_all_doc_text

        def get_tva_list_from_string(self,) :
            pass
</code>```

I get this error : AutoComplete.DataRegex.__init__() takes 2 positional arguments but 3 were given when I run

```<code>auto_complete = AutoComplete(ocr_all_doc_text = text_ocr_all, pdf_id = pdf_id, connection=connection)

# GET LIST TVA  OCR
data = auto_complete.dataregex
print(data)
</code>```

I do not get the fact that I gave 3 positional arguments.

Thank you

Body:
I have an Uuter class with few instaces variables and i want to set one to the Inner class.
The code :

class AutoComplete :

    def __init__(self, ocr_all_doc_text , pdf_id, connection ) :
        self.ocr_text   = ocr_all_doc_text
        self.pdf_id     = pdf_id
        self.connection = connection

        self.dataregex = self.DataRegex(self, ocr_all_doc_text)

    def show(self):
        print(self.pdf_id)

    class DataRegex :

        def __init__(self, ocr_all_doc_text) :
            self.ocr_all_doc_text = ocr_all_doc_text

        def get_tva_list_from_string(self,) :
            pass

I get this error : AutoComplete.DataRegex.__init__() takes 2 positional arguments but 3 were given when I run

auto_complete = AutoComplete(ocr_all_doc_text = text_ocr_all, pdf_id = pdf_id, connection=connection)

# GET LIST TVA  OCR
data = auto_complete.dataregex
print(data)

I do not get the fact that I gave 3 positional arguments.

Thank you


问:
How can I capture screen shots of user's visible screen on button click from a web app using django/python hosted on amazon linux 2 CLI
I'm trying to create a screenshot taking web app written in python django, meant for user work monitoring. It is supposed to take screenshots of the whole visible screen, not just the browser, in 5minute interval. The web app is to be built using Python Django and is hosted on amazon linux 2 Centos.

I tried using pyautogui but it looks like it doesn't work on CLI or headless servers. Selenium and other python and javascript packages I've checked are only limited to the browser (As of my knowledge. Correct me if I'm wrong.). I need to be able to get screenshots of the whole visible screen regardless of open application. I know it sounds hacker-ish so please guide me to the correct path. How do I implement this? Thank you!


问:
How can I apply a function over each of the rows of a data.table object in R?
I have a data table where I want to apply t.test over each row of columns A and B:

```<code>DT <- data.table(A=rnorm(30,0,1),B=rnorm(30,0,5))
DT[,pval:=t.test(A,B)$p.value]
</code>```

However, the above result gives me the same value in pval, how can I do this row-wise?

Body:
I have a data table where I want to apply t.test over each row of columns A and B:

DT <- data.table(A=rnorm(30,0,1),B=rnorm(30,0,5))
DT[,pval:=t.test(A,B)$p.value]

However, the above result gives me the same value in pval, how can I do this row-wise?


问:
Issues adding Marketplace Apps as attachments to Google Calendar
Facing an issue with my enterprise account where attaching docs (such as Miro, Lucid) attach successfully the first time to Calendar invites, but subsequent attachments fail.

This works fine with non enterprise account. I have disabled API Control for 3rd Party apps and Google Calendar logs not showing any related logs.

Anyone come across this?

TLDR: adding an app such as Lucid to a Calendar invite. First attachment works, all others fail with no error messages.

Disabled API Control in Enterprise Account

Tested with MIRO, LucidChard and a Custom App. All attach on first invite and fail on others

Checked the Calendar logs

Works perfectly on personal Google Calendar


问:
image.getCropRect() return wrong crop rectangle
I want to crop image from imageAnalysis in same ratio as a viewportsize:

```<code>
    ImageAnalysis imageAnalysis = new ImageAnalysis.Builder()
            .setTargetResolution(new Size(1200, 1200))
            .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
            .setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888)
            .build();

    // ViewPort
    Rational aspectRatio = new Rational(cameraView.getWidth(), cameraView.getHeight());
    ViewPort viewPort = new ViewPort.Builder(aspectRatio, preview.getTargetRotation()).setScaleType(ViewPort.FILL_CENTER).build();

    UseCaseGroup useCaseGroup = new UseCaseGroup.Builder()
            .addUseCase(preview)
            .addUseCase(imageAnalysis)
            .setViewPort(viewPort)
            .build();

</code>```

ImageProxy result size:

```<code>            height= image.getWidth(); //1280
            width= image.getHeight(); // 960
            сrop_rect = image.getCropRect();
</code>```

Viewport size

```<code>            heightPreview = binding.cameraView.getHeight(); //2274
            widthPreview = binding.cameraView.getWidth(); //1080
</code>```

proxyImage size: 1280x960
viewport size: 2274x1080

I call image.getCropRect();

And we got the clipping rectangle:

```<code>Rect(
    bottom = 784,
    left = 0,
    right = 1280,
    top = 176
)
</code>```

The red area is the clipping coordinates.

But these are not the right coords!

Right coords is (I calculated it on paper ):

```<code>Rect(
    bottom = 606,
    left = 0,
    right = 1280,
    top = 177
)
</code>```

And right red border cropping area.

(The coords and example images may be in the wrong rotation)

Where I did a mistake to calc a right cropping coords?
What exactly does getCropRect() return?

Body:
I want to crop image from imageAnalysis in same ratio as a viewportsize:

    ImageAnalysis imageAnalysis = new ImageAnalysis.Builder()
            .setTargetResolution(new Size(1200, 1200))
            .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
            .setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888)
            .build();

    // ViewPort
    Rational aspectRatio = new Rational(cameraView.getWidth(), cameraView.getHeight());
    ViewPort viewPort = new ViewPort.Builder(aspectRatio, preview.getTargetRotation()).setScaleType(ViewPort.FILL_CENTER).build();

    UseCaseGroup useCaseGroup = new UseCaseGroup.Builder()
            .addUseCase(preview)
            .addUseCase(imageAnalysis)
            .setViewPort(viewPort)
            .build();

ImageProxy result size:

            height= image.getWidth(); //1280
            width= image.getHeight(); // 960
            сrop_rect = image.getCropRect();

Viewport size

            heightPreview = binding.cameraView.getHeight(); //2274
            widthPreview = binding.cameraView.getWidth(); //1080

proxyImage size: 1280x960
viewport size: 2274x1080

I call image.getCropRect();

And we got the clipping rectangle:

Rect(
    bottom = 784,
    left = 0,
    right = 1280,
    top = 176
)

The red area is the clipping coordinates.

But these are not the right coords!

Right coords is (I calculated it on paper ):

Rect(
    bottom = 606,
    left = 0,
    right = 1280,
    top = 177
)

And right red border cropping area.

(The coords and example images may be in the wrong rotation)

Where I did a mistake to calc a right cropping coords?
What exactly does getCropRect() return?


问:
flutter pageviewbuilder and getting problem to get data from firebase
hello  am new to flutter
i want to show data (image and text ) of the pressed page in pageviewbuilder in new screen
here is my source secreen code  i want to get the current document so i can show same data to the next secreen

for example when user click on page , the same data he saw it on the page it will show on next secreen .

i got the data from firebase with int , but i am having problem to get the document to show it in my next secreen

```<code>import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
import 'package:tpottt/pages/la_plus_demande.dart';
import 'package:tpottt/pages/recomender_page.dart';
import 'package:tpottt/widgets/big_text.dart';
import 'package:tpottt/widgets/small_text.dart';
import '../tools/dimensions.dart';
import '../widgets/app_icon.dart';
import '../widgets/expandable_widget.dart';
import 'main_dental.dart';

class DentalPageBody extends StatefulWidget {
  const DentalPageBody({Key? key}) : super(key: key);

  @override
  State<DentalPageBody> createState() => _DentalPageBodyState();
}

class _DentalPageBodyState extends State<DentalPageBody> {

  CollectionReference productsref = FirebaseFirestore.instance.collection('products');
  CollectionReference recommandref = FirebaseFirestore.instance.collection('recommanded');

  PageController pageController = PageController(viewportFraction: 0.90);
  var _currPageValue = 0.0;

  double _scaleFactor = 0.8;

  double _height = 220;

  @override
  void initState() {

    super.initState();
    pageController.addListener(() {
      setState(() {
        _currPageValue = pageController.page!;
      });
    });
  }

  @override
  void dispose() {
    super.dispose();
    pageController.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        FutureBuilder(
            future: productsref.get(),
            builder:

            (context , snapshot){
              if(snapshot.hasData){
                return Container(
                  height: Dimensions.pageViewContainer,
                  child:
                  GestureDetector(
                    onTap: (){
                      Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){

                        return LaPlusDemande();
                      })) ;
                    },
                    child: PageView.builder(
                        controller: pageController,
                        itemCount: snapshot.data?.docs.length,
                        itemBuilder: (context, position) {
                          return _buildPageItem(position );

                        }),
                  ),
                );
              }return Center(child: CircularProgressIndicator());

        }),
         FutureBuilder(
             future: productsref.get(),
             builder: (context , snapshot){
               if(snapshot.hasData){
                 return  DotsIndicator(
                   dotsCount: snapshot.data!.docs.length,
                   position: _currPageValue,
                   decorator: DotsDecorator(
                     activeColor: Colors.blueGrey,
                     size: const Size.square(9.0),
                     activeSize: const Size(18.0, 9.0),
                     activeShape: RoundedRectangleBorder(
                         borderRadius: BorderRadius.circular(5.0)),
                   ),
                 );
               }
return Center(child: CircularProgressIndicator(),);
         }),
        SizedBox(
          height: Dimensions.pageViewContainer30,
        ),
        Container(
          child: BigText(text: "Les plus demandées"),
        ),
        FutureBuilder(
            future: recommandref.get(),
            builder: (context , snapshot){

          if(snapshot.hasData){
            return ListView.builder(
                shrinkWrap: true,
                physics: NeverScrollableScrollPhysics(),
                itemCount: snapshot.data?.docs.length,
                itemBuilder: (context, index) {
                var recommi =   snapshot.data?.docs[index].data() as Map ;
                  return
                    GestureDetector(
                      onTap: (){
                        Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
                          return RecommenderPage();
                        }));
                      },
                      child: Container(

                      margin: EdgeInsets.only(
                          left: Dimensions.pageViewContainer20,
                          bottom: Dimensions.pageViewContainer10,
                          right: Dimensions.pageViewContainer20),
                      child: Row(
                        children: [
                          Container(
                            height: Dimensions.pageViewContainer120,
                            width: Dimensions.pageViewContainer120,
                            decoration: BoxDecoration(

                                image: DecorationImage(
                                    fit: BoxFit.cover,
                                    image: NetworkImage(
                                        '${recommi['imageurl']}')),
                                borderRadius: BorderRadius.circular(
                                    Dimensions.pageViewContainer20)),
                          ),
                          Expanded(
                            child: Container(
                              child: SingleChildScrollView(
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                    BigText(text: '${recommi['titre']}'),
                                    SizedBox(
                                      height: Dimensions.pageViewContainer10,
                                    ),
                                    Padding(
                                      padding: EdgeInsets.only(
                                          left: Dimensions.pageViewContainer10),
                                      child: SmallText(
                                          text:
                                          '${recommi['desc']}'),
                                    )
                                  ],
                                ),
                              ),
                              height: Dimensions.pageViewContainer100,
                              decoration: BoxDecoration(
                                  color: Colors.white,
                                  borderRadius: BorderRadius.circular(
                                      Dimensions.pageViewContainer20)),
                            ),
                          )
                        ],
                      ),
                  ),
                    );
                });
          } return Center(child: CircularProgressIndicator());

        })
      ],
    );
  }

  Widget _buildPageItem(int index) {
    Matrix4 matrix = new Matrix4.identity();
    if (index == _currPageValue.floor()) {
      var currScale = 1 - (_currPageValue - index) * (1 - _scaleFactor);
      var currTrans = _height * (1 - currScale) / 2;
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, currTrans, 0);
    } else if (index == _currPageValue.floor() + 1) {
      var currScale =
          _scaleFactor + (_currPageValue - index + 1) * (1 - _scaleFactor);
      var currTrans = _height * (1 - currScale) / 2;

      matrix = Matrix4.diagonal3Values(1, currScale, 1);
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, currTrans, 0);
    } else if (index == _currPageValue.floor() - 1) {
      var currScale = 1 - (_currPageValue - index) * (1 - _scaleFactor);
      var currTrans = _height * (1 - currScale) / 2;

      matrix = Matrix4.diagonal3Values(1, currScale, 1);
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, currTrans, 0);
    } else {
      var currScale = 0.8;
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, _height * (1 - _scaleFactor) / 2, 0);
    }
    return Transform(
      transform: matrix,
      child: Stack(
        children: [
          FutureBuilder(
              future: productsref.get(),
              builder: (context , snapshot){
                if(snapshot.hasData){

                  var kal =  snapshot.data!.docs[index].data() as Map ;

                  return
                    GestureDetector(
                    onTap: (){
                      Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
                        return LaPlusDemande();
                      }));
                    },
                      child: Container(
                      margin: EdgeInsets.only(
                          left: Dimensions.pageViewContainer10,
                          right: Dimensions.pageViewContainer10),
                      height: Dimensions.pageViewContainer220,
                      decoration: BoxDecoration(
                          borderRadius:
                          BorderRadius.circular(Dimensions.pageViewContainer30),
                          image: DecorationImage(
                              fit: BoxFit.cover,
                              image: NetworkImage('${kal['imageurl']}'))),
                  ),
                    ) ;
                } return Center(child: CircularProgressIndicator());

          }),
          Align(
            alignment: Alignment.bottomCenter,
            child: Container(
              margin: EdgeInsets.only(
                  left: Dimensions.pageViewContainer50,
                  right: Dimensions.pageViewContainer50,
                  top: Dimensions.pageViewContainer180,
                  bottom: Dimensions.pageViewContainer30),
              height: Dimensions.pageViewContainer80,
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius:
                      BorderRadius.circular(Dimensions.pageViewContainer30),
                  boxShadow: [
                    BoxShadow(
                        color: Colors.blueGrey,
                        offset: Offset(1, 1),
                        blurRadius: 5)
                  ]),
              child: Center(child: FutureBuilder(
                  future: productsref.get(),
                  builder:

                  (context, snapshot){
                if(snapshot.hasData){
                 var kal =  snapshot.data!.docs[index].data() as Map ;
                  return SmallText(text: '${kal['titre']}');
                } return CircularProgressIndicator();
              })),
            ),
          ),
        ],
      ),
    );
  }
}

</code>```

and this is the next secreen where i get null result

```<code>
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:tpottt/home/main_dental.dart';
import 'package:tpottt/tools/dimensions.dart';
import 'package:tpottt/widgets/app_icon.dart';
import 'package:tpottt/widgets/big_text.dart';
import '../widgets/expandable_widget.dart';

class LaPlusDemande extends StatelessWidget {

   const  LaPlusDemande( {Key? key  }) : super(key: key);

  @override
  Widget build(BuildContext context  ) {
    CollectionReference productsref = FirebaseFirestore.instance.collection('products');

    return Scaffold(
      body: Stack(
        children: [
          Positioned(
              left: 0,
              right: 0,
              child:Container(
                width: double.maxFinite,
                height: Dimensions.pageViewContainer350,
                decoration: BoxDecoration(
                    image: DecorationImage(
                        fit: BoxFit.cover,
                        image: AssetImage('assets/images/prothesetotal.jpg'))),
              )),
          Positioned(
              top: Dimensions.pageViewContainer45,
              left: Dimensions.pageViewContainer20,
              right: Dimensions.pageViewContainer20,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  GestureDetector(
                  onTap: (){
                    Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){

                      return MainDentalPage();
                    }));
          },
                  child: AppIcon(iconData: Icons.arrow_back_ios)),
                  AppIcon(iconData: Icons.shopping_cart_outlined)
                ],
              )),
          Positioned(
              bottom: 0,
              left: 0,
              right: 0,
              top: Dimensions.pageViewContainer350 -
                  Dimensions.pageViewContainer20,
              child: Container(
                padding: EdgeInsets.only(
                    left: Dimensions.pageViewContainer20,
                    right: Dimensions.pageViewContainer20,
                    top: Dimensions.pageViewContainer20),
                decoration: BoxDecoration(
                    borderRadius: BorderRadius.only(
                        topRight: Radius.circular(
                          Dimensions.pageViewContainer20,
                        ),
                        topLeft:
                            Radius.circular(Dimensions.pageViewContainer20)),
                    color: Colors.white),
                child:
                SingleChildScrollView(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      FutureBuilder(

                          future: productsref.get(),
                          builder: (context , snapshot){
                      if(snapshot.hasData){
                   var query =   snapshot.data!.docs.asMap();
print(query['titre']);
                        return BigText(text: '${query['titre']}');
                      }return Center(child: CircularProgressIndicator());
                      }) ,
                    SizedBox(height: Dimensions.pageViewContainer16,),
                    BigText(text: 'Introduction') ,
                      SizedBox(height: Dimensions.pageViewContainer16,),
                      ExpandableTextWidget( text: "hello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmd hello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmd")
                    ],
                  ),
                ),
              )),
        ],
      ),
      bottomNavigationBar: Container(
        height: Dimensions.pageViewContainer120,
        padding: EdgeInsets.only(
            top: Dimensions.pageViewContainer30,
            bottom: Dimensions.pageViewContainer30,
            left: Dimensions.pageViewContainer20,
            right: Dimensions.pageViewContainer20),
        decoration: BoxDecoration(
            color: Colors.black12,
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(Dimensions.pageViewContainer20 * 2),
                topRight: Radius.circular(Dimensions.pageViewContainer20 * 2))),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Container(
              padding: EdgeInsets.only(
                  top: Dimensions.pageViewContainer16,
                  bottom: Dimensions.pageViewContainer20,
                  left: Dimensions.pageViewContainer20,
                  right: Dimensions.pageViewContainer20),
              decoration: BoxDecoration(
                  borderRadius:
                      BorderRadius.circular(Dimensions.pageViewContainer20),
                  color: Colors.white),
              child: Row(
                children: [
                  Icon(
                    Icons.remove,
                    color: Colors.black,
                  ),
                  SizedBox(
                    width: Dimensions.pageViewContainer16,
                  ),
                  BigText(text: '0'),
                  SizedBox(
                    width: Dimensions.pageViewContainer16,
                  ),
                  Icon(
                    Icons.add,
                    color: Colors.black,
                  )
                ],
              ),
            ),
            Container(
                padding: EdgeInsets.only(
                    top: Dimensions.pageViewContainer20,
                    bottom: Dimensions.pageViewContainer20,
                    left: Dimensions.pageViewContainer20,
                    right: Dimensions.pageViewContainer20),
                decoration: BoxDecoration(
                  color: Colors.lightBlue,
                  borderRadius:
                      BorderRadius.circular(Dimensions.pageViewContainer20),
                ),
                child: Text(
                  '100DA | Ajoutez au panier ',
                  style: TextStyle(fontSize: Dimensions.pageViewContainer10),
                ))
          ],
        ),
      ),
    );
  }
}

</code>```

i hope u can help me

Body:
hello  am new to flutter
i want to show data (image and text ) of the pressed page in pageviewbuilder in new screen
here is my source secreen code  i want to get the current document so i can show same data to the next secreen

for example when user click on page , the same data he saw it on the page it will show on next secreen .

i got the data from firebase with int , but i am having problem to get the document to show it in my next secreen

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
import 'package:tpottt/pages/la_plus_demande.dart';
import 'package:tpottt/pages/recomender_page.dart';
import 'package:tpottt/widgets/big_text.dart';
import 'package:tpottt/widgets/small_text.dart';
import '../tools/dimensions.dart';
import '../widgets/app_icon.dart';
import '../widgets/expandable_widget.dart';
import 'main_dental.dart';

class DentalPageBody extends StatefulWidget {
  const DentalPageBody({Key? key}) : super(key: key);

  @override
  State<DentalPageBody> createState() => _DentalPageBodyState();
}

class _DentalPageBodyState extends State<DentalPageBody> {

  CollectionReference productsref = FirebaseFirestore.instance.collection('products');
  CollectionReference recommandref = FirebaseFirestore.instance.collection('recommanded');

  PageController pageController = PageController(viewportFraction: 0.90);
  var _currPageValue = 0.0;

  double _scaleFactor = 0.8;

  double _height = 220;

  @override
  void initState() {

    super.initState();
    pageController.addListener(() {
      setState(() {
        _currPageValue = pageController.page!;
      });
    });
  }

  @override
  void dispose() {
    super.dispose();
    pageController.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        FutureBuilder(
            future: productsref.get(),
            builder:

            (context , snapshot){
              if(snapshot.hasData){
                return Container(
                  height: Dimensions.pageViewContainer,
                  child:
                  GestureDetector(
                    onTap: (){
                      Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){

                        return LaPlusDemande();
                      })) ;
                    },
                    child: PageView.builder(
                        controller: pageController,
                        itemCount: snapshot.data?.docs.length,
                        itemBuilder: (context, position) {
                          return _buildPageItem(position );

                        }),
                  ),
                );
              }return Center(child: CircularProgressIndicator());

        }),
         FutureBuilder(
             future: productsref.get(),
             builder: (context , snapshot){
               if(snapshot.hasData){
                 return  DotsIndicator(
                   dotsCount: snapshot.data!.docs.length,
                   position: _currPageValue,
                   decorator: DotsDecorator(
                     activeColor: Colors.blueGrey,
                     size: const Size.square(9.0),
                     activeSize: const Size(18.0, 9.0),
                     activeShape: RoundedRectangleBorder(
                         borderRadius: BorderRadius.circular(5.0)),
                   ),
                 );
               }
return Center(child: CircularProgressIndicator(),);
         }),
        SizedBox(
          height: Dimensions.pageViewContainer30,
        ),
        Container(
          child: BigText(text: "Les plus demandées"),
        ),
        FutureBuilder(
            future: recommandref.get(),
            builder: (context , snapshot){

          if(snapshot.hasData){
            return ListView.builder(
                shrinkWrap: true,
                physics: NeverScrollableScrollPhysics(),
                itemCount: snapshot.data?.docs.length,
                itemBuilder: (context, index) {
                var recommi =   snapshot.data?.docs[index].data() as Map ;
                  return
                    GestureDetector(
                      onTap: (){
                        Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
                          return RecommenderPage();
                        }));
                      },
                      child: Container(

                      margin: EdgeInsets.only(
                          left: Dimensions.pageViewContainer20,
                          bottom: Dimensions.pageViewContainer10,
                          right: Dimensions.pageViewContainer20),
                      child: Row(
                        children: [
                          Container(
                            height: Dimensions.pageViewContainer120,
                            width: Dimensions.pageViewContainer120,
                            decoration: BoxDecoration(

                                image: DecorationImage(
                                    fit: BoxFit.cover,
                                    image: NetworkImage(
                                        '${recommi['imageurl']}')),
                                borderRadius: BorderRadius.circular(
                                    Dimensions.pageViewContainer20)),
                          ),
                          Expanded(
                            child: Container(
                              child: SingleChildScrollView(
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                    BigText(text: '${recommi['titre']}'),
                                    SizedBox(
                                      height: Dimensions.pageViewContainer10,
                                    ),
                                    Padding(
                                      padding: EdgeInsets.only(
                                          left: Dimensions.pageViewContainer10),
                                      child: SmallText(
                                          text:
                                          '${recommi['desc']}'),
                                    )
                                  ],
                                ),
                              ),
                              height: Dimensions.pageViewContainer100,
                              decoration: BoxDecoration(
                                  color: Colors.white,
                                  borderRadius: BorderRadius.circular(
                                      Dimensions.pageViewContainer20)),
                            ),
                          )
                        ],
                      ),
                  ),
                    );
                });
          } return Center(child: CircularProgressIndicator());

        })
      ],
    );
  }

  Widget _buildPageItem(int index) {
    Matrix4 matrix = new Matrix4.identity();
    if (index == _currPageValue.floor()) {
      var currScale = 1 - (_currPageValue - index) * (1 - _scaleFactor);
      var currTrans = _height * (1 - currScale) / 2;
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, currTrans, 0);
    } else if (index == _currPageValue.floor() + 1) {
      var currScale =
          _scaleFactor + (_currPageValue - index + 1) * (1 - _scaleFactor);
      var currTrans = _height * (1 - currScale) / 2;

      matrix = Matrix4.diagonal3Values(1, currScale, 1);
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, currTrans, 0);
    } else if (index == _currPageValue.floor() - 1) {
      var currScale = 1 - (_currPageValue - index) * (1 - _scaleFactor);
      var currTrans = _height * (1 - currScale) / 2;

      matrix = Matrix4.diagonal3Values(1, currScale, 1);
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, currTrans, 0);
    } else {
      var currScale = 0.8;
      matrix = Matrix4.diagonal3Values(1, currScale, 1)
        ..setTranslationRaw(0, _height * (1 - _scaleFactor) / 2, 0);
    }
    return Transform(
      transform: matrix,
      child: Stack(
        children: [
          FutureBuilder(
              future: productsref.get(),
              builder: (context , snapshot){
                if(snapshot.hasData){

                  var kal =  snapshot.data!.docs[index].data() as Map ;

                  return
                    GestureDetector(
                    onTap: (){
                      Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){
                        return LaPlusDemande();
                      }));
                    },
                      child: Container(
                      margin: EdgeInsets.only(
                          left: Dimensions.pageViewContainer10,
                          right: Dimensions.pageViewContainer10),
                      height: Dimensions.pageViewContainer220,
                      decoration: BoxDecoration(
                          borderRadius:
                          BorderRadius.circular(Dimensions.pageViewContainer30),
                          image: DecorationImage(
                              fit: BoxFit.cover,
                              image: NetworkImage('${kal['imageurl']}'))),
                  ),
                    ) ;
                } return Center(child: CircularProgressIndicator());

          }),
          Align(
            alignment: Alignment.bottomCenter,
            child: Container(
              margin: EdgeInsets.only(
                  left: Dimensions.pageViewContainer50,
                  right: Dimensions.pageViewContainer50,
                  top: Dimensions.pageViewContainer180,
                  bottom: Dimensions.pageViewContainer30),
              height: Dimensions.pageViewContainer80,
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius:
                      BorderRadius.circular(Dimensions.pageViewContainer30),
                  boxShadow: [
                    BoxShadow(
                        color: Colors.blueGrey,
                        offset: Offset(1, 1),
                        blurRadius: 5)
                  ]),
              child: Center(child: FutureBuilder(
                  future: productsref.get(),
                  builder:

                  (context, snapshot){
                if(snapshot.hasData){
                 var kal =  snapshot.data!.docs[index].data() as Map ;
                  return SmallText(text: '${kal['titre']}');
                } return CircularProgressIndicator();
              })),
            ),
          ),
        ],
      ),
    );
  }
}

and this is the next secreen where i get null result

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:tpottt/home/main_dental.dart';
import 'package:tpottt/tools/dimensions.dart';
import 'package:tpottt/widgets/app_icon.dart';
import 'package:tpottt/widgets/big_text.dart';
import '../widgets/expandable_widget.dart';

class LaPlusDemande extends StatelessWidget {

   const  LaPlusDemande( {Key? key  }) : super(key: key);

  @override
  Widget build(BuildContext context  ) {
    CollectionReference productsref = FirebaseFirestore.instance.collection('products');

    return Scaffold(
      body: Stack(
        children: [
          Positioned(
              left: 0,
              right: 0,
              child:Container(
                width: double.maxFinite,
                height: Dimensions.pageViewContainer350,
                decoration: BoxDecoration(
                    image: DecorationImage(
                        fit: BoxFit.cover,
                        image: AssetImage('assets/images/prothesetotal.jpg'))),
              )),
          Positioned(
              top: Dimensions.pageViewContainer45,
              left: Dimensions.pageViewContainer20,
              right: Dimensions.pageViewContainer20,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  GestureDetector(
                  onTap: (){
                    Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context){

                      return MainDentalPage();
                    }));
          },
                  child: AppIcon(iconData: Icons.arrow_back_ios)),
                  AppIcon(iconData: Icons.shopping_cart_outlined)
                ],
              )),
          Positioned(
              bottom: 0,
              left: 0,
              right: 0,
              top: Dimensions.pageViewContainer350 -
                  Dimensions.pageViewContainer20,
              child: Container(
                padding: EdgeInsets.only(
                    left: Dimensions.pageViewContainer20,
                    right: Dimensions.pageViewContainer20,
                    top: Dimensions.pageViewContainer20),
                decoration: BoxDecoration(
                    borderRadius: BorderRadius.only(
                        topRight: Radius.circular(
                          Dimensions.pageViewContainer20,
                        ),
                        topLeft:
                            Radius.circular(Dimensions.pageViewContainer20)),
                    color: Colors.white),
                child:
                SingleChildScrollView(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      FutureBuilder(

                          future: productsref.get(),
                          builder: (context , snapshot){
                      if(snapshot.hasData){
                   var query =   snapshot.data!.docs.asMap();
print(query['titre']);
                        return BigText(text: '${query['titre']}');
                      }return Center(child: CircularProgressIndicator());
                      }) ,
                    SizedBox(height: Dimensions.pageViewContainer16,),
                    BigText(text: 'Introduction') ,
                      SizedBox(height: Dimensions.pageViewContainer16,),
                      ExpandableTextWidget( text: "hello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmd hello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmdhello how are you mdlf mdgm ldfkgmldfkgmldfk gmfdlk gmdfl kgmd")
                    ],
                  ),
                ),
              )),
        ],
      ),
      bottomNavigationBar: Container(
        height: Dimensions.pageViewContainer120,
        padding: EdgeInsets.only(
            top: Dimensions.pageViewContainer30,
            bottom: Dimensions.pageViewContainer30,
            left: Dimensions.pageViewContainer20,
            right: Dimensions.pageViewContainer20),
        decoration: BoxDecoration(
            color: Colors.black12,
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(Dimensions.pageViewContainer20 * 2),
                topRight: Radius.circular(Dimensions.pageViewContainer20 * 2))),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Container(
              padding: EdgeInsets.only(
                  top: Dimensions.pageViewContainer16,
                  bottom: Dimensions.pageViewContainer20,
                  left: Dimensions.pageViewContainer20,
                  right: Dimensions.pageViewContainer20),
              decoration: BoxDecoration(
                  borderRadius:
                      BorderRadius.circular(Dimensions.pageViewContainer20),
                  color: Colors.white),
              child: Row(
                children: [
                  Icon(
                    Icons.remove,
                    color: Colors.black,
                  ),
                  SizedBox(
                    width: Dimensions.pageViewContainer16,
                  ),
                  BigText(text: '0'),
                  SizedBox(
                    width: Dimensions.pageViewContainer16,
                  ),
                  Icon(
                    Icons.add,
                    color: Colors.black,
                  )
                ],
              ),
            ),
            Container(
                padding: EdgeInsets.only(
                    top: Dimensions.pageViewContainer20,
                    bottom: Dimensions.pageViewContainer20,
                    left: Dimensions.pageViewContainer20,
                    right: Dimensions.pageViewContainer20),
                decoration: BoxDecoration(
                  color: Colors.lightBlue,
                  borderRadius:
                      BorderRadius.circular(Dimensions.pageViewContainer20),
                ),
                child: Text(
                  '100DA | Ajoutez au panier ',
                  style: TextStyle(fontSize: Dimensions.pageViewContainer10),
                ))
          ],
        ),
      ),
    );
  }
}

i hope u can help me


问:
How can i animate data fetched from API in my ScrollView/LazyVGrid?
This is my main view where i'm using AsyncAwait to fetch the data. I wanna have the effect of nice animation when i receive the data. Tried a lot of things, but none worked. Some animations were successful but only after opening the specific view for the 3-rd + time. On first opening i could never achieve that effect. Would really appreciate if someone could tell me what should i do. Thanks in advance :)</p>
```<code>struct PresentationRootView: View {
    // setting up the default value for segmented control
    @State private var selectedSegmentedOption: SegmentedSelection = .myPresentations
    @ObservedObject var viewModel: PresentationsViewModel

    var body: some View {
        let columns =  [GridItem(.flexible())]

        VStack(spacing: 0) {
            Picker(selection: $selectedSegmentedOption) {
                Text("My Presentations").tag(SegmentedSelection.myPresentations)
                Text("Templates").tag(SegmentedSelection.templates)
            } label: {}
                .pickerStyle(.segmented)
        }
        ScrollView {
            if selectedSegmentedOption == .myPresentations {
                if viewModel.shouldShowEmptyScreen {
                    Text("No data")
                }

                LazyVGrid(columns: columns, spacing: 4, content: {
                    ForEach($viewModel.myPresentations, id: \.ID) { element in
                        PresentationSingleView(url: element.ThumbURLWithSas.wrappedValue, title: element.Name.wrappedValue, numberOfResources: 4)
                            .padding([.leading, .trailing], 13)
                    }
                }).task {
                    await viewModel.getAllPresentations(page: 1, pageSize: 10)
                }
            }
        }
        .background(CustomColor.background.swiftUIColor)
        Spacer()
        .navigationTitle("Presentations")
    }
}
</code>```
```<code>struct PresentationSingleView: View {
    // replace this with the real data
    var url: URL
    var title: String
    var numberOfResources: Int
    var isIphone = DefaultAppManager.shared.isIphone
    @StateObject var image = FetchImage()

    var body: some View {
        HStack(alignment: .top) {

                image.view?
                    .resizable()
                    .scaledToFill()
                    .frame(maxWidth: isIphone ? 90 : 140, maxHeight: isIphone ? 64 : 140)
                    .cornerRadius(4)

                    .padding(isIphone ? 10 : 20)

            VStack(alignment: .leading) {
                Text(title)
                    .font(Font.custom("Roboto-Regular", size: 12))
                    .padding(.top, 20)
                Spacer()
                HStack(alignment: .center) {
                    Image("presentationResourceIcon")
                    Text("\(numberOfResources) resources")
                        .font(Font.custom("Roboto-Medium", size: 12))
                    Spacer()
                    Image("more_options")
                        .onTapGesture {
                            print("tapped on right image!!!")
                        }

                }
                .padding(.bottom, 20)
            }
            Spacer()
        }

        .onAppear {
            image.priority = .normal
            image.load(url)
        }

        .frame(height: isIphone ? 90 : 150)
        .background(Color.white)
        .cornerRadius(8)
    }
}
</code>```

Body:
This is my main view where i'm using AsyncAwait to fetch the data. I wanna have the effect of nice animation when i receive the data. Tried a lot of things, but none worked. Some animations were successful but only after opening the specific view for the 3-rd + time. On first opening i could never achieve that effect. Would really appreciate if someone could tell me what should i do. Thanks in advance :)

struct PresentationRootView: View {
    // setting up the default value for segmented control
    @State private var selectedSegmentedOption: SegmentedSelection = .myPresentations
    @ObservedObject var viewModel: PresentationsViewModel

    var body: some View {
        let columns =  [GridItem(.flexible())]

        VStack(spacing: 0) {
            Picker(selection: $selectedSegmentedOption) {
                Text("My Presentations").tag(SegmentedSelection.myPresentations)
                Text("Templates").tag(SegmentedSelection.templates)
            } label: {}
                .pickerStyle(.segmented)
        }
        ScrollView {
            if selectedSegmentedOption == .myPresentations {
                if viewModel.shouldShowEmptyScreen {
                    Text("No data")
                }

                LazyVGrid(columns: columns, spacing: 4, content: {
                    ForEach($viewModel.myPresentations, id: \.ID) { element in
                        PresentationSingleView(url: element.ThumbURLWithSas.wrappedValue, title: element.Name.wrappedValue, numberOfResources: 4)
                            .padding([.leading, .trailing], 13)
                    }
                }).task {
                    await viewModel.getAllPresentations(page: 1, pageSize: 10)
                }
            }
        }
        .background(CustomColor.background.swiftUIColor)
        Spacer()
        .navigationTitle("Presentations")
    }
}

struct PresentationSingleView: View {
    // replace this with the real data
    var url: URL
    var title: String
    var numberOfResources: Int
    var isIphone = DefaultAppManager.shared.isIphone
    @StateObject var image = FetchImage()

    var body: some View {
        HStack(alignment: .top) {

                image.view?
                    .resizable()
                    .scaledToFill()
                    .frame(maxWidth: isIphone ? 90 : 140, maxHeight: isIphone ? 64 : 140)
                    .cornerRadius(4)

                    .padding(isIphone ? 10 : 20)

            VStack(alignment: .leading) {
                Text(title)
                    .font(Font.custom("Roboto-Regular", size: 12))
                    .padding(.top, 20)
                Spacer()
                HStack(alignment: .center) {
                    Image("presentationResourceIcon")
                    Text("\(numberOfResources) resources")
                        .font(Font.custom("Roboto-Medium", size: 12))
                    Spacer()
                    Image("more_options")
                        .onTapGesture {
                            print("tapped on right image!!!")
                        }

                }
                .padding(.bottom, 20)
            }
            Spacer()
        }

        .onAppear {
            image.priority = .normal
            image.load(url)
        }

        .frame(height: isIphone ? 90 : 150)
        .background(Color.white)
        .cornerRadius(8)
    }
}


问:
Pyplot modifies zoom when calling plt.draw()
I wrote a function that lets the user pick points from an image and returns the coordinates.

```<code>fig, ax = plt.subplots()
ax.imshow(pixel_array, cmap=plt.cm.hot)
plt.ion()
plt.show()
coords = get_points(fig, ax, 4)
</code>```

where the function get_points is defined as

```<code>def get_points(fig, ax, n):
    # Request the user to select n points in the figure fig on the axis ax
    # If n is zero or negative, allow the selection of as many points as the user would like (minimum abs(n))
    # If n is positive, allow only n points to be selected
    if n > 0:
        print('Select', n, 'points.')
    elif n < 0:
        print('Select at least', abs(n), 'points.')
    else:
        print('Select any number of points.')
    print("Press 'Esc' to cancel the last point, or 'Enter' when complete.")
    coords = []
    handles = []
    finished = False
    def onClick(event):
        nonlocal coords
        if fig.canvas.manager.toolbar.mode != '': return # Don't take clicks involved in toolbar functions (pan, zoom, ...)
        if event.inaxes!=ax: return # Don't take clicks outside the axes
        if len(coords) < n or n <= 0:
            coords.append((event.xdata, event.ydata))
            handles.append(plt.scatter(event.xdata, event.ydata, s=100, c='red', marker='+'))
            plt.draw()
        else:
            print('You have reached the maximum number of points for this operation.')
    def onKey(event):
        nonlocal finished
        if event.key == 'escape':
            if len(coords) > 0:
                del coords[-1]
                handles[-1].remove()
                del handles[-1]
                plt.draw()
        elif event.key == 'enter':
            if len(coords) >= abs(n):
                finished = True
            else:
                print('You have selected', len(coords), 'out of a required', n, 'points.')
        else:
            print('You pressed "', event.key, '" which is unsupported', sep='')
    cid = fig.canvas.mpl_connect('button_press_event', onClick)
    cid2 = fig.canvas.mpl_connect('key_press_event',onKey)
    while not finished:
        plt.waitforbuttonpress(-1)
    plt.disconnect(cid)
    plt.disconnect(cid2)
    return np.array(coords)
</code>```

But the problem is that if I zoom or pan, then each time I select a point it resets the zoom/pan to the default.  Is there any way to have it not do this?  Is there a better way to do this overall?

Thanks in advance.

Body:
I wrote a function that lets the user pick points from an image and returns the coordinates.

fig, ax = plt.subplots()
ax.imshow(pixel_array, cmap=plt.cm.hot)
plt.ion()
plt.show()
coords = get_points(fig, ax, 4)

where the function get_points is defined as

def get_points(fig, ax, n):
    # Request the user to select n points in the figure fig on the axis ax
    # If n is zero or negative, allow the selection of as many points as the user would like (minimum abs(n))
    # If n is positive, allow only n points to be selected
    if n > 0:
        print('Select', n, 'points.')
    elif n < 0:
        print('Select at least', abs(n), 'points.')
    else:
        print('Select any number of points.')
    print("Press 'Esc' to cancel the last point, or 'Enter' when complete.")
    coords = []
    handles = []
    finished = False
    def onClick(event):
        nonlocal coords
        if fig.canvas.manager.toolbar.mode != '': return # Don't take clicks involved in toolbar functions (pan, zoom, ...)
        if event.inaxes!=ax: return # Don't take clicks outside the axes
        if len(coords) < n or n <= 0:
            coords.append((event.xdata, event.ydata))
            handles.append(plt.scatter(event.xdata, event.ydata, s=100, c='red', marker='+'))
            plt.draw()
        else:
            print('You have reached the maximum number of points for this operation.')
    def onKey(event):
        nonlocal finished
        if event.key == 'escape':
            if len(coords) > 0:
                del coords[-1]
                handles[-1].remove()
                del handles[-1]
                plt.draw()
        elif event.key == 'enter':
            if len(coords) >= abs(n):
                finished = True
            else:
                print('You have selected', len(coords), 'out of a required', n, 'points.')
        else:
            print('You pressed "', event.key, '" which is unsupported', sep='')
    cid = fig.canvas.mpl_connect('button_press_event', onClick)
    cid2 = fig.canvas.mpl_connect('key_press_event',onKey)
    while not finished:
        plt.waitforbuttonpress(-1)
    plt.disconnect(cid)
    plt.disconnect(cid2)
    return np.array(coords)

But the problem is that if I zoom or pan, then each time I select a point it resets the zoom/pan to the default.  Is there any way to have it not do this?  Is there a better way to do this overall?

Thanks in advance.


问:
Unable to connect Oracle ODI Marketplace to mysql embedded repository
i'm starting using Oracle ODI Marketplace. I've just deployed an instance on a VM in Oracle Cloud, by choosing the solution with the embedded mysql repository.

Now the problem is that when i start executing ODI i'm not able to connect ODI studio to mysql repository because i don't know/find the credentials needed to connect.
I've read the documentation but it is not so detailed about that.
i would really appreciate if you could help me

Thank you


问:
No matching package found (Docker + Rust)
I'm attempting to compile a Rust project in Docker and it's being frustrating. As far as I can tell it should be incredibly straightforward, but for some reason Docker can't find the Rust package.

Here's the Dockerfile:

```<code>FROM rust:1.6.1
COPY . .
RUN cargo build --release
CMD ["./run.sh"]
</code>```

Here's the Cargo.toml:

```<code>[package]
name = "project1_1"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
utility = { path = "./src/utility" }
iced = "0.6.0"
iced_native = "0.4"
iced_style = "0.5"
iced_core = "0.5"
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1", features = ["full"] }
webassembly = "0.8"
wry = "0.23.4"
</code>```

And here's the output:

```<code>peterweyand@Peters-MacBook-Pro project1_1 % ./dockerrun.sh
2022/12/15 16:04:06 must use ASL logging (which requires CGO) if running as root
Sending build context to Docker daemon  1.351GB
Step 1/4 : FROM rust:1.6.1
manifest for rust:1.6.1 not found: manifest unknown: manifest unknown
    Updating git repository `https://github.com/iced-rs/iced`
    Updating crates.io index
error: no matching package found
searched package name: `iced`
perhaps you meant:      cached
location searched: https://github.com/iced-rs/iced
required by package `project1_1 v0.1.0 (/)`
</code>```

If instead of FROM rust:1.6.1 I use FROM rust:latest then Docker hangs like this:

```<code>peterweyand@Peters-MacBook-Pro project1_1 % ./dockerrun.sh
2022/12/15 16:08:18 must use ASL logging (which requires CGO) if running as root
Sending build context to Docker daemon  1.351GB
Step 1/4 : FROM rust:latest
 ---> 7767cd0ef4e0
Step 2/4 : COPY . .
 ---> 356cfb7caed9
Step 3/4 : RUN cargo build --release
 ---> Running in 87dbc6c86df9
    Updating crates.io index
</code>```

Does anyone have any ideas of what is going wrong?

EDIT: I usually suck at Docker because there are several ways of doing the same thing.

I tried this

```<code>FROM rust:1.66-alpine
WORKDIR /
COPY . .
RUN cargo install --path .
RUN apk add alpine-sdk # This one is necessary for linking cc.
COPY ./src/backend/Cargo.toml ./src/backend/Cargo.lock ./
RUN cargo build --release
CMD ["./run.sh"]
</code>```

and it gave this output -

```<code>   Compiling libloading v0.7.4
   Compiling lock_api v0.4.9
   Compiling parking_lot_core v0.9.5
   Compiling toml v0.5.10
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling parking_lot v0.12.1
   Compiling anyhow v1.0.66
   Compiling system-deps v6.0.3
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,--version-script=/tmp/rustc2quFlR/list" "/tmp/rustc2quFlR/symbols.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.0.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.1.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.10.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.11.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.12.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.13.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.14.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.15.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.2.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.3.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.4.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.5.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.6.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.7.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.8.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.9.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.2venke7z0qwetnto.rcgu.rmeta" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.2bt08o7nuxqqfzig.rcgu.o" "-Wl,--as-needed" "-L" "/target/release/deps" "-L" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/target/release/deps/libquote-a78ece94a3329b46.rlib" "/target/release/deps/libproc_macro2-3f4d87b0b9f5c5f5.rlib" "/target/release/deps/libunicode_ident-5c658c6e9005d30d.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libproc_macro-16667debc3013ce2.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd-19bcd24d54b4a32c.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libpanic_unwind-3814851f75d61802.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libobject-5007cbad366e7f54.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libmemchr-c7fe0e6a7e22626a.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libaddr2line-cdbb9a3725d71a8c.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libgimli-ad66f8ef705486ae.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_demangle-775cf8425902e89f.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd_detect-d09dc442a73afb02.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-508c53ad79acc8ea.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libhashbrown-ac7c150ef5940f2b.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libminiz_oxide-d2c5dbbafb505b02.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libadler-fa394ecd0326b64a.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_alloc-d36cf05357e3b9d8.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libunwind-32953872cd386e07.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-e844973f6e14767e.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liblibc-2f732132bffc407e.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liballoc-e0c40e7f51c7608f.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_core-3dc8593378fc4be9.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcore-d31b035ed558dec3.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-2b952fa9bf703518.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-o" "/target/release/deps/libproc_macro_error_attr-4660f50c1ee088e6.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
          collect2: error: ld returned 1 exit status

error: could not compile `proc-macro-error-attr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `project1_1 v0.1.0 (/)`, intermediate artifacts can be found at `/target`
The command '/bin/sh -c cargo install --path .' returned a non-zero code: 101
Unable to find image 'my-rust-app:latest' locally
2022/12/15 17:31:02 must use ASL logging (which requires CGO) if running as root
docker: Error response from daemon: pull access denied for my-rust-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
</code>```

And I also tried this -

```<code>FROM ubuntu:latest
WORKDIR /
COPY . .
RUN apt-get update
RUN apt-get install protobuf-compiler openssl pkg-config libssl-dev rustc cmake cargo -y
RUN rustc -V
CMD ["./run.sh"]
</code>```

But still ran into problems compiling dependencies that relied on C.

So, my question at this point is "What is the easiest way of getting a rust program to run with a standard list of dependencies?" The hello world examples don't cut it for any Rust program that has a large crate stack.

Thanks.

Body:
I'm attempting to compile a Rust project in Docker and it's being frustrating. As far as I can tell it should be incredibly straightforward, but for some reason Docker can't find the Rust package.

Here's the Dockerfile:

FROM rust:1.6.1
COPY . .
RUN cargo build --release
CMD ["./run.sh"]

Here's the Cargo.toml:

[package]
name = "project1_1"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
utility = { path = "./src/utility" }
iced = "0.6.0"
iced_native = "0.4"
iced_style = "0.5"
iced_core = "0.5"
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1", features = ["full"] }
webassembly = "0.8"
wry = "0.23.4"

And here's the output:

peterweyand@Peters-MacBook-Pro project1_1 % ./dockerrun.sh
2022/12/15 16:04:06 must use ASL logging (which requires CGO) if running as root
Sending build context to Docker daemon  1.351GB
Step 1/4 : FROM rust:1.6.1
manifest for rust:1.6.1 not found: manifest unknown: manifest unknown
    Updating git repository `https://github.com/iced-rs/iced`
    Updating crates.io index
error: no matching package found
searched package name: `iced`
perhaps you meant:      cached
location searched: https://github.com/iced-rs/iced
required by package `project1_1 v0.1.0 (/)`

If instead of FROM rust:1.6.1 I use FROM rust:latest then Docker hangs like this:

peterweyand@Peters-MacBook-Pro project1_1 % ./dockerrun.sh
2022/12/15 16:08:18 must use ASL logging (which requires CGO) if running as root
Sending build context to Docker daemon  1.351GB
Step 1/4 : FROM rust:latest
 ---> 7767cd0ef4e0
Step 2/4 : COPY . .
 ---> 356cfb7caed9
Step 3/4 : RUN cargo build --release
 ---> Running in 87dbc6c86df9
    Updating crates.io index

Does anyone have any ideas of what is going wrong?

EDIT: I usually suck at Docker because there are several ways of doing the same thing.

I tried this

FROM rust:1.66-alpine
WORKDIR /
COPY . .
RUN cargo install --path .
RUN apk add alpine-sdk # This one is necessary for linking cc.
COPY ./src/backend/Cargo.toml ./src/backend/Cargo.lock ./
RUN cargo build --release
CMD ["./run.sh"]

and it gave this output -

   Compiling libloading v0.7.4
   Compiling lock_api v0.4.9
   Compiling parking_lot_core v0.9.5
   Compiling toml v0.5.10
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling parking_lot v0.12.1
   Compiling anyhow v1.0.66
   Compiling system-deps v6.0.3
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,--version-script=/tmp/rustc2quFlR/list" "/tmp/rustc2quFlR/symbols.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.0.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.1.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.10.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.11.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.12.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.13.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.14.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.15.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.2.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.3.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.4.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.5.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.6.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.7.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.8.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.proc_macro_error_attr.1df7e329-cgu.9.rcgu.o" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.2venke7z0qwetnto.rcgu.rmeta" "/target/release/deps/proc_macro_error_attr-4660f50c1ee088e6.2bt08o7nuxqqfzig.rcgu.o" "-Wl,--as-needed" "-L" "/target/release/deps" "-L" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-Wl,-Bstatic" "/target/release/deps/libquote-a78ece94a3329b46.rlib" "/target/release/deps/libproc_macro2-3f4d87b0b9f5c5f5.rlib" "/target/release/deps/libunicode_ident-5c658c6e9005d30d.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libproc_macro-16667debc3013ce2.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd-19bcd24d54b4a32c.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libpanic_unwind-3814851f75d61802.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libobject-5007cbad366e7f54.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libmemchr-c7fe0e6a7e22626a.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libaddr2line-cdbb9a3725d71a8c.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libgimli-ad66f8ef705486ae.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_demangle-775cf8425902e89f.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libstd_detect-d09dc442a73afb02.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-508c53ad79acc8ea.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libhashbrown-ac7c150ef5940f2b.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libminiz_oxide-d2c5dbbafb505b02.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libadler-fa394ecd0326b64a.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_alloc-d36cf05357e3b9d8.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libunwind-32953872cd386e07.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcfg_if-e844973f6e14767e.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liblibc-2f732132bffc407e.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/liballoc-e0c40e7f51c7608f.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/librustc_std_workspace_core-3dc8593378fc4be9.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcore-d31b035ed558dec3.rlib" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib/libcompiler_builtins-2b952fa9bf703518.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/usr/local/rustup/toolchains/1.66.0-aarch64-unknown-linux-musl/lib/rustlib/aarch64-unknown-linux-musl/lib" "-o" "/target/release/deps/libproc_macro_error_attr-4660f50c1ee088e6.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: /usr/lib/gcc/aarch64-alpine-linux-musl/12.2.1/../../../../aarch64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
          collect2: error: ld returned 1 exit status

error: could not compile `proc-macro-error-attr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `project1_1 v0.1.0 (/)`, intermediate artifacts can be found at `/target`
The command '/bin/sh -c cargo install --path .' returned a non-zero code: 101
Unable to find image 'my-rust-app:latest' locally
2022/12/15 17:31:02 must use ASL logging (which requires CGO) if running as root
docker: Error response from daemon: pull access denied for my-rust-app, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

And I also tried this -

FROM ubuntu:latest
WORKDIR /
COPY . .
RUN apt-get update
RUN apt-get install protobuf-compiler openssl pkg-config libssl-dev rustc cmake cargo -y
RUN rustc -V
CMD ["./run.sh"]

But still ran into problems compiling dependencies that relied on C.

So, my question at this point is "What is the easiest way of getting a rust program to run with a standard list of dependencies?" The hello world examples don't cut it for any Rust program that has a large crate stack.

Thanks.


问:
If the embeded pdf is too big, do not show the pdf
I am using the following code:

```<code><iframe src='pdf/Lorem-Ipsum.pdf' style="min-height:89vh; width:100%"></iframe>
</code>```

Lets assume that, this pdf file is too big, bigger that 50 MB, so do not show the previewable pdf, just show the download button, just like the google drive do: link.

How could I do that?

Body:
I am using the following code:

Lets assume that, this pdf file is too big, bigger that 50 MB, so do not show the previewable pdf, just show the download button, just like the google drive do: link.

How could I do that?