lvn_plugin_flutter 0.1.0 copy "lvn_plugin_flutter: ^0.1.0" to clipboard
lvn_plugin_flutter: ^0.1.0 copied to clipboard

Button for AI LuatVietnam.

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              /// Phần 2. Hướng dẫn tạo Widget với plugin
              SampleButton(
                text: "Sample Button",
                onPressed: () {
                  print("Sample Button Click");
                },
              ),
             Expanded(
  child:Stack(
      children: [
        DragButton(),
      ],
    )),


             /// Phần 4. Hướng dẫn gọi native code từ plugin
              FutureBuilder<String?>(
                future: SampleCallNativeFlutter.getToken(),
                builder: (_, snapshoot) {
                  return Text('${snapshoot.data}');
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}