nsapp_terminate 1.0.0
nsapp_terminate: ^1.0.0 copied to clipboard
Terminates current app in macOS.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:nsapp_terminate/nsapp_terminate.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _nsappTerminatePlugin = NsappTerminate();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: OutlinedButton(
onPressed: () => _nsappTerminatePlugin.terminate(),
child: const Text('Terminate')),
),
),
);
}
}