Comments (1)
I checked this on my Pixel 7 Android 14 and saw the same output result as 0 on the sample app. To reproduce this, I add a new file to the package example project at lib folder:
Complete sample code
import 'package:flutter/material.dart';
import 'camera_controller.dart';
import 'camera_image.dart';
import 'camera_preview.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
CameraController? _controller;
int _counter = 0;
@override
void initState() {
super.initState();
_initializeCamera();
}
Future<void> _initializeCamera() async {
final cameras = await availableCameras();
final firstCamera = cameras.first;
_controller = CameraController(firstCamera);
await _controller!.initialize();
if (mounted) {
setState(() {});
}
_controller!.startVideoRecording(onAvailable: _onImage);
}
void _onImage(CameraImage image) {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Stack(
children: [
Padding(
padding: const EdgeInsets.all(32.0),
child: Center(
child: _controller != null
? CameraPreview(_controller!)
: const CircularProgressIndicator(),
),
),
Positioned(
bottom: 16,
right: 16,
child: Text('images received: $_counter'),
),
],
),
);
}
}
flutter doctor -v
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.1 23B74 darwin-x64, locale en-VN)
• Flutter version 3.22.2 on channel stable at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (31 hours ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode15.3.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app/
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
[✓] VS Code (version 1.89.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (3 available)
• iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios • iOS 15.8 19H370
• macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142
[✓] Network resources
• All expected network resources are available.
• No issues found!
from flutter.
Related Issues (20)
- iOS app crashes in Simulator running on mac virtualized environment HOT 9
- Video Player progress downloading (download only part of the video provided in the network which is enough to play a few seconds from it). while playing these seconds I want to initialize the rest of the video HOT 1
- Video Player progress downloading (download only part of the video provided in the network which is enough to play a few seconds from it). while playing these seconds I want to initialize the rest of the video HOT 1
- %5Btool_crash%5D FileSystemException%3A Cannot open file%2C OS Error%3A The system cannot find the path specified.%0D%0A%2C errno %3D 3 HOT 2
- Error: Unable to find git in your PATH. .... I'm not using GIT, remove this HOT 1
- [tool_crash] FileSystemException: Cannot open file, OS Error: The system cannot find the file specified., errno = 2 HOT 2
- aot_elf_release takes a unreasonably long time to complete HOT 2
- [Impeller] iOS crashes on some devices using impeller HOT 10
- loading issues HOT 1
- [tool_crash] ProcessException: Failed to find "git" in the search path. Command: git, OS error code: 0 HOT 3
- [google_map_flutter] double-tap and hold on, then drag up/down to zoom out/in will target onCameraIdle too much on iOS HOT 1
- [tool_crash] ShaderCompilerException HOT 3
- number keyboard doesn't work in TextField after update flutter to 3.22 HOT 2
- [Linux] FocusableActionDetector not working HOT 24
- [Web] Canvaskit raise errors on latest Chrome stable version HOT 24
- Adapt flutter tools to handle workspaces:
- Crash on linux HOT 6
- RangeError: RangeError: Value not in range: 226 HOT 4
- mac-10 & mac-26 lost external connection phone device. HOT 1
- mac-24 lost external connection phone device. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.