Umstellung auf UTC Timestamp
This commit is contained in:
1 parent
2e3210765c
commit
304cae926e
3 files changed
+109
-66
No files matched your search
@@ -1,9 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:stadtbote/tools/util.dart';
|
||||
|
||||
showZipPopup(BuildContext context, String text, String buttonText, Function(String) onFinished) async {
|
||||
showZipPopup(BuildContext context, String text, String buttonText,
|
||||
Function(String) onFinished) async {
|
||||
final TextEditingController textEditingController = TextEditingController();
|
||||
final FocusNode focusNode = FocusNode();
|
||||
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
@@ -16,49 +22,65 @@ showZipPopup(BuildContext context, String text, String buttonText, Function(Stri
|
||||
}
|
||||
},
|
||||
child: AlertDialog(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) {
|
||||
TextEditingController textEditingController = TextEditingController();
|
||||
contentPadding: EdgeInsets.zero,
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
content: StatefulBuilder(
|
||||
builder: (BuildContext context, StateSetter setState) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (context.mounted && !focusNode.hasFocus) {
|
||||
focusNode.requestFocus();
|
||||
}
|
||||
});
|
||||
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 293,
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: Container(
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(text, style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 20),
|
||||
Util.getDefaultTextField('Postleitzahl',
|
||||
formatter: [DecimalTextInputFormatter(maxLength: 5, decimalPlaces: 0)],
|
||||
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
|
||||
controller: textEditingController,
|
||||
autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton(
|
||||
buttonText,
|
||||
() => {
|
||||
if (_checkInput(context, textEditingController.text))
|
||||
{Navigator.of(context).pop(), onFinished(textEditingController.text)},
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
})));
|
||||
return SizedBox(
|
||||
key: GlobalKey(),
|
||||
height: 293,
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: Container(
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.white,
|
||||
border: Border.all(
|
||||
color: Colors.grey,
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(35.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(text,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 20),
|
||||
Util.getDefaultTextField('Postleitzahl',
|
||||
formatter: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
LengthLimitingTextInputFormatter(5),
|
||||
],
|
||||
textInputType: TextInputType.number,
|
||||
controller: textEditingController,
|
||||
focusNode: focusNode,
|
||||
autofocus: true),
|
||||
const SizedBox(height: 20),
|
||||
getDefaultButton(
|
||||
buttonText,
|
||||
() => {
|
||||
if (_checkInput(context,
|
||||
textEditingController.text))
|
||||
{
|
||||
Navigator.of(context).pop(),
|
||||
onFinished(
|
||||
textEditingController.text)
|
||||
},
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
})));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user