Android studio ,flutter,gradle not work run

Hi i need help with make app to android with flutter but after 40 fails flutter run dont know problem in java i using java 17 and making simple app for raspberry pi 5 camera see on mobile but not work what with this ? thanks

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() => runApp(const VideoStreamingApp());

class VideoStreamingApp extends StatelessWidget {
  const VideoStreamingApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Raspberry Pi Video Stream',
      home: VideoStreamPage(),
    );
  }
}

class VideoStreamPage extends StatefulWidget {
  const VideoStreamPage({super.key});

  @override
  State<VideoStreamPage> createState() => _VideoStreamPageState();
}

class _VideoStreamPageState extends State<VideoStreamPage> {
  late VideoPlayerController _controller;
  final String streamUrl = "http://192.168.1.10:5000/stream"; // <-- Změňte na IP adresu Raspberry Pi

  @override
  void initState() {
    super.initState();
    _initializeVideoPlayer();
  }

  Future<void> _initializeVideoPlayer() async {
    _controller = VideoPlayerController.network(streamUrl)
      ..initialize().then((_) {
        setState(() {});
        _controller.play(); // Automaticky začne přehrávat při inicializaci
      });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Video Stream from RPi 5'),
      ),
      body: Center(
        child: _controller.value.isInitialized
            ? AspectRatio(
          aspectRatio: _controller.value.aspectRatio,
          child: VideoPlayer(_controller),
        )
            : const CircularProgressIndicator(),
      ),
    );
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }
}

Snímek obrazovky (731)

There are several major issues with your post.

  • I did not understand what you try to say in your text. That might be caused by me not being a native speaker, but maybe try to rephrase your text into proper sentences if the post stays.
  • Your uploaded image seems to be not uploaded, it does not display anything.
  • As you posted some Dart code and not some Gradle-related code I guess you have some problem with your Dart code. This means your post is totally off-topic here, as this is a Gradle forum and not a Dart forum. So if my suspicion is correct, please move your problem to some Dart-related community.