Update tarif to title (more char) + add image geopoint
This commit is contained in:
parent
c880d43a35
commit
e5a2d4f06a
@ -71,7 +71,10 @@ class _AudioInputContainerState extends State<AudioInputContainer> {
|
|||||||
"Sélectionner une ressource",
|
"Sélectionner une ressource",
|
||||||
1,
|
1,
|
||||||
[ResourceType.Audio],
|
[ResourceType.Audio],
|
||||||
context
|
context,
|
||||||
|
true, // IS SELECT
|
||||||
|
false, // IS ADD FALSE only for geopoint for now
|
||||||
|
true // IS REMOVE BUTTON
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|||||||
@ -76,7 +76,10 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
|
|||||||
"Sélectionner une ressource",
|
"Sélectionner une ressource",
|
||||||
1,
|
1,
|
||||||
widget.inResourceTypes,
|
widget.inResourceTypes,
|
||||||
context
|
context,
|
||||||
|
true, // IS SELECT
|
||||||
|
false, // IS ADD FALSE only for geopoint for now
|
||||||
|
true // IS REMOVE BUTTON
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|||||||
@ -92,7 +92,10 @@ class _GeoPointContentListState extends State<GeoPointContentList> {
|
|||||||
"Sélectionner une ressource",
|
"Sélectionner une ressource",
|
||||||
1,
|
1,
|
||||||
[ResourceType.Image, ResourceType.ImageUrl, ResourceType.Video, ResourceType.VideoUrl, ResourceType.Audio],
|
[ResourceType.Image, ResourceType.ImageUrl, ResourceType.Video, ResourceType.VideoUrl, ResourceType.Audio],
|
||||||
context
|
context,
|
||||||
|
true, // IS SELECT TRUE
|
||||||
|
true, // IS ADD - only for geopoint for now
|
||||||
|
false // IS REMOVE BUTTON
|
||||||
);
|
);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@ -207,7 +207,7 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
isTitle: true
|
isTitle: false
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -24,6 +24,7 @@ class _DevicesScreenState extends State<DevicesScreen> {
|
|||||||
return Container(
|
return Container(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: AlignmentDirectional.topCenter,
|
alignment: AlignmentDirectional.topCenter,
|
||||||
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
if(managerAppContext.pinCode != null)
|
if(managerAppContext.pinCode != null)
|
||||||
@ -75,6 +76,7 @@ class _DevicesScreenState extends State<DevicesScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,8 @@ class ResourcesScreen extends StatefulWidget {
|
|||||||
final Function? onGetResult; //return ResourceDTO
|
final Function? onGetResult; //return ResourceDTO
|
||||||
final bool isImage;
|
final bool isImage;
|
||||||
final bool isAddButton;
|
final bool isAddButton;
|
||||||
|
final bool isSelect;
|
||||||
|
final bool isRemoveButton;
|
||||||
final bool isFilter;
|
final bool isFilter;
|
||||||
final List<ResourceType> resourceTypes;
|
final List<ResourceType> resourceTypes;
|
||||||
const ResourcesScreen({
|
const ResourcesScreen({
|
||||||
@ -26,6 +28,8 @@ class ResourcesScreen extends StatefulWidget {
|
|||||||
this.isImage = false,
|
this.isImage = false,
|
||||||
this.onGetResult,
|
this.onGetResult,
|
||||||
this.isAddButton = true,
|
this.isAddButton = true,
|
||||||
|
this.isRemoveButton = false,
|
||||||
|
this.isSelect = false,
|
||||||
required this.resourceTypes,
|
required this.resourceTypes,
|
||||||
this.isFilter = true
|
this.isFilter = true
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
@ -49,7 +53,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
|||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
if(snapshot.data != null) {
|
if(snapshot.data != null) {
|
||||||
List<ResourceDTO> tempOutput = [];
|
List<ResourceDTO> tempOutput = [];
|
||||||
if(!widget.isAddButton) {
|
if(widget.isRemoveButton) {
|
||||||
tempOutput.add(ResourceDTO());
|
tempOutput.add(ResourceDTO());
|
||||||
tempOutput.addAll(new List<ResourceDTO>.from(snapshot.data));
|
tempOutput.addAll(new List<ResourceDTO>.from(snapshot.data));
|
||||||
} else {
|
} else {
|
||||||
@ -61,6 +65,22 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
|||||||
resourceTypesIn: widget.isImage ? resource_types.where((rt) => rt.type == ResourceType.Image || rt.type == ResourceType.ImageUrl).map((rt) => rt.type).toList() : widget.resourceTypes,
|
resourceTypesIn: widget.isImage ? resource_types.where((rt) => rt.type == ResourceType.Image || rt.type == ResourceType.ImageUrl).map((rt) => rt.type).toList() : widget.resourceTypes,
|
||||||
isAddButton: widget.isAddButton,
|
isAddButton: widget.isAddButton,
|
||||||
onSelect: (value) async {
|
onSelect: (value) async {
|
||||||
|
if(widget.isSelect) {
|
||||||
|
if (value.id == null && widget.isAddButton) {
|
||||||
|
List<dynamic>? result = await showNewResource(appContext, context);
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
await create(result[0], result[1], result[2], appContext, context);
|
||||||
|
Future.delayed(Duration(seconds: 2), () {
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
// For refresh
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Result for select modal
|
||||||
|
widget.onGetResult!(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (widget.onGetResult == null) {
|
if (widget.onGetResult == null) {
|
||||||
// Main screen
|
// Main screen
|
||||||
if (value.id == null) {
|
if (value.id == null) {
|
||||||
@ -93,6 +113,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
|||||||
// Result for select modal
|
// Result for select modal
|
||||||
widget.onGetResult!(value);
|
widget.onGetResult!(value);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});//bodyGrid(tempOutput, size, appContext);
|
});//bodyGrid(tempOutput, size, appContext);
|
||||||
} else {
|
} else {
|
||||||
return Text("No data");
|
return Text("No data");
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import 'package:manager_app/Screens/Resources/resources_screen.dart';
|
|||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
import 'package:manager_api_new/api.dart';
|
import 'package:manager_api_new/api.dart';
|
||||||
|
|
||||||
dynamic showSelectResourceModal (String text, int maxLines, List<ResourceType> resourceTypes, BuildContext mainContext) async { /*Function onSelect,*/
|
dynamic showSelectResourceModal (String text, int maxLines, List<ResourceType> resourceTypes, BuildContext mainContext, bool isSelect, bool isAddButton, bool isRemoveButton) async { /*Function onSelect,*/
|
||||||
Size size = MediaQuery.of(mainContext).size;
|
Size size = MediaQuery.of(mainContext).size;
|
||||||
|
|
||||||
var result = await showDialog(
|
var result = await showDialog(
|
||||||
@ -21,7 +21,9 @@ dynamic showSelectResourceModal (String text, int maxLines, List<ResourceType> r
|
|||||||
width: size.width * 0.85,
|
width: size.width * 0.85,
|
||||||
height: size.height * 0.85,
|
height: size.height * 0.85,
|
||||||
child: ResourcesScreen(
|
child: ResourcesScreen(
|
||||||
isAddButton: false,
|
isAddButton: isAddButton,
|
||||||
|
isSelect: isSelect,
|
||||||
|
isRemoveButton: isRemoveButton,
|
||||||
onGetResult: (ResourceDTO? resource) {
|
onGetResult: (ResourceDTO? resource) {
|
||||||
if (resource != null) {
|
if (resource != null) {
|
||||||
var result = resource;
|
var result = resource;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 2.0.3+7
|
version: 2.0.4+8
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.1.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user