Добрый день!
Никак не исправить ошибку - "lib/scr/MyARScreen.dart:89:7: Error: No named parameter with the name 'materials'.
materials: [material],"
Помогите исправить!
Ссылка на Github:
https://github.com/DmitrySaxSPb/kmt2023
import 'package:flutter/material.dart';
import 'package:arcore_flutter_plugin/arcore_flutter_plugin.dart';
import 'package:flutter/services.dart';
class MyARScreen extends StatefulWidget {
const MyARScreen({Key? key}) : super(key: key);
@override
_MyARScreenState createState() => _MyARScreenState();
}
class _MyARScreenState extends State<MyARScreen> {
late ArCoreController arCoreController;
get vector => null;
@override
void dispose() {
arCoreController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
appBarTheme: const AppBarTheme(
color: Colors.grey,
),
),
home: Scaffold(
appBar: AppBar(
title: const Text(
'ОАО "ПФ "КМТ"',
style: TextStyle(
color: Colors.blue,
),
),
centerTitle: true,
),
body: Stack(
children: [
ArCoreView(
onArCoreViewCreated: onArCoreViewCreated,
enableTapRecognizer: true,
),
Positioned(
bottom: 20,
left: 20,
child: ElevatedButton(
onPressed: () {
Navigator.pop(context);
},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.black87,
minimumSize: Size(
MediaQuery.of(context).size.width,
60,
),
),
child: const Text(
'Вернуться назад',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic,
fontFamily: 'Gothic',
),
),
),
),
],
),
),
);
}
void onArCoreViewCreated(ArCoreController arCoreController) async {
this.arCoreController = arCoreController;
final ArCoreMaterial material = ArCoreMaterial(
color: Colors.white,
textureBytes:
(await rootBundle.load('assets/pngtexture.png')).buffer.asUint8List(),
);
final ArCoreReferenceNode node = ArCoreReferenceNode(
objectUrl: 'assets/3Dmodel105доп.blend',
scale: vector.Vector3(0.01, 0.01, 0.01),
position: vector.Vector3(0, -0.5, -1.5),
materials: [material],
);
arCoreController.addArCoreNode(node);
}
}