mirror of
https://github.com/flutter/samples.git
synced 2026-06-05 13:59:35 +00:00
Flutter 3.29 beta (#2571)
This commit is contained in:
@@ -6,10 +6,7 @@ import 'context_menu_region.dart';
|
||||
import 'platform_selector.dart';
|
||||
|
||||
class ImagePage extends StatelessWidget {
|
||||
const ImagePage({
|
||||
super.key,
|
||||
required this.onChangedPlatform,
|
||||
});
|
||||
const ImagePage({super.key, required this.onChangedPlatform});
|
||||
|
||||
static const String route = 'image';
|
||||
static const String title = 'ContextMenu on an Image';
|
||||
@@ -22,8 +19,10 @@ class ImagePage extends StatelessWidget {
|
||||
DialogRoute _showDialog(BuildContext context) {
|
||||
return DialogRoute<void>(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
const AlertDialog(title: Text('Image saved! (not really though)')),
|
||||
builder:
|
||||
(context) => const AlertDialog(
|
||||
title: Text('Image saved! (not really though)'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,9 +32,7 @@ class ImagePage extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
title: const Text(ImagePage.title),
|
||||
actions: <Widget>[
|
||||
PlatformSelector(
|
||||
onChangedPlatform: onChangedPlatform,
|
||||
),
|
||||
PlatformSelector(onChangedPlatform: onChangedPlatform),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.code),
|
||||
onPressed: () async {
|
||||
@@ -52,9 +49,7 @@ class ImagePage extends StatelessWidget {
|
||||
ContextMenuRegion(
|
||||
contextMenuBuilder: (context, offset) {
|
||||
return AdaptiveTextSelectionToolbar.buttonItems(
|
||||
anchors: TextSelectionToolbarAnchors(
|
||||
primaryAnchor: offset,
|
||||
),
|
||||
anchors: TextSelectionToolbarAnchors(primaryAnchor: offset),
|
||||
buttonItems: <ContextMenuButtonItem>[
|
||||
ContextMenuButtonItem(
|
||||
onPressed: () {
|
||||
|
||||
Reference in New Issue
Block a user