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