63 lines
2.2 KiB
Dart
63 lines
2.2 KiB
Dart
import 'dart:ui';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:manager_app/Components/rounded_button.dart';
|
|
import 'package:manager_app/Components/translation_input_container.dart';
|
|
import 'package:manager_app/constants.dart';
|
|
import 'package:manager_api_new/api.dart';
|
|
import 'package:collection/collection.dart';
|
|
|
|
showMultiStringInputHTML (String label, String modalLabel, bool isTitle, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, bool isAudio, BuildContext context) {
|
|
showDialog(
|
|
builder: (BuildContext context) {
|
|
return AlertDialog(
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
|
),
|
|
title: Center(child: Text(modalLabel)),
|
|
content: SingleChildScrollView(
|
|
child: TranslationInputContainer(isTitle: isTitle, values: values, newValues: newValues, onGetResult: onGetResult, maxLines: maxLines, isAudio: isAudio)
|
|
),
|
|
actions: <Widget>[
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
Container(
|
|
width: 180,
|
|
height: 70,
|
|
child: RoundedButton(
|
|
text: "Annuler",
|
|
icon: Icons.undo,
|
|
color: kSecond,
|
|
press: () {
|
|
onGetResult(values);
|
|
Navigator.of(context).pop();
|
|
},
|
|
fontSize: 20,
|
|
),
|
|
),
|
|
Container(
|
|
width: 180,
|
|
height: 70,
|
|
child: RoundedButton(
|
|
text: "Valider",
|
|
icon: Icons.check,
|
|
color: kPrimaryColor,
|
|
textColor: kWhite,
|
|
press: () {
|
|
Function deepEq = const DeepCollectionEquality().equals;
|
|
if (!deepEq(values, newValues)) {
|
|
onGetResult(newValues);
|
|
}
|
|
Navigator.of(context).pop();
|
|
},
|
|
fontSize: 20,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}, context: context
|
|
);
|
|
}
|