diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/devtools_options.yaml @@ -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: diff --git a/lib/presentation/screens/order_details.dart b/lib/presentation/screens/order_details.dart index e20170a..5821962 100644 --- a/lib/presentation/screens/order_details.dart +++ b/lib/presentation/screens/order_details.dart @@ -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 { + bool _isFullScreen = false; // Track fullscreen mode + @override void initState() { context.read().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), + ], + ), + ), + ), + ], ], ), ); diff --git a/lib/presentation/widgets/bottom_navbar.dart b/lib/presentation/widgets/bottom_navbar.dart index 41bf69e..0015840 100644 --- a/lib/presentation/widgets/bottom_navbar.dart +++ b/lib/presentation/widgets/bottom_navbar.dart @@ -15,7 +15,7 @@ class BottomNavigation extends StatelessWidget { return BlocBuilder( builder: (context, activeTab) { return SizedBox( - height: AppDimensions.normalize(32), + height: AppDimensions.normalize(35), child: BottomNavigationBar( type: BottomNavigationBarType.fixed, currentIndex: activeTab.index, diff --git a/lib/presentation/widgets/lang_selection.dart b/lib/presentation/widgets/lang_selection.dart index cb84adb..fc4532b 100644 --- a/lib/presentation/widgets/lang_selection.dart +++ b/lib/presentation/widgets/lang_selection.dart @@ -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().add( diff --git a/lib/presentation/widgets/map/clustering.dart b/lib/presentation/widgets/map/clustering.dart index 3747731..aa72743 100644 --- a/lib/presentation/widgets/map/clustering.dart +++ b/lib/presentation/widgets/map/clustering.dart @@ -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 createState() => _ClusteringPageState(); @@ -31,6 +36,10 @@ class _ClusteringPageState extends State { @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( builder: (context, state) { if (state is RoutesLoading) {