This commit is contained in:
PhyoThandar
2020-05-29 15:57:08 +06:30
10 changed files with 230 additions and 78 deletions

17
android/.project Normal file
View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/usr/lib/jvm/java-8-openjdk-amd64
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true

6
android/app/.classpath Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

23
android/app/.project Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1

BIN
assets/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -6,7 +6,7 @@ import 'app.dart';
void main() {
Config(
flavor: Flavor.DEV,
flavor: Flavor.PRODUCTION,
color: Colors.blue,
apiURL:
"https://asia-northeast1-mokkon-wholesale-dev.cloudfunctions.net/APIOK",

View File

@@ -1,15 +1,4 @@
import 'dart:async';
import 'package:fcs/pages/fcs_profile_page.dart';
import 'package:fcs/pages/pickup_list.dart';
import 'package:fcs/pages/shipment_rates.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
import 'dart:math' as math;
import 'package:fcs/charts/bar_chart.dart';
import 'package:fcs/charts/delivery_do_line.dart';
import 'package:fcs/charts/delivery_do_summary.dart';
@@ -18,42 +7,40 @@ import 'package:fcs/charts/delivery_summary.dart';
import 'package:fcs/charts/do_line.dart';
import 'package:fcs/charts/po_balance_chart.dart';
import 'package:fcs/charts/po_line.dart';
import 'package:fcs/charts/quota.dart';
import 'package:fcs/charts/revenue_line.dart';
import 'package:fcs/model/language_model.dart';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/notification_model.dart';
import 'package:fcs/model/product_model.dart';
import 'package:fcs/pages/banks/banks.dart';
import 'package:fcs/pages/buyer_list.dart';
import 'package:fcs/pages/contact.dart';
import 'package:fcs/pages/delivery/delivery_list.dart';
import 'package:fcs/pages/manual/manual_page.dart';
import 'package:fcs/pages/my_registeration_info.dart';
import 'package:fcs/pages/notification_list.dart';
import 'package:fcs/pages/pin_login_dialog.dart';
import 'package:fcs/pages/settings.dart';
import 'package:fcs/pages/term.dart';
import 'package:fcs/pages/test_list.dart';
import 'package:fcs/pages/util.dart';
import 'package:fcs/reports/report_list.dart';
import 'package:fcs/vo/user.dart';
import 'package:fcs/widget/badge.dart';
import 'package:fcs/widget/banner.dart';
import 'package:fcs/widget/local_text.dart';
import 'package:fcs/widget/localization/app_translations.dart';
import 'package:fcs/widget/offline_redirect.dart';
import 'package:fcs/vo/notification.dart' as Noti;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
import '../theme/theme.dart';
import 'announcement_list.dart';
import 'do/do_list.dart';
import 'employee_list.dart';
import 'my_registeration.dart';
import 'fcs_profile_page.dart';
import 'pd/pd_list.dart';
import 'po/po_submission_list.dart';
import 'pickup_list.dart';
import 'products_list.dart';
import 'profile_page.dart';
import 'shipment_rates.dart';
import 'storage/storage_list.dart';
import 'user_list.dart';
@@ -91,7 +78,8 @@ class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
final helpBtn = _buildBtn("manual.title",
final helpBtn = _buildBtn2("manual.title",
icon: FontAwesomeIcons.readme,
imgIcon: Image.asset(
"assets/manual.png",
width: 40,
@@ -103,7 +91,7 @@ class _HomePageState extends State<HomePage> {
// btnCallback: () => Navigator.of(context)
// .push(MaterialPageRoute(builder: (_) => TestList()))
);
final announcementBtn = _buildBtn("announcement.title",
final announcementBtn = _buildBtn2("announcement.title",
icon: Icons.announcement,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => AnnouncementList())));
@@ -118,7 +106,8 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => BuyerList())));
final reportBtn = _buildBtn("report.title",
final reportBtn = _buildBtn2("report.title",
icon: FontAwesomeIcons.paperPlane,
imgIcon: Image.asset(
"assets/report.png",
width: 50,
@@ -211,7 +200,8 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => EmployeeList())));
final termBtn = _buildBtn("term.title",
final termBtn = _buildBtn2("term.title",
icon: FontAwesomeIcons.fileContract,
imgIcon: Image.asset(
"assets/term.png",
width: 40,
@@ -237,7 +227,7 @@ class _HomePageState extends State<HomePage> {
);
});
final _bankAccountsBtn = _buildBtn("banks.title",
final _bankAccountsBtn = _buildBtn2("banks.title",
icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
Navigator.push(
context,
@@ -361,10 +351,11 @@ class _HomePageState extends State<HomePage> {
child: FlavorBanner(
child: Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: primaryColor,
title: ClipRRect(
child: Image.asset("assets/logo.png", height: 40),
borderRadius: new BorderRadius.circular(15.0),
child: Image.asset("assets/logo.jpg", height: 40),
borderRadius: new BorderRadius.circular(35.0),
),
actions: <Widget>[
IconButton(
@@ -375,7 +366,7 @@ class _HomePageState extends State<HomePage> {
);
},
iconSize: 30,
icon: Icon(Icons.phone),
icon: Icon(Icons.notifications),
),
IconButton(
onPressed: () {
@@ -385,53 +376,99 @@ class _HomePageState extends State<HomePage> {
);
},
iconSize: 30,
icon: Icon(Icons.account_circle),
icon: Icon(Icons.tune),
),
]),
body: StaggeredGridView.count(
crossAxisCount: 3,
crossAxisSpacing: 12.0,
mainAxisSpacing: 12.0,
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
children: <Widget>[
_buildTile(
Padding(
padding: const EdgeInsets.all(20.0),
child: productListBox,
),
onTap: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ProductsList())),
),
new GridView.count(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
crossAxisCount: 1,
crossAxisSpacing: 12,
mainAxisSpacing: 12,
padding: EdgeInsets.only(bottom: 5, left: 10, right: 5),
children: widgets,
),
_buildTile(
PageView(
children: chartWidgets,
body: Container(
decoration: BoxDecoration(
gradient:
// RadialGradient(
// center: const Alignment(-0.7, 0.6), // near the top right
// radius: 0.6,
// colors: [
// secondaryColor,
// primaryColor, // yellow sun
// ],
// stops: [0.4, 1.0],
// )
// LinearGradient(
// begin: Alignment.topCenter,
// end: Alignment
// .bottomCenter, // 10% of the width, so there are ten blinds.
// colors: [
// Color(0xd0272262),
// Color(0xfa272262),
// ], // whitish to gray
// ),
SweepGradient(
center: FractionalOffset.centerLeft,
startAngle: 0.0,
endAngle: math.pi * 2,
colors: const <Color>[
secondaryColor,
primaryColor,
secondaryColor,
primaryColor,
secondaryColor,
],
stops: const <double>[0.0, 0.25, 0.5, 0.75, 1.0],
),
),
],
staggeredTiles: [
StaggeredTile.extent(5, 110.0),
StaggeredTile.extent(3, 110.0),
StaggeredTile.extent(3, 250.0),
],
)),
child: ListView(children: [
Wrap(
children: widgets,
),
])
// child: StaggeredGridView.count(
// crossAxisCount: 3,
// crossAxisSpacing: 12.0,
// mainAxisSpacing: 12.0,
// padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
// children: <Widget>[
// _buildTile(
// Padding(
// padding: const EdgeInsets.all(20.0),
// child: productListBox,
// ),
// onTap: () => Navigator.of(context).push(
// MaterialPageRoute(builder: (_) => ProductsList())),
// ),
// new GridView.count(
// shrinkWrap: true,
// scrollDirection: Axis.horizontal,
// crossAxisCount: 1,
// crossAxisSpacing: 12,
// mainAxisSpacing: 12,
// padding: EdgeInsets.only(bottom: 5, left: 10, right: 5),
// children: widgets,
// ),
// Container(
// color:Colors.red
// ),
// _buildTile(
// PageView(
// children: chartWidgets,
// ),
// ),
// ],
// staggeredTiles: [
// StaggeredTile.extent(5, 110.0),
// StaggeredTile.extent(3, 110.0),
// StaggeredTile.extent(3, 250.0),
// ],
// ),
)),
),
);
}
Widget _buildTile(Widget child, {Function() onTap}) {
return Material(
elevation: 30.0,
elevation: 0,
borderRadius: BorderRadius.circular(12.0),
shadowColor: Color(0x802196F3),
// shadowColor: Colors.transparent,
color: Colors.transparent,
child: InkWell(
onTap: onTap != null
? () => onTap()
@@ -478,12 +515,57 @@ class _HomePageState extends State<HomePage> {
);
}
_showNotifications() async {
if (!super.mounted) return;
await Navigator.push(
context,
MaterialPageRoute(builder: (context) => NotificationList()),
Widget _buildBtn2(String title,
{Image imgIcon, IconData icon, BtnCallback btnCallback}) {
var languageModel = Provider.of<LanguageModel>(context);
return Container(
width: 130,
height: 130,
decoration: new BoxDecoration(
color: Colors.transparent, //new Color.fromRGBO(255, 0, 0, 0.0),
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(40.0),
topRight: const Radius.circular(40.0))),
// color: Colors.transparent,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
// Padding(
// padding: EdgeInsets.only(top: 10),
// child: Icon(icon, color: Colors.white, size: 35.0)),
// Padding(padding: EdgeInsets.only(bottom: 10.0)),
ClipOval(
child: Material(
color: Colors.white, // button color
child: InkWell(
splashColor: secondaryColor, // inkwell color
child: SizedBox(
width: 60, height: 60, child: Icon(icon, size: 35)),
onTap: btnCallback,
),
),
),
Text(AppTranslations.of(context).text(title),
style:
// languageModel.isEng
// ?
TextStyle(
color: Colors.white,
fontWeight: FontWeight.normal,
fontSize: 16.0,
fontFamily: "Roboto")
// : TextStyle(
// color: Colors.black,
// fontWeight: FontWeight.w700,
// fontSize: 12.0,
// fontFamily: "MyanmarUnicode")
),
]),
),
);
// Provider.of<NotificationModel>(context, listen: false).seen();
}
}

