ui busy button fix
parent
14d035ecc9
commit
5772a5efab
|
|
@ -30,6 +30,8 @@ PODS:
|
|||
- SwiftProtobuf (1.9.0)
|
||||
- url_launcher (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_linux (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_macos (0.0.1):
|
||||
- Flutter
|
||||
- url_launcher_web (0.0.1):
|
||||
|
|
@ -48,6 +50,7 @@ DEPENDENCIES:
|
|||
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
|
||||
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
|
||||
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
|
||||
|
||||
|
|
@ -82,6 +85,8 @@ EXTERNAL SOURCES:
|
|||
:path: ".symlinks/plugins/sqflite/ios"
|
||||
url_launcher:
|
||||
:path: ".symlinks/plugins/url_launcher/ios"
|
||||
url_launcher_linux:
|
||||
:path: ".symlinks/plugins/url_launcher_linux/ios"
|
||||
url_launcher_macos:
|
||||
:path: ".symlinks/plugins/url_launcher_macos/ios"
|
||||
url_launcher_web:
|
||||
|
|
@ -103,6 +108,7 @@ SPEC CHECKSUMS:
|
|||
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
|
||||
SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932
|
||||
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
|
||||
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
|
||||
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
|
||||
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 10;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 94BM6VL7L8;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
|
@ -531,7 +531,7 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 10;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 94BM6VL7L8;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
|
@ -563,7 +563,7 @@
|
|||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 10;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 94BM6VL7L8;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
|
|
|||
|
|
@ -29,18 +29,38 @@ class HeaderTitle extends StatelessWidget {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text('Пользователь: ${vm.user.email}', overflow: TextOverflow.fade, maxLines: 1, softWrap: false, style: TextStyle(fontSize: 13, color: Colors.black, ),),
|
||||
vm.smena.message !=null
|
||||
? Text(vm.smena.message, style: TextStyle(fontSize: 13, color: redColor) )
|
||||
: vm.smena.startedAt !=null
|
||||
? Text('Смена открыта', overflow: TextOverflow.fade, maxLines: 1, softWrap: false , style: TextStyle(fontSize: 13, color: Colors.black),)
|
||||
: Text('Смена от:', style: TextStyle(fontSize: 13, color: Colors.black),),
|
||||
Text(
|
||||
'Пользователь: ${vm.user.email}',
|
||||
overflow: TextOverflow.fade,
|
||||
maxLines: 1,
|
||||
softWrap: false,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
vm.smena.message != null
|
||||
? Text(vm.smena.message,
|
||||
style: TextStyle(fontSize: 13, color: redColor))
|
||||
: vm.smena.startedAt != null
|
||||
? Text(
|
||||
'Смена открыта',
|
||||
overflow: TextOverflow.fade,
|
||||
maxLines: 1,
|
||||
softWrap: false,
|
||||
style: TextStyle(
|
||||
fontSize: 13, color: Colors.black),
|
||||
)
|
||||
: Text(
|
||||
'',
|
||||
style: TextStyle(
|
||||
fontSize: 13, color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@ class LoginView extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _LoginViewState extends State<LoginView> {
|
||||
|
||||
TextEditingController emailController ;
|
||||
TextEditingController emailController;
|
||||
|
||||
TextEditingController passwordController;
|
||||
|
||||
|
|
@ -45,9 +44,11 @@ class _LoginViewState extends State<LoginView> {
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if(widget.loginModel!=null && widget.loginModel.authType == AuthenticateTypeLogin) {
|
||||
if (widget.loginModel != null &&
|
||||
widget.loginModel.authType == AuthenticateTypeLogin) {
|
||||
emailController = TextEditingController(text: widget.loginModel.login);
|
||||
passwordController = TextEditingController(text: widget.loginModel.password);
|
||||
passwordController =
|
||||
TextEditingController(text: widget.loginModel.password);
|
||||
} else {
|
||||
emailController = TextEditingController();
|
||||
passwordController = TextEditingController();
|
||||
|
|
@ -83,7 +84,14 @@ class _LoginViewState extends State<LoginView> {
|
|||
height: 150,
|
||||
child: Image.asset('assets/images/logo.png'),
|
||||
),
|
||||
Positioned(child: Text('онлайн касса', style: TextStyle(fontWeight: FontWeight.bold),), bottom: 23.0,left: 25.0,),
|
||||
Positioned(
|
||||
child: Text(
|
||||
'онлайн касса',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
bottom: 23.0,
|
||||
left: 25.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
|
|
@ -109,10 +117,13 @@ class _LoginViewState extends State<LoginView> {
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
BusyButton(
|
||||
SizedBox(
|
||||
width: 150,
|
||||
child: BusyButton(
|
||||
title: 'Войти',
|
||||
busy: vm.isLoading,
|
||||
onPressed: _pressBtnEnter,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
@ -134,7 +145,8 @@ class _LoginViewState extends State<LoginView> {
|
|||
}
|
||||
|
||||
_pressBtnEnter() async {
|
||||
if(emailController.text!=null && emailController.text.toLowerCase().trim().startsWith('test')){
|
||||
if (emailController.text != null &&
|
||||
emailController.text.toLowerCase().trim().startsWith('test')) {
|
||||
_apiService.test = true;
|
||||
} else {
|
||||
_apiService.test = false;
|
||||
|
|
@ -158,13 +170,13 @@ class _LoginViewState extends State<LoginView> {
|
|||
// .formatNote); // If a unknown format was scanned this field contains a note
|
||||
if (result.type == ResultType.Barcode &&
|
||||
result.rawContent?.length == 60) {
|
||||
if(result.rawContent.toLowerCase().trim().startsWith('test')){
|
||||
if (result.rawContent.toLowerCase().trim().startsWith('test')) {
|
||||
_apiService.test = true;
|
||||
} else {
|
||||
_apiService.test = false;
|
||||
}
|
||||
Redux.store.dispatch(authenticateToken(result.rawContent));
|
||||
} else if (result.type == ResultType.Error ) {
|
||||
} else if (result.type == ResultType.Error) {
|
||||
_dialogService.showDialog(description: 'Не верный формат QR кода');
|
||||
}
|
||||
} on PlatformException catch (e) {
|
||||
|
|
|
|||
|
|
@ -41,18 +41,19 @@ class _BusyButtonState extends State<BusyButton> {
|
|||
child: InkWell(
|
||||
onTap: widget.busy || !widget.enabled ? null : widget.onPressed,
|
||||
child: AnimatedContainer(
|
||||
height: widget.busy ? 40 : 40,
|
||||
height: widget.busy ? 45 : 45,
|
||||
//width: widget.busy ? 40 : 40,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: widget.busy ? 10 : 25,
|
||||
vertical: widget.busy ? 10 : 15),
|
||||
vertical: widget.busy ? 10 : 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
!widget.busy
|
||||
? Row(
|
||||
? Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
widget.icon != null
|
||||
|
|
@ -70,11 +71,16 @@ class _BusyButtonState extends State<BusyButton> {
|
|||
style: buttonTitleTextStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: CircularProgressIndicator(
|
||||
: SizedBox(
|
||||
width: 30,
|
||||
height: 30,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor:
|
||||
AlwaysStoppedAnimation<Color>(Colors.white)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue