add bg image transform to example project

This commit is contained in:
Nick Fisher
2022-09-05 12:40:22 +10:00
parent 8eb2d8d658
commit 5693a0a957

View File

@@ -38,7 +38,7 @@ class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
showPerformanceOverlay: true, // showPerformanceOverlay: true,
color: Colors.white, color: Colors.white,
home: Scaffold( home: Scaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
@@ -223,6 +223,10 @@ class _MyAppState extends State<MyApp> {
case 27: case 27:
_framerate = _framerate == 60 ? 30 : 60; _framerate = _framerate == 60 ? 30 : 60;
await _filamentController.setFrameRate(_framerate); await _filamentController.setFrameRate(_framerate);
break;
case 28:
await _filamentController.setBackgroundImagePosition(-5, -5);
break;
} }
}, },
itemBuilder: (BuildContext context) => itemBuilder: (BuildContext context) =>
@@ -317,6 +321,10 @@ class _MyAppState extends State<MyApp> {
value: 27, value: 27,
child: child:
Text('toggle framerate')), Text('toggle framerate')),
PopupMenuItem(
value: 28,
child:
Text('set bg image pos')),
]))), ]))),
Align( Align(
alignment: Alignment.bottomRight, alignment: Alignment.bottomRight,