首页 > 其他分享 >Flutter Package of the Week All In One

Flutter Package of the Week All In One

时间:2024-12-13 15:09:58浏览次数:3  
标签:Week Package flutter controller video https override com Flutter

Flutter Package of the Week All In One

iOS App / Android App / Web App / Desktop App

image

https://www.youtube.com/playlist?list=PLjxrf2q8roU1quF6ny8oFHJ2gBdrYN_AK

video_player Flutter Package

<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/Jxw6FaA0j3I?si=5u_u61p5J-ZyRZTX&start=4" title="YouTube video player" width="560"></iframe>

https://www.youtube.com/watch?v=Jxw6FaA0j3I&list=PLjxrf2q8roU1quF6ny8oFHJ2gBdrYN_AK&index=1


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

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

/// Stateful widget to fetch and then display video content.
class VideoApp extends StatefulWidget {
  const VideoApp({super.key});

  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  late VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.networkUrl(Uri.parse(
        'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4'))
      ..initialize().then((_) {
        // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
        setState(() {});
      });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        body: Center(
          child: _controller.value.isInitialized
              ? AspectRatio(
                  aspectRatio: _controller.value.aspectRatio,
                  child: VideoPlayer(_controller),
                )
              : Container(),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              _controller.value.isPlaying
                  ? _controller.pause()
                  : _controller.play();
            });
          },
          child: Icon(
            _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
          ),
        ),
      ),
    );
  }

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

https://pub.dev/packages/video_player

image

https://docs.flutter.dev/cookbook/plugins/play-video

demos

(

标签:Week,Package,flutter,controller,video,https,override,com,Flutter
From: https://www.cnblogs.com/xgqfrms/p/18604997

相关文章

  • PaddleClas棘手问题:ImportError: attempted relative import with no known parent pa
    PaddleClasImportError问题问题背景事先通过pipinstall-e.安装了editional版本的PaddleClas包,也在PYTHONPATH当中添加了相关路径,但是在执行模型推理时,还是遇到了这个问题:Traceback(mostrecentcalllast):File"/root/mambaforge/envs/py310/lib/python3.10/runpy.py......
  • Sigrity Power DC Package Multi-Resistor Compact ET Model Extraction模式提取封装
    SigrityPowerDCPackageMulti-ResistorCompactETModelExtraction模式提取封装基板电热阻模型SigrityPowerDCPackageMulti-ResistorCompactETModelExtraction模式是用于提取封装基板电热阻模型的,用于使用了这个封装基板的PCB和PKG的联合电仿真和联合热仿真,下面......
  • Sigrity PowerDCPackage ThermalCharacterization模式提取封装基板热阻参数-Single-Di
    SigrityPowerDCPackageThermalCharacterization模式提取封装基板热阻参数-Single-DiePackageDELPHIcompactThermalModelSigrityPowerDCPackageThermalCharacterization模式是用于提取封装基板的热阻参数的,下面根据JEDECSingle-DiePackageDELPHIcompactTh......
  • Sigrity Power DC Package Thermal Characterization模式提取封装基板热阻参数-Multi-
    SigrityPowerDCPackageThermalCharacterization模式提取封装基板热阻参数-Multi-DiePackageThermalParameterSigrityPowerDCPackageThermalCharacterization模式是用于提取封装基板的热阻参数的,下面根据JEDECMulti-DiePackageThermalParameter标准介绍如何......
  • NewStar CTF 2024-week1-web
    headach3题目提示:head我们右键点查看,在网络处添加HEAD请求头就得到了flag:flag{You_Ar3_R3Ally_A_9ooD_d0ctor}会赢吗查看页面源代码,得到flag第一部分:ZmxhZ3tXQTB3继续访问/4cqu1siti0n查看页面源代码我们使用post方法请求接口,得到第二部分flag:IV95NF9yM2Fs我们继续......
  • .NET CORE Central Package Management (CPM) 整理
    前言CentralPackageManagement是netcore统一包管理工具,在微服务项目中,大量的项目可能会引用不同的dll版本。比如最常见的Newtonsoft.Json,有些是11,有些是最新12,后续不能进行维护在微服务项目中,后续的版本升级,大量的项目需要单独修改,有了统一管理工具,只需要维护一个地方即......
  • ubuntu通过apt-get获取已安装的package的下载链接或将其下载到本地
    方法1:获取已安装包的下载链接检查已安装包的版本:首先,确认你需要的软件包是否已安装,以及它的版本信息:dpkg-l|grep<package_name>示例:dpkg-l|grepvim获取下载链接:使用apt-getdownload的--print-uris选项打印软件包的下载链接:apt-getinstall--reinst......
  • flutter库【path_provider】编译错误指导
    增加依赖:flutterpubaddpath_provider使用命令:flutterrun-v提示错误解决方案:打开.\android\settings.gradle文件,版本号更新为最新。plugins{id"dev.flutter.flutter-plugin-loader"version"1.0.0"id"com.android.application"version&q......
  • flutter中调用C++的库
    Dart调用C++的库安装ffi库flutterpubaddffi如果是C++必须使用C的方式导出接口import'dart:ffi';import'dart:io';import"package:ffi/ffi.dart";finalDynamicLibraryff=Platform.isWindows?DynamicLibrary.open("live666.dll")......
  • Azure Pipelines 监听文件改动时自动发布 .Net Core或者.Net Framework package到arti
    示例项目:https://dev.azure.com/guorj/_git/PackDemo因为一些需求,在代码有改动以后需要更新响应的package,以供其他项目来使用,但是每次手动打包比较麻烦,就想着给自动化了,可怜自动化出来这么久都没有用过。代码托管在微软的Azure上,所以使用的是AzurePipelines功能。懒得细写了,包......