kopia lustrzana https://gitlab.com/mysocialportal/relatica
				
				
				
			Fix image overflowing onto text and apparent lack of responsiveness when zoomed in issue
							rodzic
							
								
									57deeab1a0
								
							
						
					
					
						commit
						90b71fc8ef
					
				| 
						 | 
				
			
			@ -48,46 +48,41 @@ class ImageViewerScreen extends StatelessWidget {
 | 
			
		|||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    final width = MediaQuery.of(context).size.width;
 | 
			
		||||
    final height = MediaQuery.of(context).size.height;
 | 
			
		||||
    return Scaffold(
 | 
			
		||||
        appBar: AppBar(
 | 
			
		||||
          actions: [
 | 
			
		||||
            IconButton(
 | 
			
		||||
                onPressed: () => saveImage(context),
 | 
			
		||||
                icon: const Icon(Icons.download))
 | 
			
		||||
          ],
 | 
			
		||||
        ),
 | 
			
		||||
        body: SafeArea(
 | 
			
		||||
          child: Column(
 | 
			
		||||
            mainAxisAlignment: MainAxisAlignment.start,
 | 
			
		||||
            crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
            children: [
 | 
			
		||||
              Expanded(
 | 
			
		||||
                flex: 9,
 | 
			
		||||
                child: InteractiveViewer(
 | 
			
		||||
                  clipBehavior: Clip.none,
 | 
			
		||||
                  constrained: true,
 | 
			
		||||
                  maxScale: 10.0,
 | 
			
		||||
                  scaleFactor: 400,
 | 
			
		||||
                  child:
 | 
			
		||||
                      CachedNetworkImage(imageUrl: attachment.uri.toString()),
 | 
			
		||||
      appBar: AppBar(
 | 
			
		||||
        actions: [
 | 
			
		||||
          IconButton(
 | 
			
		||||
              onPressed: () => saveImage(context),
 | 
			
		||||
              icon: const Icon(Icons.download))
 | 
			
		||||
        ],
 | 
			
		||||
      ),
 | 
			
		||||
      body: SafeArea(
 | 
			
		||||
        child: Column(
 | 
			
		||||
          mainAxisAlignment: MainAxisAlignment.start,
 | 
			
		||||
          crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
          children: [
 | 
			
		||||
            SizedBox(
 | 
			
		||||
              width: width,
 | 
			
		||||
              height: 0.8 * height,
 | 
			
		||||
              child: InteractiveViewer(
 | 
			
		||||
                maxScale: 10.0,
 | 
			
		||||
                scaleFactor: 400,
 | 
			
		||||
                child: CachedNetworkImage(imageUrl: attachment.uri.toString()),
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
            Expanded(
 | 
			
		||||
              child: SingleChildScrollView(
 | 
			
		||||
                child: Padding(
 | 
			
		||||
                  padding: const EdgeInsets.all(8.0),
 | 
			
		||||
                  child: Text(attachment.description),
 | 
			
		||||
                ),
 | 
			
		||||
              ),
 | 
			
		||||
              if (attachment.description.isNotEmpty)
 | 
			
		||||
                Expanded(
 | 
			
		||||
                  flex: 1,
 | 
			
		||||
                  child: Padding(
 | 
			
		||||
                    padding: const EdgeInsets.only(
 | 
			
		||||
                      left: 8.0,
 | 
			
		||||
                      right: 8.0,
 | 
			
		||||
                      bottom: 8.0,
 | 
			
		||||
                    ),
 | 
			
		||||
                    child: SingleChildScrollView(
 | 
			
		||||
                      child: Text(attachment.description),
 | 
			
		||||
                    ),
 | 
			
		||||
                  ),
 | 
			
		||||
                ),
 | 
			
		||||
            ],
 | 
			
		||||
          ),
 | 
			
		||||
        ));
 | 
			
		||||
            ),
 | 
			
		||||
          ],
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue