mirror of
https://github.com/smmarty/friflex_flutter_starter.git
synced 2025-12-22 09:30:45 +00:00
refactor(full refactor): Рефакторинг стартера (#8)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// {@template MainDetailScreen}
|
||||
/// Вложенный экран для главного экрана приложения
|
||||
/// {@endtemplate}
|
||||
class MainDetailScreen extends StatelessWidget {
|
||||
/// {@macro MainDetailScreen}
|
||||
const MainDetailScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Main Detail Screen'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('Вложенный экран'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:friflex_starter/app/app_box.dart';
|
||||
import 'package:friflex_starter/features/main/presentation/main_routes.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
/// {@template MainScreen}
|
||||
/// Главный экран приложения
|
||||
/// {@endtemplate}
|
||||
class MainScreen extends StatelessWidget {
|
||||
/// {@macro MainScreen}
|
||||
const MainScreen({super.key});
|
||||
|
||||
@override
|
||||
@@ -12,20 +18,16 @@ class MainScreen extends StatelessWidget {
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('Главный экран приложения'),
|
||||
const HBox(16),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
context.push('/profile');
|
||||
// Переход на экран с деталями
|
||||
context.pushNamed(MainRoutes.mainDetailScreenName);
|
||||
},
|
||||
child: const Text('Открыть профиль'),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
context.push('/profile_scope');
|
||||
},
|
||||
child: const Text('Открыть профиль с областью видимости'),
|
||||
child: const Text('Переход на экран с деталями'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user