flutter_opengl_view 0.0.3 copy "flutter_opengl_view: ^0.0.3" to clipboard
flutter_opengl_view: ^0.0.3 copied to clipboard

OpenGL plugin with native iOS (OBJC) & Android (JAVA) support as well as C++.

example/lib/main.dart

// Copyright 2020 The Lensshift Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

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

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

/// This example app shows, how to integrate a FlutterOpenglView plugin into the
/// widget tree.
///
/// In addition, an Overlay shows that other widgets can be rendered on top of
/// the FlutterOpenglView.
///
/// Note: Overlaying other widgets only works on Android, if the GLTextureView
/// is used.

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    FlutterOpenglView openGlView =
        const FlutterOpenglView(useTextureView: true);

    return MaterialApp(
      home: Scaffold(
        body: SizedBox(
          width: 300.0,
          height: 330.0,
          child: Overlay(initialEntries: [
            OverlayEntry(builder: (context) {
              return openGlView;
            }),
            OverlayEntry(builder: (context) {
              return Column(children: const [
                Text(
                  'Hello Flutter World',
                )
              ]);
            })
          ]),
        ),
      ),
    );
  }
}
4
likes
130
pub points
42%
popularity

Publisher

unverified uploader

OpenGL plugin with native iOS (OBJC) & Android (JAVA) support as well as C++.

Repository (GitLab)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_opengl_view