Google GMS in F-Droid build #478
This commit is contained in:
parent
b585e5ef69
commit
531b88109e
|
|
@ -0,0 +1,24 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
import 'package:pinput/pinput.dart';
|
||||||
|
|
||||||
|
class AppPinput extends StatelessWidget {
|
||||||
|
const AppPinput({Key key, this.onCompleted}) : super(key: key);
|
||||||
|
|
||||||
|
final ValueChanged<String> onCompleted;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final localization = AppLocalization.of(context);
|
||||||
|
|
||||||
|
return Pinput(
|
||||||
|
onCompleted: onCompleted,
|
||||||
|
autofocus: true,
|
||||||
|
length: 6,
|
||||||
|
showCursor: true,
|
||||||
|
androidSmsAutofillMethod: AndroidSmsAutofillMethod.smsUserConsentApi,
|
||||||
|
validator: (value) =>
|
||||||
|
value.isEmpty ? localization.pleaseEnterACode : null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
||||||
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
|
|
||||||
|
class AppPinput extends StatelessWidget {
|
||||||
|
const AppPinput({Key key, this.onCompleted}) : super(key: key);
|
||||||
|
|
||||||
|
final ValueChanged<String> onCompleted;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final localization = AppLocalization.of(context);
|
||||||
|
|
||||||
|
return DecoratedFormField(
|
||||||
|
label: localization.code,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
onChanged: onCompleted,
|
||||||
|
autofocus: true,
|
||||||
|
validator: (value) =>
|
||||||
|
value.isEmpty ? localization.pleaseEnterACode : null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue