diff --git a/lib/pages/delivery_address/delivery_address_row.dart b/lib/pages/delivery_address/delivery_address_row.dart index c096417..2056ddc 100644 --- a/lib/pages/delivery_address/delivery_address_row.dart +++ b/lib/pages/delivery_address/delivery_address_row.dart @@ -1,7 +1,5 @@ import 'package:fcs/domain/vo/delivery_address.dart'; -import 'package:fcs/helpers/theme.dart'; import 'package:fcs/pages/widgets/local_text.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_vector_icons/flutter_vector_icons.dart'; diff --git a/lib/pages/main/home_page.dart b/lib/pages/main/home_page.dart index e7bd286..c1ad000 100644 --- a/lib/pages/main/home_page.dart +++ b/lib/pages/main/home_page.dart @@ -357,7 +357,7 @@ class _HomePageState extends State { selectedColor: Colors.white, color: Colors.blue, children: [ - Icon(MaterialCommunityIcons.account_tie), + Icon(MaterialCommunityIcons.account_tie,size: 25), ], onPressed: (i) => this.setState(() { isFcs[0] = !isFcs[0]; @@ -366,7 +366,7 @@ class _HomePageState extends State { isSelected: isFcs, selectedBorderColor: Colors.white24, ); - + final signinBtn = TextButton( onPressed: () { Navigator.of(context) @@ -381,16 +381,23 @@ class _HomePageState extends State { onPressed: () { Navigator.of(context).push(RightLeftPageRoute(Profile())); }, - iconSize: 30, - icon: Icon(Icons.account_circle,color: buttonColor,), + iconSize: 25, + icon: Icon( + Icons.account_circle, + color: buttonColor, + ), ); + final pinLoginBtn = IconButton( onPressed: () { Navigator.of(context) .push(CupertinoPageRoute(builder: (context) => PinLoginPage())); }, - iconSize: 30, - icon: Icon(SimpleLineIcons.lock,color: buttonColor,), + iconSize: 25, + icon: Icon( + Icons.lock_outline, + color: buttonColor, + ), ); var searchInput = Row(children: [ @@ -468,15 +475,15 @@ class _HomePageState extends State { actions: login ? user.isCustomer() ? [ - profileBtn, + profileBtn, ] : [ - fcsToggle, pinLoginBtn, + fcsToggle, profileBtn, ] : [ - signinBtn, + signinBtn, ]), body: Container( decoration: BoxDecoration( @@ -506,8 +513,6 @@ class _HomePageState extends State { ); } - - _lookup() async { setState(() { _isLoading = true; @@ -515,7 +520,7 @@ class _HomePageState extends State { try { String term = _searchCtl.text; - if ( term.trim() == "") return; + if (term.trim() == "") return; var packageModel = Provider.of(context, listen: false); Package? package = await packageModel.lookupPackage(term); if (package == null) { diff --git a/lib/pages/signin/pinlogin_page.dart b/lib/pages/signin/pinlogin_page.dart index 87b171f..e03d1e5 100644 --- a/lib/pages/signin/pinlogin_page.dart +++ b/lib/pages/signin/pinlogin_page.dart @@ -16,15 +16,52 @@ class PinLoginPage extends StatefulWidget { class _PinLoginPageState extends State { bool _isLoading = false; late String pin; - late bool allNumberEntered; + TextEditingController _fcsIdCtl = new TextEditingController(); + @override void initState() { pin = ""; - allNumberEntered = false; super.initState(); } Widget build(BuildContext context) { + final fcsIdBox = TextFormField( + controller: _fcsIdCtl, + autofocus: true, + style: TextStyle( + fontSize: 15, color: Colors.black87, fontWeight: FontWeight.w500), + cursorColor: primaryColor, + keyboardType: TextInputType.text, + decoration: new InputDecoration( + contentPadding: EdgeInsets.all(0), + labelStyle: newLabelStyle(color: Colors.black54, fontSize: 17), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: primaryColor, width: 1.0)), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: primaryColor, width: 1.0)), + disabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: primaryColor, width: 1.0)), + ), + ); + + final pinLoginLogo = Container( + width: 70, + height: 70, + child: FittedBox( + child: Image.asset( + "assets/logo.jpg", + ), + fit: BoxFit.fitHeight, + ), + ); + + final loginBtn = Padding( + padding: EdgeInsets.only(top: 30), + child: LocalButton( + textKey: "welcome.pinlogin", + callBack: () {}, + ), + ); return LocalProgress( inAsyncCall: _isLoading, child: new Scaffold( @@ -32,96 +69,52 @@ class _PinLoginPageState extends State { backgroundColor: null, arrowColor: Colors.black, ), - body: _buildLogin(context)), + body: ListView( + padding: EdgeInsets.only(top: 20, left: 15, right: 15, bottom: 20), + children: [ + pinLoginLogo, + Padding( + padding: EdgeInsets.only(top: 20, bottom: 20), + child: Center( + child: LocalText(context, "welcome.pinlogin", + color: Colors.black, fontSize: 18), + ), + ), + LocalText( + context, + "welcome.pinlogin.fcsid", + color: Colors.black54, + fontSize: 15, + ), + fcsIdBox, + Padding( + padding: EdgeInsets.only(top: 25, bottom: 20), + child: LocalText( + context, + "welcome.pinlogin.pin", + color: Colors.black54, + fontSize: 15, + )), + PinInputTextField( + cursor: Cursor( + color: primaryColor, enabled: true, width: 2, height: 23), + pinLength: 6, + decoration: BoxLooseDecoration( + strokeColorBuilder: PinListenColorBuilder( + primaryColor, Colors.grey.shade400)), + textInputAction: TextInputAction.done, + autoFocus: false, + onChanged: _pinChange, + ), + loginBtn, + ], + )), ); } - Widget _buildLogin(BuildContext context) { - return ListView( - padding: EdgeInsets.only(top: 20, left: 15, right: 15, bottom: 20), - children: [ - pinLoginLogo, - Padding( - padding: EdgeInsets.only(top: 20, bottom: 20), - child: Center( - child: LocalText( - context, - "welcome.pinlogin", - color: Colors.black, - fontSize: 18, - ), - ), - ), - LocalText( - context, - "welcome.pinlogin.fcsid", - color: Colors.grey, - ), - fcsIdBox, - Padding( - padding: EdgeInsets.only(top: 20, bottom: 20), - child: LocalText( - context, - "welcome.pinlogin.pin", - color: Colors.grey, - )), - Container( - child: PinInputTextField( - pinLength: 6, - decoration: BoxLooseDecoration( - strokeColorBuilder: PinListenColorBuilder( - primaryColor, Colors.grey.shade400)), - textInputAction: TextInputAction.done, - autoFocus: true, - onChanged: _pinChange, - ), - ), - loginBtn, - ]); - } - - final pinLoginLogo = Container( - width: 70, - height: 70, - child: FittedBox( - child: Image.asset( - "assets/logo.jpg", - ), - fit: BoxFit.fitHeight, - ), - ); - final fcsIdBox = Column( - children: [ - TextFormField( - // controller: controller, - style: textStyle, - cursorColor: primaryColor, - keyboardType: TextInputType.text, - decoration: new InputDecoration( - contentPadding: EdgeInsets.all(0), - labelStyle: newLabelStyle(color: Colors.black54, fontSize: 17), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: primaryColor, width: 1.0)), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide(color: primaryColor, width: 1.0)), - disabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: primaryColor, width: 1.0)), - ), - ), - ], - ); - final loginBtn = Padding( - padding: EdgeInsets.only(top: 30), - child: LocalButton( - textKey: "welcome.pinlogin", - callBack: () {}, - ), - ); - _pinChange(pin) { setState(() { this.pin = pin; - this.allNumberEntered = this.pin.length == 6; }); } } diff --git a/lib/pages/staff/staff_pin_editor.dart b/lib/pages/staff/staff_pin_editor.dart index 34e4c3c..a2a73b6 100644 --- a/lib/pages/staff/staff_pin_editor.dart +++ b/lib/pages/staff/staff_pin_editor.dart @@ -63,7 +63,7 @@ class _StaffPinEditorState extends State { const SizedBox(height: 8), PinInputTextField( cursor: Cursor( - color: primaryColor, enabled: true, width: 2, height: 30), + color: primaryColor, enabled: true, width: 2, height: 23), pinLength: 6, decoration: BoxLooseDecoration( strokeColorBuilder: @@ -82,8 +82,8 @@ class _StaffPinEditorState extends State { const SizedBox(height: 8), PinInputTextField( pinLength: 6, - cursor: Cursor( - color: primaryColor, enabled: true, width: 2, height: 30), + cursor: Cursor( + color: primaryColor, enabled: true, width: 2, height: 23), decoration: BoxLooseDecoration( strokeColorBuilder: PinListenColorBuilder(primaryColor, Colors.grey.shade400)),