import 'package:flutter/material.dart';
import 'package:flyinsono/lab/color/lab_colors.dart';
import 'package:get/get.dart';

import 'index.dart';

/// 404 页面
class LabEmptyPage extends GetView<LabEmptyController> {
  const LabEmptyPage({Key? key}) : super(key: key);

  get pageHashCode => this.hashCode.toString();

  // 主视图
  Widget _buildView() {
    return Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Text(
            "404",
            style: TextStyle(
              color: LabColors.text500,
              fontSize: 70,
            ),
          ),
          Text(
            "Page Not Found",
            style: TextStyle(
              color: LabColors.text600,
              fontSize: 14,
            ),
          ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<LabEmptyController>(
      init: LabEmptyController(tabHashCode: this.hashCode),
      tag: pageHashCode, // 如果一个页面要想实现多开，必须加 tag，且 tag 要传入每一个子组件
      id: LabEmptyController.labEmptyId,
      builder: (_) {
        return _buildView();
      },
    );
  }
}
