2024-05-22 15:18:01 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import 'package:solian/router.dart';
|
|
|
|
import 'package:solian/theme.dart';
|
2024-06-22 15:59:11 +00:00
|
|
|
import 'package:solian/widgets/app_bar_title.dart';
|
2024-05-22 15:18:01 +00:00
|
|
|
import 'package:solian/widgets/prev_page.dart';
|
|
|
|
|
|
|
|
class BasicShell extends StatelessWidget {
|
|
|
|
final GoRouterState state;
|
|
|
|
final Widget child;
|
|
|
|
|
|
|
|
const BasicShell({super.key, required this.child, required this.state});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final canPop = AppRouter.instance.canPop();
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
2024-06-22 15:59:11 +00:00
|
|
|
title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr),
|
2024-05-22 15:18:01 +00:00
|
|
|
centerTitle: false,
|
2024-06-22 15:59:11 +00:00
|
|
|
toolbarHeight: SolianTheme.toolbarHeight(context),
|
2024-05-22 15:18:01 +00:00
|
|
|
leading: canPop ? const PrevPageButton() : null,
|
|
|
|
automaticallyImplyLeading: false,
|
|
|
|
),
|
|
|
|
body: child,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|