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",
|
||||
1,
|
||||
[ResourceType.Audio],
|
||||
context
|
||||
context,
|
||||
true, // IS SELECT
|
||||
false, // IS ADD FALSE only for geopoint for now
|
||||
true // IS REMOVE BUTTON
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
|
||||
@ -76,7 +76,10 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
|
||||
"Sélectionner une ressource",
|
||||
1,
|
||||
widget.inResourceTypes,
|
||||
context
|
||||
context,
|
||||
true, // IS SELECT
|
||||
false, // IS ADD FALSE only for geopoint for now
|
||||
true // IS REMOVE BUTTON
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
|
||||
@ -92,7 +92,10 @@ class _GeoPointContentListState extends State<GeoPointContentList> {
|
||||
"Sélectionner une ressource",
|
||||
1,
|
||||
[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) {
|
||||
setState(() {
|
||||
|
||||
@ -207,7 +207,7 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct
|
||||
}
|
||||
},
|
||||
maxLines: 1,
|
||||
isTitle: true
|
||||
isTitle: false
|
||||
),
|
||||
),
|
||||
Container(
|
||||
|
||||
@ -24,6 +24,7 @@ class _DevicesScreenState extends State<DevicesScreen> {
|
||||
return Container(
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional.topCenter,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
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 bool isImage;
|
||||
final bool isAddButton;
|
||||
final bool isSelect;
|
||||
final bool isRemoveButton;
|
||||
final bool isFilter;
|
||||
final List<ResourceType> resourceTypes;
|
||||
const ResourcesScreen({
|
||||
@ -26,6 +28,8 @@ class ResourcesScreen extends StatefulWidget {
|
||||
this.isImage = false,
|
||||
this.onGetResult,
|
||||
this.isAddButton = true,
|
||||
this.isRemoveButton = false,
|
||||
this.isSelect = false,
|
||||
required this.resourceTypes,
|
||||
this.isFilter = true
|
||||
}) : super(key: key);
|
||||
@ -49,7 +53,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if(snapshot.data != null) {
|
||||
List<ResourceDTO> tempOutput = [];
|
||||
if(!widget.isAddButton) {
|
||||
if(widget.isRemoveButton) {
|
||||
tempOutput.add(ResourceDTO());
|
||||
tempOutput.addAll(new List<ResourceDTO>.from(snapshot.data));
|
||||
} 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,
|
||||
isAddButton: widget.isAddButton,
|
||||
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) {
|
||||
// Main screen
|
||||
if (value.id == null) {
|
||||
@ -93,6 +113,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
||||
// Result for select modal
|
||||
widget.onGetResult!(value);
|
||||
}
|
||||
}
|
||||
});//bodyGrid(tempOutput, size, appContext);
|
||||
} else {
|
||||
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_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;
|
||||
|
||||
var result = await showDialog(
|
||||
@ -21,7 +21,9 @@ dynamic showSelectResourceModal (String text, int maxLines, List<ResourceType> r
|
||||
width: size.width * 0.85,
|
||||
height: size.height * 0.85,
|
||||
child: ResourcesScreen(
|
||||
isAddButton: false,
|
||||
isAddButton: isAddButton,
|
||||
isSelect: isSelect,
|
||||
isRemoveButton: isRemoveButton,
|
||||
onGetResult: (ResourceDTO? resource) {
|
||||
if (resource != null) {
|
||||
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.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 2.0.3+7
|
||||
version: 2.0.4+8
|
||||
|
||||
environment:
|
||||
sdk: ">=3.1.0 <4.0.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user