Merge branch 'master' of sma/fcs into master
This commit is contained in:
@@ -31,6 +31,9 @@
|
|||||||
"Welcome Start ================================================================":"",
|
"Welcome Start ================================================================":"",
|
||||||
"welcome.signin":"Sign In",
|
"welcome.signin":"Sign In",
|
||||||
"welcome.msg":"Welcome to FCS!",
|
"welcome.msg":"Welcome to FCS!",
|
||||||
|
"welcome.pinlogin":"Login",
|
||||||
|
"welcome.pinlogin.fcsid":"Enter FCS ID",
|
||||||
|
"welcome.pinlogin.pin":"Enter Your PIN",
|
||||||
"Welcome End ================================================================":"",
|
"Welcome End ================================================================":"",
|
||||||
|
|
||||||
"Contact Start ================================================================":"",
|
"Contact Start ================================================================":"",
|
||||||
|
|||||||
@@ -29,6 +29,9 @@
|
|||||||
|
|
||||||
"Welcome Start ================================================================":"",
|
"Welcome Start ================================================================":"",
|
||||||
"welcome.signin":"ဝင်မည်",
|
"welcome.signin":"ဝင်မည်",
|
||||||
|
"welcome.pinlogin":"ဝင်ရောက်ပါ",
|
||||||
|
"welcome.pinlogin.fcsid":"FCS ID ကိုရိုက်ထည့်ပါ",
|
||||||
|
"welcome.pinlogin.pin":"သင်၏ pin ကိုထည့်ပါ",
|
||||||
"welcome.msg":"FCS က ကြိုဆိုပါတယ်!",
|
"welcome.msg":"FCS က ကြိုဆိုပါတယ်!",
|
||||||
"Welcome End ================================================================":"",
|
"Welcome End ================================================================":"",
|
||||||
|
|
||||||
|
|||||||
@@ -26,26 +26,35 @@ class DeliveryAddressRow extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
deliveryAddress.fullName!=""
|
||||||
|
?
|
||||||
line(context, deliveryAddress.fullName,
|
line(context, deliveryAddress.fullName,
|
||||||
iconData: MaterialCommunityIcons.account,
|
iconData: MaterialCommunityIcons.account,
|
||||||
color: primaryColor,
|
color: Colors.black,
|
||||||
fontSize: 16),
|
fontSize: 16):SizedBox(),
|
||||||
|
deliveryAddress.phoneNumber!=""
|
||||||
|
?
|
||||||
line(context, deliveryAddress.phoneNumber,
|
line(context, deliveryAddress.phoneNumber,
|
||||||
iconData: Icons.phone, color: primaryColor, fontSize: 16),
|
iconData: Icons.phone, color: Colors.black, fontSize: 16):SizedBox(),
|
||||||
SizedBox(
|
deliveryAddress.addressLine1!=""
|
||||||
height: 5,
|
?
|
||||||
),
|
|
||||||
line(context, deliveryAddress.addressLine1,
|
line(context, deliveryAddress.addressLine1,
|
||||||
iconData: Icons.location_on),
|
iconData: Icons.location_on,color: Colors.black, fontSize: 16):SizedBox(),
|
||||||
|
deliveryAddress.addressLine2!=""
|
||||||
|
?
|
||||||
line(
|
line(
|
||||||
context,
|
context,
|
||||||
deliveryAddress.addressLine2,
|
deliveryAddress.addressLine2,color: Colors.black, fontSize: 16
|
||||||
),
|
):SizedBox(),
|
||||||
|
deliveryAddress.city!=""
|
||||||
|
?
|
||||||
line(
|
line(
|
||||||
context,
|
context,
|
||||||
deliveryAddress.city,
|
deliveryAddress.city,color: Colors.black, fontSize: 16
|
||||||
),
|
):SizedBox(),
|
||||||
line(context, deliveryAddress.state),
|
deliveryAddress.state!=""
|
||||||
|
?
|
||||||
|
line(context, deliveryAddress.state,color: Colors.black, fontSize: 16):SizedBox(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:fcs/domain/entities/package.dart';
|
|||||||
import 'package:fcs/domain/entities/user.dart';
|
import 'package:fcs/domain/entities/user.dart';
|
||||||
import 'package:fcs/helpers/shared_pref.dart';
|
import 'package:fcs/helpers/shared_pref.dart';
|
||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
import 'package:fcs/localization/transalation.dart';
|
|
||||||
import 'package:fcs/pages/carton/carton_list.dart';
|
import 'package:fcs/pages/carton/carton_list.dart';
|
||||||
import 'package:fcs/pages/chat/message_detail.dart';
|
import 'package:fcs/pages/chat/message_detail.dart';
|
||||||
import 'package:fcs/pages/chat/model/message_model.dart';
|
import 'package:fcs/pages/chat/model/message_model.dart';
|
||||||
@@ -27,6 +26,7 @@ import 'package:fcs/pages/pickup/pickup_list.dart';
|
|||||||
import 'package:fcs/pages/processing/processing_list.dart';
|
import 'package:fcs/pages/processing/processing_list.dart';
|
||||||
import 'package:fcs/pages/rates/shipment_rates.dart';
|
import 'package:fcs/pages/rates/shipment_rates.dart';
|
||||||
import 'package:fcs/pages/receiving/receiving_list.dart';
|
import 'package:fcs/pages/receiving/receiving_list.dart';
|
||||||
|
import 'package:fcs/pages/signin/pinlogin_page.dart';
|
||||||
import 'package:fcs/pages/staff/staff_list.dart';
|
import 'package:fcs/pages/staff/staff_list.dart';
|
||||||
import 'package:fcs/pages/widgets/badge.dart';
|
import 'package:fcs/pages/widgets/badge.dart';
|
||||||
import 'package:fcs/pages/widgets/bottom_widgets.dart';
|
import 'package:fcs/pages/widgets/bottom_widgets.dart';
|
||||||
@@ -366,25 +366,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
isSelected: isFcs,
|
isSelected: isFcs,
|
||||||
selectedBorderColor: Colors.white24,
|
selectedBorderColor: Colors.white24,
|
||||||
);
|
);
|
||||||
final langToggle = ToggleButtons(
|
|
||||||
children: <Widget>[
|
|
||||||
Image.asset(
|
|
||||||
'icons/flags/png/us.png',
|
|
||||||
package: 'country_icons',
|
|
||||||
fit: BoxFit.fitWidth,
|
|
||||||
width: 25,
|
|
||||||
),
|
|
||||||
Image.asset(
|
|
||||||
'icons/flags/png/mm.png',
|
|
||||||
package: 'country_icons',
|
|
||||||
fit: BoxFit.fitWidth,
|
|
||||||
width: 25,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
onPressed: _langChange,
|
|
||||||
isSelected: languageModel.currentState,
|
|
||||||
selectedBorderColor: Colors.white24,
|
|
||||||
);
|
|
||||||
final signinBtn = TextButton(
|
final signinBtn = TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
@@ -402,6 +384,14 @@ class _HomePageState extends State<HomePage> {
|
|||||||
iconSize: 30,
|
iconSize: 30,
|
||||||
icon: Icon(Icons.account_circle,color: buttonColor,),
|
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,),
|
||||||
|
);
|
||||||
|
|
||||||
var searchInput = Row(children: [
|
var searchInput = Row(children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -478,17 +468,15 @@ class _HomePageState extends State<HomePage> {
|
|||||||
actions: login
|
actions: login
|
||||||
? user.isCustomer()
|
? user.isCustomer()
|
||||||
? <Widget>[
|
? <Widget>[
|
||||||
langToggle,
|
profileBtn,
|
||||||
profileBtn,
|
|
||||||
]
|
]
|
||||||
: <Widget>[
|
: <Widget>[
|
||||||
fcsToggle,
|
fcsToggle,
|
||||||
langToggle,
|
pinLoginBtn,
|
||||||
profileBtn,
|
profileBtn,
|
||||||
]
|
]
|
||||||
: <Widget>[
|
: <Widget>[
|
||||||
langToggle,
|
signinBtn,
|
||||||
signinBtn,
|
|
||||||
]),
|
]),
|
||||||
body: Container(
|
body: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -518,16 +506,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_langChange(index) {
|
|
||||||
var languageModel = Provider.of<LanguageModel>(context, listen: false);
|
|
||||||
languageModel.saveLanguage(Translation().supportedLanguages[index]);
|
|
||||||
setState(() {
|
|
||||||
isSelected.asMap().forEach((i, e) {
|
|
||||||
isSelected[i] = false;
|
|
||||||
});
|
|
||||||
isSelected[index] = !isSelected[index];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
_lookup() async {
|
_lookup() async {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:fcs/pages/widgets/defalut_delivery_address.dart';
|
|||||||
import 'package:fcs/pages/widgets/display_text.dart';
|
import 'package:fcs/pages/widgets/display_text.dart';
|
||||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||||
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
import 'package:fcs/pages/widgets/progress.dart';
|
import 'package:fcs/pages/widgets/progress.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -62,9 +63,11 @@ class _ProfileState extends State<Profile> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
MainModel mainModel = Provider.of<MainModel>(context);
|
MainModel mainModel = Provider.of<MainModel>(context);
|
||||||
|
LanguageModel languageModel = Provider.of<LanguageModel>(context);
|
||||||
if (mainModel.user == null) {
|
if (mainModel.user == null) {
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
|
buildLanguage(languageModel);
|
||||||
DeliveryAddressModel deliveryAddressModel =
|
DeliveryAddressModel deliveryAddressModel =
|
||||||
Provider.of<DeliveryAddressModel>(context);
|
Provider.of<DeliveryAddressModel>(context);
|
||||||
|
|
||||||
@@ -172,6 +175,12 @@ class _ProfileState extends State<Profile> {
|
|||||||
builder: (context) => DeliveryAddressList()));
|
builder: (context) => DeliveryAddressList()));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
buildLanguageWidget(
|
||||||
|
context: context,
|
||||||
|
text: "profile.language",
|
||||||
|
iconData: Icons.language,
|
||||||
|
isEng: languageModel.isEng,
|
||||||
|
),
|
||||||
getPrivilegeBox(context),
|
getPrivilegeBox(context),
|
||||||
SizedBox(height: 15),
|
SizedBox(height: 15),
|
||||||
logoutbutton,
|
logoutbutton,
|
||||||
@@ -183,6 +192,69 @@ class _ProfileState extends State<Profile> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget buildLanguageWidget(
|
||||||
|
{required String text,
|
||||||
|
required BuildContext context,
|
||||||
|
IconData? iconData,
|
||||||
|
required bool isEng}) {
|
||||||
|
return Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(iconData, color: primaryColor),
|
||||||
|
const SizedBox(width: 15),
|
||||||
|
Expanded(
|
||||||
|
child: LocalText(
|
||||||
|
context,
|
||||||
|
text,
|
||||||
|
fontSize: 15.0,
|
||||||
|
color: Colors.black54,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
isEng
|
||||||
|
? Image.asset(
|
||||||
|
'icons/flags/png/us.png',
|
||||||
|
package: 'country_icons',
|
||||||
|
fit: BoxFit.fitWidth,
|
||||||
|
width: 25,
|
||||||
|
)
|
||||||
|
: Image.asset(
|
||||||
|
'icons/flags/png/mm.png',
|
||||||
|
package: 'country_icons',
|
||||||
|
fit: BoxFit.fitWidth,
|
||||||
|
width: 25,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 100,
|
||||||
|
padding: const EdgeInsets.only(left: 15),
|
||||||
|
child: DropdownButton(
|
||||||
|
value: selectedLanguage,
|
||||||
|
underline: const SizedBox(),
|
||||||
|
isExpanded: true,
|
||||||
|
items: languagesList
|
||||||
|
.map<DropdownMenuItem<String>>((String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(
|
||||||
|
value,
|
||||||
|
style: const TextStyle(fontSize: 14),
|
||||||
|
));
|
||||||
|
}).toList(),
|
||||||
|
onChanged: _selectedDropdown)),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_selectedDropdown(selected) {
|
||||||
|
var languageModel = Provider.of<LanguageModel>(context, listen: false);
|
||||||
|
languageModel.saveLanguage(selected);
|
||||||
|
setState(() {
|
||||||
|
selectedLanguage = selected;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Widget getPrivilegeBox(BuildContext context) {
|
Widget getPrivilegeBox(BuildContext context) {
|
||||||
User? user = Provider.of<MainModel>(context, listen: false).user;
|
User? user = Provider.of<MainModel>(context, listen: false).user;
|
||||||
List<Privilege> _privileges =
|
List<Privilege> _privileges =
|
||||||
|
|||||||
127
lib/pages/signin/pinlogin_page.dart
Normal file
127
lib/pages/signin/pinlogin_page.dart
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import 'package:fcs/helpers/theme.dart';
|
||||||
|
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||||
|
import 'package:fcs/pages/widgets/local_button.dart';
|
||||||
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
|
import 'package:fcs/pages/widgets/progress.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
||||||
|
|
||||||
|
class PinLoginPage extends StatefulWidget {
|
||||||
|
const PinLoginPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PinLoginPage> createState() => _PinLoginPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PinLoginPageState extends State<PinLoginPage> {
|
||||||
|
bool _isLoading = false;
|
||||||
|
late String pin;
|
||||||
|
late bool allNumberEntered;
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
pin = "";
|
||||||
|
allNumberEntered = false;
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LocalProgress(
|
||||||
|
inAsyncCall: _isLoading,
|
||||||
|
child: new Scaffold(
|
||||||
|
appBar: LocalAppBar(
|
||||||
|
backgroundColor: null,
|
||||||
|
arrowColor: Colors.black,
|
||||||
|
),
|
||||||
|
body: _buildLogin(context)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildLogin(BuildContext context) {
|
||||||
|
return ListView(
|
||||||
|
padding: EdgeInsets.only(top: 20, left: 15, right: 15, bottom: 20),
|
||||||
|
children: <Widget>[
|
||||||
|
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: <Widget>[
|
||||||
|
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user