developed
This commit is contained in:
parent
ed4f91ce98
commit
3b12b68d0c
|
|
@ -0,0 +1,3 @@
|
|||
description: This file stores settings for Dart & Flutter DevTools.
|
||||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||
extensions:
|
||||
|
|
@ -8,8 +8,11 @@ import '../../domain/entities/order/order.dart';
|
|||
import '../widgets/map/clustering.dart';
|
||||
import '../widgets/widgets.dart';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class OrderDetailsScreen extends StatefulWidget {
|
||||
final OrderEntity order;
|
||||
|
||||
const OrderDetailsScreen({super.key, required this.order});
|
||||
|
||||
@override
|
||||
|
|
@ -17,80 +20,105 @@ class OrderDetailsScreen extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
|
||||
bool _isFullScreen = false; // Track fullscreen mode
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
context.read<OrderDetailBloc>().add(GetRoutes(widget.order.cargoId));
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _toggleFullScreen() {
|
||||
setState(() {
|
||||
_isFullScreen = !_isFullScreen;
|
||||
|
||||
if (_isFullScreen) {
|
||||
// Enter fullscreen mode
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||
} else {
|
||||
// Exit fullscreen mode
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
App.init(context);
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.surface,
|
||||
appBar: AppBar(
|
||||
iconTheme: const IconThemeData(
|
||||
color: Colors.white,
|
||||
),
|
||||
backgroundColor: AppColors.primary,
|
||||
title: Text(
|
||||
'Sargyt ${widget.order.name}',
|
||||
style: AppText.h2!.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
appBar: _isFullScreen
|
||||
? null // Hide the app bar in fullscreen mode
|
||||
: AppBar(
|
||||
iconTheme: const IconThemeData(
|
||||
color: Colors.white,
|
||||
),
|
||||
backgroundColor: AppColors.primary,
|
||||
title: Text(
|
||||
'Sargyt: ${widget.order.name}',
|
||||
style: AppText.h2!.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
body: CustomScrollView(
|
||||
slivers: [
|
||||
/// map
|
||||
SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
height: AppDimensions.normalize(130),
|
||||
child: const ClusteringPage(),
|
||||
),
|
||||
),
|
||||
|
||||
/// info text
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: Space.all(1, 1),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Sargyt barada maglumat №${widget.order.no}',
|
||||
style: AppText.b1b,
|
||||
),
|
||||
|
||||
/// gap
|
||||
Space.y!,
|
||||
|
||||
/// info card
|
||||
InfoCard(order: widget.order),
|
||||
],
|
||||
height: _isFullScreen
|
||||
? MediaQuery.of(context).size.height // Full screen height
|
||||
: AppDimensions.normalize(130),
|
||||
child: ClusteringPage(
|
||||
onFullScreenToggle: _toggleFullScreen,
|
||||
isFullScreen: _isFullScreen,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/// current location info
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: Space.all(1, 1),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Gatnaw yoly',
|
||||
style: AppText.b1b,
|
||||
),
|
||||
if (!_isFullScreen) ...[
|
||||
/// info text
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: Space.all(1, 1),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Sargyt barada maglumat №${widget.order.no}',
|
||||
style: AppText.b1b,
|
||||
),
|
||||
|
||||
/// gap
|
||||
Space.y!,
|
||||
/// gap
|
||||
Space.y!,
|
||||
|
||||
/// location card
|
||||
LocationCard(cargoId: widget.order.cargoId)
|
||||
],
|
||||
/// info card
|
||||
InfoCard(order: widget.order),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
/// current location info
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding: Space.all(1, 1),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Gatnaw yoly',
|
||||
style: AppText.b1b,
|
||||
),
|
||||
|
||||
/// gap
|
||||
Space.y!,
|
||||
|
||||
/// location card
|
||||
LocationCard(cargoId: widget.order.cargoId),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class BottomNavigation extends StatelessWidget {
|
|||
return BlocBuilder<NavigationCubit, NavigationTab>(
|
||||
builder: (context, activeTab) {
|
||||
return SizedBox(
|
||||
height: AppDimensions.normalize(32),
|
||||
height: AppDimensions.normalize(35),
|
||||
child: BottomNavigationBar(
|
||||
type: BottomNavigationBarType.fixed,
|
||||
currentIndex: activeTab.index,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../application/application.dart';
|
||||
import '../../core/constants/colors.dart';
|
||||
import '../../data/data_sources/local/languages_data_source.dart';
|
||||
|
||||
class BottomSheetContent extends StatelessWidget {
|
||||
|
|
@ -29,20 +30,10 @@ class BottomSheetContent extends StatelessWidget {
|
|||
lang.language,
|
||||
style: AppText.b1,
|
||||
),
|
||||
trailing: state.locale.languageCode == lang.code
|
||||
? Icon(
|
||||
Icons.check,
|
||||
color: Colors.green,
|
||||
size: 26.0,
|
||||
shadows: [
|
||||
Shadow(
|
||||
offset: const Offset(0, 2),
|
||||
blurRadius: 3.0,
|
||||
color: Colors.black.withOpacity(0.3),
|
||||
),
|
||||
],
|
||||
)
|
||||
: null,
|
||||
trailing: Icon(
|
||||
state.locale.languageCode == lang.code ? Icons.radio_button_checked : Icons.radio_button_off,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
onTap: () {
|
||||
debugPrint('lang_selection');
|
||||
context.read<LanguageBloc>().add(
|
||||
|
|
|
|||
|
|
@ -7,9 +7,14 @@ import 'package:latlong2/latlong.dart';
|
|||
import '../../../application/order_detail_bloc/order_detail_bloc.dart';
|
||||
|
||||
class ClusteringPage extends StatefulWidget {
|
||||
static const String route = 'clusteringPage';
|
||||
final VoidCallback onFullScreenToggle;
|
||||
final bool isFullScreen;
|
||||
|
||||
const ClusteringPage({super.key});
|
||||
const ClusteringPage({
|
||||
super.key,
|
||||
required this.onFullScreenToggle,
|
||||
required this.isFullScreen,
|
||||
});
|
||||
|
||||
@override
|
||||
State<ClusteringPage> createState() => _ClusteringPageState();
|
||||
|
|
@ -31,6 +36,10 @@ class _ClusteringPageState extends State<ClusteringPage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: widget.onFullScreenToggle, // Use the passed callback
|
||||
child: Icon(widget.isFullScreen ? Icons.fullscreen_exit : Icons.fullscreen),
|
||||
),
|
||||
body: BlocBuilder<OrderDetailBloc, OrderDetailState>(
|
||||
builder: (context, state) {
|
||||
if (state is RoutesLoading) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue