add sigin notification

This commit is contained in:
Sai Naw Wun
2020-09-20 08:06:14 +06:30
parent cb622b004b
commit 139fc8e7d3
8 changed files with 39 additions and 21 deletions

3
.gitignore vendored
View File

@@ -43,3 +43,6 @@ app.*.map.json
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
android/key.properties
android/key.jks
android/app/src/prod/AndroidManifest.xml
android/app/src/prod/google-services.json
android/app/src/prod/res/values/strings.xml

View File

@@ -18,6 +18,7 @@ const page_buying_instructions = "buying_instructions";
// Message type
const message_type_package = "t_p";
const message_type_profile = "t_profile";
//////////////////////////////

View File

@@ -1,10 +1,15 @@
import 'package:fcs/fcs/common/domain/constants.dart';
import 'package:fcs/fcs/common/domain/entities/package.dart';
import 'package:fcs/fcs/common/domain/entities/user.dart';
import 'package:fcs/fcs/common/domain/vo/message.dart';
import 'package:fcs/fcs/common/helpers/theme.dart';
import 'package:fcs/fcs/common/pages/chat/model/message_model.dart';
import 'package:fcs/fcs/common/pages/customer/customer_editor.dart';
import 'package:fcs/fcs/common/pages/customer/model/customer_model.dart';
import 'package:fcs/fcs/common/pages/model/main_model.dart';
import 'package:fcs/fcs/common/pages/package/model/package_model.dart';
import 'package:fcs/fcs/common/pages/package/package_info.dart';
import 'package:fcs/fcs/common/pages/profile/profile_page.dart';
import 'package:fcs/fcs/common/pages/util.dart';
import 'package:fcs/fcs/common/pages/widgets/bottom_up_page_route.dart';
import 'package:flutter/material.dart';
@@ -168,5 +173,20 @@ class MessageDetail extends StatelessWidget {
Package p = await packageModel.getPackage(message.messageID);
Navigator.push<bool>(context, BottomUpPageRoute(PackageInfo(package: p)));
}
if (message.messageType == message_type_profile &&
message.messageID != null &&
message.messageID != "") {
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
if (mainModel.user.isCustomer()) {
Navigator.push<bool>(context, BottomUpPageRoute(Profile()));
} else {
CustomerModel customerModel =
Provider.of<CustomerModel>(context, listen: false);
User user = await customerModel.getUser(message.messageID);
Navigator.of(context)
.push(BottomUpPageRoute(CustomerEditor(customer: user)));
}
}
}
}

View File

@@ -70,16 +70,16 @@ class _CustomerEditorState extends State<CustomerEditor> {
child: ListView(
children: <Widget>[
phoneNumberBox,
DisplayText(
text: widget.customer.status,
labelText: getLocalString(context, "customer.status"),
iconData: Icons.add_alarm,
),
DisplayText(
text: widget.customer.fcsID,
labelText: getLocalString(context, "customer.fcs.id"),
icon: FcsIDIcon(),
),
DisplayText(
text: widget.customer.status,
labelText: getLocalString(context, "customer.status"),
iconData: Icons.add_alarm,
),
SizedBox(
height: 20,
),

View File

@@ -421,16 +421,6 @@ class _HomePageState extends State<HomePage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
user.requested
? Container(
padding: const EdgeInsets.all(8.0),
child: Text(
getLocalString(
context, "home.invitation.request.msg"),
style: TextStyle(color: Colors.white70),
),
)
: Container(),
Expanded(
child: ListView(children: [
Wrap(

View File

@@ -171,6 +171,7 @@ class MainModel extends ChangeNotifier {
if (authResult != null &&
authResult.authStatus == AuthStatus.AUTH_VERIFIED) {
this.user = await Services.instance.authService.getUser();
uploadMsgToken();
}
return authResult;
}

View File

@@ -157,6 +157,11 @@ class _ProfileState extends State<Profile> {
phonenumberbox,
fcsIDBox,
usaShippingAddressBox,
DisplayText(
text: mainModel.user.status,
labelText: getLocalString(context, "customer.status"),
iconData: Icons.add_alarm,
),
// getShippingAddressList(context),
],
),

View File

@@ -1,7 +1,6 @@
import 'package:fcs/config.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:fcs/config.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'app.dart';
@@ -10,10 +9,9 @@ void main() {
Config(
flavor: Flavor.PRODUCTION,
color: Colors.blue,
apiURL:
"https://asia-northeast1-mokkon-wholesale-dev.cloudfunctions.net/APIOK",
reportURL: "http://petrok-dev.mokkon.com:8080",
reportProjectID: "prod",
apiURL: "https://asia-northeast1-fcs-prod1.cloudfunctions.net/API",
reportURL: "http://petrok.mokkon.com:8092",
reportProjectID: "fcs-prod",
level: Level.ALL);
runApp(App());
}