flutter_walle 2.0.1 copy "flutter_walle: ^2.0.1" to clipboard
flutter_walle: ^2.0.1 copied to clipboard

Get channel information (by meituan walle) from within the Flutter application.

example/lib/main.dart

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

import 'package:flutter_walle/flutter_walle.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _channel = 'Unknown';

  @override
  void initState() {
    super.initState();
    initChannelState();
  }

  Future<void> initChannelState() async {
    String channel = _channel;
    try {
      channel = await FlutterWalle.channel;
    } catch (e) {
      print(e.toString());
    }

    if (!mounted) return;

    setState(() {
      _channel = channel;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_channel\n'),
        ),
      ),
    );
  }
}
1
likes
140
pub points
40%
popularity

Publisher

unverified uploader

Get channel information (by meituan walle) from within the Flutter application.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_walle