37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'top_app_bar.dart';
|
|
import 'side_bar.dart';
|
|
import '../config/environment.dart';
|
|
|
|
class BaseLayout extends StatelessWidget {
|
|
final Widget child;
|
|
|
|
const BaseLayout({super.key, required this.child});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// 1. Capture the current route name from the navigation context
|
|
final String? routeName = ModalRoute.of(context)?.settings.name;
|
|
|
|
// 2. Use the Title widget to communicate with the browser's tab
|
|
return Title(
|
|
title: Environment.getPageTitle(routeName),
|
|
color: const Color(0xFF00999E), // Required, usually matches your theme
|
|
child: Scaffold(
|
|
appBar: const NhanceTopBar(),
|
|
body: Row(
|
|
children: [
|
|
const NhanceSideBar(),
|
|
Expanded(
|
|
child: Container(
|
|
color: const Color(0xFFF5F7F7),
|
|
padding: const EdgeInsets.all(16),
|
|
child: child,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|