modified: lib/src/app/auth/screens/codigoverifica.dart
new file: lib/src/shared/widgets/inputs/code_input.dart modified: linux/flutter/generated_plugin_registrant.cc modified: linux/flutter/generated_plugins.cmake modified: macos/Flutter/GeneratedPluginRegistrant.swift modified: pubspec.lock modified: pubspec.yaml modified: windows/flutter/generated_plugin_registrant.cc modified: windows/flutter/generated_plugins.cmake
This commit is contained in:
parent
1b1d633732
commit
eb28548af8
@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:recomendagro/assets/theme/colors.dart';
|
import 'package:recomendagro/assets/theme/colors.dart';
|
||||||
import 'package:recomendagro/src/shared/utils/responsive/responsive_metrics.dart';
|
import 'package:recomendagro/src/shared/utils/responsive/responsive_metrics.dart';
|
||||||
import 'package:recomendagro/src/shared/widgets/buttons/simple_button.dart';
|
import 'package:recomendagro/src/shared/widgets/buttons/simple_button.dart';
|
||||||
|
import 'package:recomendagro/src/shared/widgets/inputs/code_input.dart';
|
||||||
import '../../../shared/widgets/inputs/simple_input.dart';
|
import '../../../shared/widgets/inputs/simple_input.dart';
|
||||||
|
|
||||||
class CodigoVerificacaoScreen extends ConsumerStatefulWidget {
|
class CodigoVerificacaoScreen extends ConsumerStatefulWidget {
|
||||||
@ -84,17 +86,34 @@ class _CodigoVerificacaoScreenState extends ConsumerState<CodigoVerificacaoScree
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
const SizedBox(height: 30),
|
||||||
width: double.infinity,
|
Row(
|
||||||
child: Text(
|
children: [
|
||||||
"Confirmação de conta",
|
GestureDetector(
|
||||||
textAlign: TextAlign.start,
|
onTap: (){
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
context.pop();
|
||||||
fontWeight: FontWeight.w600,
|
},
|
||||||
color: AppColorLight.text01Color,
|
child: Container(
|
||||||
fontSize: 21
|
decoration: BoxDecoration(
|
||||||
)
|
border: Border.all(width: 1, color: AppColorLight.text04Color),
|
||||||
)
|
borderRadius: BorderRadius.circular(10)
|
||||||
|
),
|
||||||
|
child: Icon(Icons.chevron_left)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
SizedBox(
|
||||||
|
child: Text(
|
||||||
|
"Confirmação de conta",
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColorLight.text01Color,
|
||||||
|
fontSize: 26
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -124,15 +143,15 @@ class _CodigoVerificacaoScreenState extends ConsumerState<CodigoVerificacaoScree
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
SimpleInput(
|
// SimpleInput(
|
||||||
title: 'Código',
|
// title: 'Código',
|
||||||
hintText: 'Informe código',
|
// hintText: 'Informe código',
|
||||||
controller: codeController,
|
|
||||||
validator: true,
|
|
||||||
),
|
|
||||||
// CodeInputController(
|
|
||||||
// controller: codeController,
|
// controller: codeController,
|
||||||
|
// validator: true,
|
||||||
// ),
|
// ),
|
||||||
|
CodeInputController(
|
||||||
|
controller: codeController,
|
||||||
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
ButtonWidget(
|
ButtonWidget(
|
||||||
label: 'Verificar conta',
|
label: 'Verificar conta',
|
||||||
|
77
lib/src/shared/widgets/inputs/code_input.dart
Normal file
77
lib/src/shared/widgets/inputs/code_input.dart
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:pinput/pinput.dart';
|
||||||
|
import 'package:recomendagro/assets/theme/colors.dart';
|
||||||
|
|
||||||
|
class CodeInputController extends StatefulWidget {
|
||||||
|
final TextEditingController controller;
|
||||||
|
final ValueChanged<String>? onCompleted;
|
||||||
|
const CodeInputController({super.key, this.onCompleted, required this.controller});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CodeInputController> createState() => _CodeInputControllerState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CodeInputControllerState extends State<CodeInputController> {
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final focusedBorderColor = Theme.of(context).primaryColor;
|
||||||
|
final defaultPinTheme = PinTheme(
|
||||||
|
width: 56,
|
||||||
|
height: 56,
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontSize: 22,
|
||||||
|
color: AppColorLight.text01Color,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
border: Border.all(width: 2, color: AppColorLight.text04Color),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
child: Directionality(
|
||||||
|
textDirection: TextDirection.ltr,
|
||||||
|
child: Pinput(
|
||||||
|
controller: widget.controller,
|
||||||
|
keyboardType: TextInputType.none,
|
||||||
|
length: 5,
|
||||||
|
androidSmsAutofillMethod: AndroidSmsAutofillMethod.smsUserConsentApi,
|
||||||
|
listenForMultipleSmsOnAndroid: true,
|
||||||
|
defaultPinTheme: defaultPinTheme,
|
||||||
|
onClipboardFound: (value) {
|
||||||
|
widget.controller.setText(value);
|
||||||
|
},
|
||||||
|
hapticFeedbackType: HapticFeedbackType.lightImpact,
|
||||||
|
onCompleted: widget.onCompleted,
|
||||||
|
cursor: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: const EdgeInsets.only(bottom: 9),
|
||||||
|
width: 22,
|
||||||
|
height: 1,
|
||||||
|
color: focusedBorderColor,
|
||||||
|
)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
focusedPinTheme: defaultPinTheme.copyWith(
|
||||||
|
decoration: defaultPinTheme.decoration!.copyWith(
|
||||||
|
border: Border.all(color: focusedBorderColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
submittedPinTheme: defaultPinTheme.copyWith(
|
||||||
|
decoration: defaultPinTheme.decoration!.copyWith(
|
||||||
|
// color: fillColor,
|
||||||
|
border: Border.all(color: focusedBorderColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
errorPinTheme: defaultPinTheme.copyBorderWith(
|
||||||
|
border: Border.all(color: Colors.redAccent),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <smart_auth/smart_auth_plugin.h>
|
||||||
|
|
||||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
g_autoptr(FlPluginRegistrar) smart_auth_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "SmartAuthPlugin");
|
||||||
|
smart_auth_plugin_register_with_registrar(smart_auth_registrar);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
smart_auth
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
@ -8,11 +8,13 @@ import Foundation
|
|||||||
import device_info_plus
|
import device_info_plus
|
||||||
import flutter_image_compress_macos
|
import flutter_image_compress_macos
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
|
import smart_auth
|
||||||
import sqflite
|
import sqflite
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||||
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
|
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
|
SmartAuthPlugin.register(with: registry.registrar(forPlugin: "SmartAuthPlugin"))
|
||||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
}
|
}
|
||||||
|
24
pubspec.lock
24
pubspec.lock
@ -431,6 +431,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "2.2.1"
|
||||||
|
pinput:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: pinput
|
||||||
|
sha256: a92b55ecf9c25d1b9e100af45905385d5bc34fc9b6b04177a9e82cb88fe4d805
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.1"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -485,6 +493,14 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.99"
|
version: "0.0.99"
|
||||||
|
smart_auth:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: smart_auth
|
||||||
|
sha256: a25229b38c02f733d0a4e98d941b42bed91a976cb589e934895e60ccfa674cf6
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.1"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -597,6 +613,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.2"
|
version: "2.2.2"
|
||||||
|
universal_platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: universal_platform
|
||||||
|
sha256: d315be0f6641898b280ffa34e2ddb14f3d12b1a37882557869646e0cc363d0cc
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0+1"
|
||||||
uuid:
|
uuid:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -22,6 +22,7 @@ dependencies:
|
|||||||
flutter_dotenv: ^5.0.2
|
flutter_dotenv: ^5.0.2
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
flutter_riverpod: ^2.4.9
|
flutter_riverpod: ^2.4.9
|
||||||
|
pinput: ^3.0.1
|
||||||
bestapp_package:
|
bestapp_package:
|
||||||
git:
|
git:
|
||||||
url: https://steeve:d442ff0fd7fca09c078f858362b2231b0123d708@repo.besoft.com.br/BeSoft/bestapp_package.git
|
url: https://steeve:d442ff0fd7fca09c078f858362b2231b0123d708@repo.besoft.com.br/BeSoft/bestapp_package.git
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <smart_auth/smart_auth_plugin.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
SmartAuthPluginRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("SmartAuthPlugin"));
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
smart_auth
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
Loading…
x
Reference in New Issue
Block a user