1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- class EcgImageDialog extends StatelessWidget {
- const EcgImageDialog({Key? key, required this.image}) : super(key: key);
- final Image image;
-
- Widget _buildView() {
- const designWidth = 1280.0;
- final width = Get.width;
- final scale = width / designWidth;
- final ScrollController scrollController = ScrollController();
- return Container(
- width: Get.width * 0.9 / scale,
- height: 240 * 3,
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(10),
- ),
- clipBehavior: Clip.antiAlias,
- child: Column(
- children: [
- _buildHead(),
- Expanded(
- child: Scrollbar(
- thumbVisibility: true,
- thickness: 10,
- radius: const Radius.circular(10),
- controller: scrollController,
- child: SingleChildScrollView(
- controller: scrollController,
- padding: const EdgeInsets.only(left: 10, right: 10, bottom: 20),
- physics: const BouncingScrollPhysics(),
- scrollDirection: Axis.horizontal,
- child: Center(
- child: image,
- ),
- ),
- ),
- ),
- ],
- ),
- );
- }
-
-
-
-
-
-
-
-
-
-
- @override
- Widget build(BuildContext context) {
- return Dialog(
- child: _buildView(),
- );
- }
-
- Widget _buildHead() {
- return SizedBox(
- height: 50,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- IconButton(
- onPressed: () => Get.back(),
- icon: const Icon(
- Icons.close,
- size: 30,
- ),
- ),
- ],
- ),
- );
- }
- }
|