2025-01-21 14:24:31 +03:00
|
|
|
import 'package:flutter/material.dart';
|
2025-04-27 17:08:34 +03:00
|
|
|
import 'package:friflex_starter/app/app_context_ext.dart';
|
|
|
|
|
import 'package:friflex_starter/app/app_env.dart';
|
|
|
|
|
import 'package:friflex_starter/features/debug/debug_routes.dart';
|
2025-01-21 14:24:31 +03:00
|
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
|
|
|
|
|
|
/// Класс для реализации корневой страницы приложения
|
|
|
|
|
class RootScreen extends StatelessWidget {
|
|
|
|
|
/// Создает корневую страницу приложения
|
|
|
|
|
///
|
|
|
|
|
/// Принимает:
|
|
|
|
|
/// - [navigationShell] - текущая ветка навигации
|
2025-05-28 16:38:56 +03:00
|
|
|
const RootScreen({required this.navigationShell, super.key});
|
2025-01-21 14:24:31 +03:00
|
|
|
|
|
|
|
|
/// Текущая ветка навигации
|
|
|
|
|
final StatefulNavigationShell navigationShell;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
2025-04-27 17:08:34 +03:00
|
|
|
floatingActionButton: context.di.env != AppEnv.prod
|
|
|
|
|
? FloatingActionButton(
|
|
|
|
|
child: const Icon(Icons.bug_report),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
context.pushNamed(DebugRoutes.debugScreenName);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: null,
|
2025-01-21 14:24:31 +03:00
|
|
|
body: navigationShell,
|
|
|
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
|
|
|
items: const <BottomNavigationBarItem>[
|
|
|
|
|
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
|
2025-04-27 17:08:34 +03:00
|
|
|
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Профиль'),
|
2025-01-21 14:24:31 +03:00
|
|
|
],
|
|
|
|
|
currentIndex: navigationShell.currentIndex,
|
|
|
|
|
onTap: navigationShell.goBranch,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|