fl_channel 0.2.0 copy "fl_channel: ^0.2.0" to clipboard
fl_channel: ^0.2.0 copied to clipboard

channel for native communication,Support ios macos android only

example/lib/main.dart

import 'package:example/src/event.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
      theme: ThemeData.light(useMaterial3: true),
      darkTheme: ThemeData.dark(useMaterial3: true),
      debugShowCheckedModeBanner: false,
      title: 'FlChannel',
      home: const App()));
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBarText('FlChannel'),
        body: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
          const SizedBox(width: double.infinity),
          ElevatedText(
              text: 'FlEvent',
              onPressed: () {
                showCupertinoModalPopup(
                    context: context, builder: (_) => const FlEventPage());
              }),
        ]));
  }
}

class TextBox extends StatelessWidget {
  const TextBox(this.keyName, this.value, {super.key});

  final dynamic keyName;
  final dynamic value;

  @override
  Widget build(BuildContext context) {
    return Visibility(
        visible: value != null &&
            value.toString().isNotEmpty &&
            value.toString() != 'null',
        child: Container(
            margin: const EdgeInsets.all(8), child: Text('$keyName = $value')));
  }
}

class ElevatedText extends ElevatedButton {
  ElevatedText({super.key, required String text, required super.onPressed})
      : super(child: Text(text));
}

class AppBarText extends AppBar {
  AppBarText(String text, {super.key})
      : super(
            elevation: 0,
            title: Text(text,
                style:
                    const TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
            centerTitle: true);
}
1
likes
150
points
112
downloads

Publisher

unverified uploader

Weekly Downloads

channel for native communication,Support ios macos android only

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on fl_channel