2020-05-29 15:53:37 +06:30
|
|
|
import 'dart:math' as math;
|
2020-05-29 07:45:27 +06:30
|
|
|
import 'package:fcs/charts/bar_chart.dart';
|
|
|
|
|
import 'package:fcs/charts/delivery_do_line.dart';
|
|
|
|
|
import 'package:fcs/charts/delivery_do_summary.dart';
|
|
|
|
|
import 'package:fcs/charts/delivery_line.dart';
|
|
|
|
|
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/revenue_line.dart';
|
|
|
|
|
import 'package:fcs/model/language_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/notification_list.dart';
|
|
|
|
|
import 'package:fcs/pages/settings.dart';
|
|
|
|
|
import 'package:fcs/pages/term.dart';
|
|
|
|
|
import 'package:fcs/reports/report_list.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';
|
2020-05-29 15:53:37 +06:30
|
|
|
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';
|
2020-05-29 07:45:27 +06:30
|
|
|
|
|
|
|
|
import '../theme/theme.dart';
|
|
|
|
|
import 'announcement_list.dart';
|
|
|
|
|
import 'do/do_list.dart';
|
|
|
|
|
import 'employee_list.dart';
|
|
|
|
|
import 'pd/pd_list.dart';
|
|
|
|
|
import 'products_list.dart';
|
|
|
|
|
import 'profile_page.dart';
|
|
|
|
|
import 'storage/storage_list.dart';
|
|
|
|
|
import 'user_list.dart';
|
|
|
|
|
|
|
|
|
|
final msgLog = Logger('backgroundMessageHandler');
|
|
|
|
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_HomePageState createState() => _HomePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef BtnCallback();
|
|
|
|
|
|
|
|
|
|
class _HomePageState extends State<HomePage> {
|
|
|
|
|
final log = Logger('_HomePageState');
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void dispose() {
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static final List<String> chartDropdownItems = [
|
|
|
|
|
'Last 7 days',
|
|
|
|
|
'Last month',
|
|
|
|
|
'Last three months'
|
|
|
|
|
];
|
|
|
|
|
String actualDropdown = chartDropdownItems[0];
|
|
|
|
|
int actualChart = 0;
|
|
|
|
|
final numberFormatter = new NumberFormat("#,###");
|
|
|
|
|
|
|
|
|
|
String pin;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2020-05-29 15:53:37 +06:30
|
|
|
final helpBtn = _buildBtn2("manual.title",
|
|
|
|
|
icon: FontAwesomeIcons.readme,
|
2020-05-29 07:45:27 +06:30
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/manual.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => ManualPage()))
|
|
|
|
|
// btnCallback: () => Navigator.of(context)
|
|
|
|
|
// .push(MaterialPageRoute(builder: (_) => TestList()))
|
|
|
|
|
);
|
2020-05-29 15:53:37 +06:30
|
|
|
final announcementBtn = _buildBtn2("announcement.title",
|
2020-05-29 07:45:27 +06:30
|
|
|
icon: Icons.announcement,
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => AnnouncementList())));
|
|
|
|
|
|
|
|
|
|
final buyerBtn = _buildBtn("buyer.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/buyer.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => BuyerList())));
|
|
|
|
|
|
2020-05-29 15:53:37 +06:30
|
|
|
final reportBtn = _buildBtn2("report.title",
|
|
|
|
|
icon: FontAwesomeIcons.paperPlane,
|
2020-05-29 07:45:27 +06:30
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/report.png",
|
|
|
|
|
width: 50,
|
|
|
|
|
height: 50,
|
|
|
|
|
// color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => ReportList())));
|
|
|
|
|
|
|
|
|
|
final myRegBtn = _buildBtn("myreg.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/reg.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 30,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () async {});
|
|
|
|
|
|
|
|
|
|
final posBtn = _buildBtn("po.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/pay.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () {});
|
|
|
|
|
|
|
|
|
|
final dosBtn = _buildBtn("do.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/do.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => DOList())));
|
|
|
|
|
|
|
|
|
|
final deliveryBtn = _buildBtn("delivery.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/truck.png",
|
|
|
|
|
width: 50,
|
|
|
|
|
height: 50,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => DeliveryList())));
|
|
|
|
|
|
|
|
|
|
final storageBtn = _buildBtn("storage.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/inventory.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => StorageList())));
|
|
|
|
|
|
|
|
|
|
final pdosBtn = _buildBtn("pd.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/pdo.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => PDList())));
|
|
|
|
|
|
|
|
|
|
final employeeBtn = _buildBtn("employee.title",
|
|
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/employee.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnCallback: () => Navigator.of(context)
|
|
|
|
|
.push(MaterialPageRoute(builder: (_) => EmployeeList())));
|
|
|
|
|
|
2020-05-29 15:53:37 +06:30
|
|
|
final termBtn = _buildBtn2("term.title",
|
|
|
|
|
icon: FontAwesomeIcons.fileContract,
|
2020-05-29 07:45:27 +06:30
|
|
|
imgIcon: Image.asset(
|
|
|
|
|
"assets/term.png",
|
|
|
|
|
width: 40,
|
|
|
|
|
height: 30,
|
|
|
|
|
color: primaryColor,
|
|
|
|
|
), btnCallback: () {
|
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (context) => Term()));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final userBtn =
|
|
|
|
|
_buildBtn("users.title", icon: Icons.group, btnCallback: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => UserList()),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final settingsBtn =
|
|
|
|
|
_buildBtn("setting.title", icon: Icons.settings, btnCallback: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => Settings()),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-29 15:53:37 +06:30
|
|
|
final _bankAccountsBtn = _buildBtn2("banks.title",
|
2020-05-29 07:45:27 +06:30
|
|
|
icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => BankAccounts()),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
List<Widget> widgets = [helpBtn];
|
|
|
|
|
widgets.add(announcementBtn);
|
|
|
|
|
widgets.add(reportBtn);
|
|
|
|
|
widgets.add(termBtn);
|
|
|
|
|
widgets.add(_bankAccountsBtn);
|
|
|
|
|
|
|
|
|
|
var revenueChart = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[RevenueLineChart()],
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
var productListBox = Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
LocalText(context, 'products.prices', color: primaryColor),
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
LocalText(context, 'products.gas',
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 19,
|
|
|
|
|
fontWeight: FontWeight.w700),
|
|
|
|
|
Consumer<ProductModel>(builder: (context, model, child) {
|
|
|
|
|
return Text(' ${model.products.length}',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 19.0));
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Material(
|
|
|
|
|
color: thirdColor,
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(5.0),
|
|
|
|
|
child: //Icon(Icons.timeline, color: Colors.white, size: 30.0),
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/product.png",
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 70,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
))))
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
var poqtyByProductChart = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[BarChart()],
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
var poChart = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[POLineChart()],
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
var doChart = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[DOLineChart()],
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
var deliveryChart = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[DeliveryBarChart()],
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
var deliveryDOChart = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[DODeliveryLineChart()],
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
var deliveryDoSummary = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[DeliveryDoSummaryChart()],
|
|
|
|
|
));
|
|
|
|
|
var deliverySummary = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[DeliverySummary()],
|
|
|
|
|
));
|
|
|
|
|
var poBalancebyBuyerChart = Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: ListView(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
children: <Widget>[POBalanceChart()],
|
|
|
|
|
));
|
|
|
|
|
List<Widget> chartWidgets = [];
|
|
|
|
|
|
|
|
|
|
return OfflineRedirect(
|
|
|
|
|
child: FlavorBanner(
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
appBar: AppBar(
|
2020-05-29 15:53:37 +06:30
|
|
|
elevation: 0,
|
2020-05-29 07:45:27 +06:30
|
|
|
backgroundColor: primaryColor,
|
|
|
|
|
title: ClipRRect(
|
2020-05-29 15:53:37 +06:30
|
|
|
child: Image.asset("assets/logo.jpg", height: 40),
|
|
|
|
|
borderRadius: new BorderRadius.circular(35.0),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
actions: <Widget>[
|
|
|
|
|
IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => Contact()),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
iconSize: 30,
|
2020-05-29 15:53:37 +06:30
|
|
|
icon: Icon(Icons.notifications),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => Profile()),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
iconSize: 30,
|
2020-05-29 15:53:37 +06:30
|
|
|
icon: Icon(Icons.tune),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
]),
|
2020-05-29 15:53:37 +06:30
|
|
|
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],
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
),
|
2020-05-29 15:53:37 +06:30
|
|
|
child: ListView(children: [
|
|
|
|
|
Wrap(
|
|
|
|
|
children: widgets,
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
2020-05-29 15:53:37 +06:30
|
|
|
])
|
|
|
|
|
// 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),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
)),
|
2020-05-29 07:45:27 +06:30
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildTile(Widget child, {Function() onTap}) {
|
|
|
|
|
return Material(
|
2020-05-29 15:53:37 +06:30
|
|
|
elevation: 0,
|
2020-05-29 07:45:27 +06:30
|
|
|
borderRadius: BorderRadius.circular(12.0),
|
2020-05-29 15:53:37 +06:30
|
|
|
// shadowColor: Colors.transparent,
|
|
|
|
|
color: Colors.transparent,
|
2020-05-29 07:45:27 +06:30
|
|
|
child: InkWell(
|
|
|
|
|
onTap: onTap != null
|
|
|
|
|
? () => onTap()
|
|
|
|
|
: () {
|
|
|
|
|
log.info('Not set yet');
|
|
|
|
|
},
|
|
|
|
|
child: child));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _buildBtn(String title,
|
|
|
|
|
{Image imgIcon, IconData icon, BtnCallback btnCallback}) {
|
|
|
|
|
var languageModel = Provider.of<LanguageModel>(context);
|
|
|
|
|
return _buildTile(
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(5.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
icon != null
|
|
|
|
|
? Material(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 10),
|
|
|
|
|
child: Icon(icon, color: primaryColor, size: 35.0)))
|
|
|
|
|
: Container(
|
|
|
|
|
padding: EdgeInsets.only(top: 3),
|
|
|
|
|
child: imgIcon,
|
|
|
|
|
),
|
|
|
|
|
Padding(padding: EdgeInsets.only(bottom: 10.0)),
|
|
|
|
|
Text(AppTranslations.of(context).text(title),
|
|
|
|
|
style: languageModel.isEng
|
|
|
|
|
? TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 12.0)
|
|
|
|
|
: TextStyle(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 12.0,
|
|
|
|
|
fontFamily: "MyanmarUnicode")),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
onTap: btnCallback,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-29 15:53:37 +06:30
|
|
|
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")
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
2020-05-29 07:45:27 +06:30
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|