flutter_ecosed 0.0.6 copy "flutter_ecosed: ^0.0.6" to clipboard
flutter_ecosed: ^0.0.6 copied to clipboard

discontinuedreplaced by: freefeos

FlutterEcosed is a Flutter plugin and an advanced Flutter development framework that provides Android platform debugging, plugin development and dashboard functions.

example/lib/main.dart

import 'dart:async';

import 'package:device_preview/device_preview.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ecosed/flutter_ecosed.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return DevicePreview(
      builder: (context) {
        return const ExampleApp();
      },
    );
  }
}

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  static const String appName = 'flutter_ecosed 示例应用';

  @override
  Widget build(BuildContext context) {
    return DynamicColorBuilder(
      builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
        return MaterialApp(
          home: EcosedApp(
            home: (exec, body) {
              return body;
            },
            plugins: const [ExamplePlugin()],
            title: appName,
            location: BannerLocation.topStart,
            scaffold: (body) {
              return Scaffold(
                appBar: AppBar(
                  title: const Text(appName),
                ),
                body: body,
              );
            },
          ),
          builder: DevicePreview.appBuilder,
          title: appName,
          theme: ThemeData(
            colorScheme: lightDynamic,
            useMaterial3: true,
          ),
          darkTheme: ThemeData(
            colorScheme: darkDynamic,
            useMaterial3: true,
          ),
          themeMode: ThemeMode.system,
          locale: DevicePreview.locale(context),
          // ignore: deprecated_member_use
          useInheritedMediaQuery: true,
        );
      },
    );
  }
}

class ExamplePlugin extends StatelessWidget implements EcosedPlugin {
  const ExamplePlugin({super.key});

  @override
  Future<Object?> onMethodCall(String name) async {
    return await null;
  }

  @override
  String pluginAuthor() => 'ExampleAuthor';

  @override
  String pluginChannel() => 'example_channel';

  @override
  String pluginDescription() => 'this is an example plugin.';

  @override
  String pluginName() => 'ExamplePlugin';

  @override
  Widget pluginWidget(BuildContext context) => this;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Example Plugin'),
      ),
      body: const Center(
        child: Text('Hello World!'),
      ),
    );
  }
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

FlutterEcosed is a Flutter plugin and an advanced Flutter development framework that provides Android platform debugging, plugin development and dashboard functions.

Repository (GitHub)
View/report issues

Topics

#flutter #widget #shizuku

License

unknown (license)

Dependencies

flutter, flutter_plugin_android_lifecycle, flutter_web_plugins, plugin_platform_interface, url_launcher

More

Packages that depend on flutter_ecosed