View File

@@ -94,6 +94,7 @@ class _ProfileState extends State<Profile> {
],
),
));
final phonenumberbox = Container(
height: 45.0,
child: Row(
@@ -319,6 +320,14 @@ class _ProfileState extends State<Profile> {
languageBox,
logoutbutton,
Divider(color: secondaryColor),
Switch(
value: false,
onChanged: (value) {
setState(() {});
},
// activeTrackColor: Colors.lightGreenAccent,
// activeColor: Colors.green,
),
versionbox,
SizedBox(
height: 20,
@@ -332,7 +341,7 @@ class _ProfileState extends State<Profile> {
Widget getPrivilegeBox(BuildContext context) {
var languageModel = Provider.of<LanguageModel>(context);
var userModel = Provider.of<UserModel>(context);
return ListTileTheme(
contentPadding: EdgeInsets.all(0),
child: ExpansionTile(

View File

@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
import 'dart:ui';
import 'package:flutter/cupertino.dart';
const primaryColor = const Color(0xfff00a21);
const secondaryColor = const Color(0xFF0815f1);
const primaryColor = const Color(0xff272262);
const secondaryColor = const Color(0xffff4400);
const thirdColor = const Color(0xFF0700f1);
const nextColor = const Color(0xFFfa833d);
const buttonColor = const Color(0xFFFFFFFF);