mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 23:28:54 +03:30
Back button of pages navigate to home
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../config/routes.dart';
|
||||
import '../../models/cycles_models.dart';
|
||||
import '../../providers/connectivity.dart';
|
||||
import '../../providers/cycles.dart';
|
||||
@@ -21,6 +22,7 @@ class _CycleDetailScreenState extends State<CycleDetailScreen> {
|
||||
bool isInit = true;
|
||||
bool isEmpty = false;
|
||||
CycleDetailObject? datas;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() async {
|
||||
if (isInit) {
|
||||
@@ -50,11 +52,22 @@ class _CycleDetailScreenState extends State<CycleDetailScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Cycles', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'Cycles',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -84,6 +97,7 @@ class _CycleDetailScreenState extends State<CycleDetailScreen> {
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:cssd/widgets/ItemScreens/Details/item_detail_box.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../config/routes.dart';
|
||||
import '../../providers/connectivity.dart';
|
||||
import '../../widgets/Global/internet_error.dart';
|
||||
|
||||
@@ -22,6 +23,7 @@ class _ItemDetailScreenState extends State<ItemDetailScreen> {
|
||||
bool isInit = true;
|
||||
bool isEmpty = false;
|
||||
ItemDetailObject? datas;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() async {
|
||||
if (isInit) {
|
||||
@@ -50,11 +52,22 @@ class _ItemDetailScreenState extends State<ItemDetailScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Items', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'Items',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -86,6 +99,7 @@ class _ItemDetailScreenState extends State<ItemDetailScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import '../../config/routes.dart';
|
||||
import '../../models/label_models.dart';
|
||||
import '../../providers/connectivity.dart';
|
||||
import '../../providers/labels.dart';
|
||||
@@ -20,6 +21,7 @@ class _LabelDetailScreenState extends State<LabelDetailScreen> {
|
||||
bool isEmpty = false;
|
||||
bool isInit = true;
|
||||
LabelDetailsObject? datas;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() async {
|
||||
if (isInit) {
|
||||
@@ -50,11 +52,22 @@ class _LabelDetailScreenState extends State<LabelDetailScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Labels', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'Labels',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -84,6 +97,7 @@ class _LabelDetailScreenState extends State<LabelDetailScreen> {
|
||||
: ConnectionErrorBox();
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ class _MyItemsDetailScreenState extends State<MyItemsDetailScreen> {
|
||||
bool isInit = true;
|
||||
bool isEmpty = false;
|
||||
ItemDetailObject? datas;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() async {
|
||||
if (isInit) {
|
||||
@@ -51,11 +52,22 @@ class _MyItemsDetailScreenState extends State<MyItemsDetailScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('My Items', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'My Items',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -92,6 +104,7 @@ class _MyItemsDetailScreenState extends State<MyItemsDetailScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
||||
class ItemsTransferScreen extends StatefulWidget {
|
||||
final bool? isAdmin;
|
||||
final ItemDetailObject? items;
|
||||
@@ -80,7 +79,13 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _deviceWidth = _media.size.width;
|
||||
final double _deviceBlockSize = _deviceWidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
@@ -133,7 +138,8 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
textInputType: TextInputType.visiblePassword,
|
||||
onChanged: (value) {
|
||||
Provider.of<UsersProvider>(context, listen: false)
|
||||
Provider.of<UsersProvider>(context,
|
||||
listen: false)
|
||||
.searchUsers(value);
|
||||
},
|
||||
),
|
||||
@@ -223,7 +229,8 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
||||
SizedBox(
|
||||
height: 10.0,
|
||||
),
|
||||
ItemCard(_deviceBlockSize, itemData!),
|
||||
ItemCard(
|
||||
_deviceBlockSize, itemData!),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
@@ -237,8 +244,8 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
||||
TransferDataBox(
|
||||
deviceBlockSize:
|
||||
_deviceBlockSize,
|
||||
user:
|
||||
Provider.of<UsersProvider>(
|
||||
user: Provider.of<
|
||||
UsersProvider>(
|
||||
context)
|
||||
.selectedUserForItems,
|
||||
)
|
||||
@@ -285,7 +292,8 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
||||
);
|
||||
},
|
||||
text: 'Transfer',
|
||||
isLoadingButton: myItemProvider
|
||||
isLoadingButton:
|
||||
myItemProvider
|
||||
.isloadingButton,
|
||||
);
|
||||
},
|
||||
@@ -317,6 +325,7 @@ class _ItemsTransferScreenState extends State<ItemsTransferScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class _MyPackagesDetailScreenState extends State<MyPackagesDetailScreen> {
|
||||
bool isInit = true;
|
||||
bool isEmpty = false;
|
||||
PackageDetailObject? datas;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() async {
|
||||
if (isInit) {
|
||||
@@ -51,11 +52,22 @@ class _MyPackagesDetailScreenState extends State<MyPackagesDetailScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _deviceWidth = _media.size.width;
|
||||
final double _deviceBlockSize = _deviceWidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('My Packages', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'My Packages',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -92,6 +104,7 @@ class _MyPackagesDetailScreenState extends State<MyPackagesDetailScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import 'package:provider/provider.dart';
|
||||
class PackageTransferScreen extends StatefulWidget {
|
||||
final bool? isAdmin;
|
||||
final PackageDetailObject? packages;
|
||||
|
||||
const PackageTransferScreen({
|
||||
super.key,
|
||||
this.isAdmin,
|
||||
@@ -73,7 +74,13 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _deviceWidth = _media.size.width;
|
||||
final double _deviceBlockSize = _deviceWidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
@@ -81,7 +88,12 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Package Details', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'Package Details',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -121,7 +133,8 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
textInputType: TextInputType.visiblePassword,
|
||||
onChanged: (value) {
|
||||
Provider.of<UsersProvider>(context, listen: false)
|
||||
Provider.of<UsersProvider>(context,
|
||||
listen: false)
|
||||
.searchUsers(value);
|
||||
},
|
||||
),
|
||||
@@ -142,10 +155,11 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
|
||||
itemBuilder: (context, index) {
|
||||
return TransferDataBox(
|
||||
deviceBlockSize: _deviceBlockSize,
|
||||
user: userResults.usersBox?[index],
|
||||
user:
|
||||
userResults.usersBox?[index],
|
||||
clickColor: kDarkPurple,
|
||||
isClicked:
|
||||
userResults.selectedUserIndex ==
|
||||
isClicked: userResults
|
||||
.selectedUserIndex ==
|
||||
index,
|
||||
onTap: (userId) {
|
||||
Provider.of<UsersProvider>(
|
||||
@@ -161,11 +175,13 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
|
||||
context,
|
||||
listen: false)
|
||||
.selectedUserForPackages =
|
||||
userResults.usersBox?[index];
|
||||
userResults
|
||||
.usersBox?[index];
|
||||
},
|
||||
);
|
||||
},
|
||||
itemCount: userResults.usersBox?.length,
|
||||
itemCount:
|
||||
userResults.usersBox?.length,
|
||||
shrinkWrap: true,
|
||||
);
|
||||
},
|
||||
@@ -216,7 +232,8 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
|
||||
deviceBlockSize:
|
||||
_deviceBlockSize,
|
||||
user: Provider.of<
|
||||
UsersProvider>(context)
|
||||
UsersProvider>(
|
||||
context)
|
||||
.selectedUserForPackages,
|
||||
)
|
||||
],
|
||||
@@ -273,6 +290,7 @@ class _PackageTransferScreenState extends State<PackageTransferScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,13 @@ class _PackageDetailScreenState extends State<PackageDetailScreen> {
|
||||
final _media = MediaQuery.of(context);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
@@ -98,6 +104,7 @@ class _PackageDetailScreenState extends State<PackageDetailScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import '../../config/routes.dart';
|
||||
import '../../providers/connectivity.dart';
|
||||
import '../../providers/test_results.dart';
|
||||
import '../../widgets/Global/internet_error.dart';
|
||||
@@ -18,6 +19,7 @@ class TestDetailsScreen extends StatefulWidget {
|
||||
class _TestDetailsScreenState extends State<TestDetailsScreen> {
|
||||
bool isInit = true;
|
||||
Map<String, Object>? datas;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() async {
|
||||
if (isInit) {
|
||||
@@ -42,11 +44,22 @@ class _TestDetailsScreenState extends State<TestDetailsScreen> {
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
// print(datas);
|
||||
return SafeArea(
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (didPop) {
|
||||
if (didPop) return;
|
||||
Navigator.of(context).pushNamed(Routes.homePage);
|
||||
},
|
||||
child: SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: -10,
|
||||
title: Text('Test Results', style: TextStyle(color: Colors.white,),),
|
||||
title: Text(
|
||||
'Test Results',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -74,6 +87,7 @@ class _TestDetailsScreenState extends State<TestDetailsScreen> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user