import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'controller.dart';

class SettingsPage extends GetView<SettingsController> {
  const SettingsPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(8),
      color: Colors.grey.shade200,
      alignment: Alignment.bottomLeft,
      child: Container(
        color: Colors.white,
        alignment: Alignment.center,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              "当前版本：${controller.state.version}",
              style: const TextStyle(color: Colors.black, fontSize: 18),
            ),
            const SizedBox(height: 20),
            ElevatedButton.icon(
              icon: const Icon(Icons.exit_to_app),
              label: const Text("退出登录"),
              onPressed: () {
                controller.logOut();
              },
            ),
          ],
        ),
      ),
    );
  }
}
