ContextMenu

snippet.packages.flutter.lib.src.cupertino.context_menu.160.

  

// ignore_for_file: directives_ordering
// ignore_for_file: unnecessary_import
// ignore_for_file: unused_import
// ignore_for_file: unused_element
// ignore_for_file: unused_local_variable
import 'dart:async';
import 'dart:convert';
import 'dart:math' as math;
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/physics.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/semantics.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/services.dart';

// From: packages/flutter/lib/src/cupertino/context_menu.dart:160
dynamic expression57 = 
CupertinoContextMenu(
  // The FittedBox in the preview here allows the image to animate its
  // aspect ratio when the CupertinoContextMenu is animating its preview
  // widget open and closed.
  previewBuilder: (BuildContext context, Animation animation, Widget child) {
    return FittedBox(
      fit: BoxFit.cover,
      // This ClipRRect rounds the corners of the image when the
      // CupertinoContextMenu is open, even though it's not rounded when
      // it's closed. It uses the given animation to animate the corners
      // in sync with the opening animation.
      child: ClipRRect(
        borderRadius: BorderRadius.circular(64.0 * animation.value),
        child: Image.asset('assets/photo.jpg'),
      ),
    );
  },
  actions: [
    CupertinoContextMenuAction(
      child: const Text('Action one'),
      onPressed: () {},
    ),
  ],
  child: FittedBox(
    fit: BoxFit.cover,
    child: Image.asset('assets/photo.jpg'),
  ),
)
;
  

SHARE: