update ui
This commit is contained in:
@@ -107,8 +107,8 @@ class _HomePageState extends State<HomePage> {
|
||||
}
|
||||
|
||||
_startNotiTimer() async {
|
||||
var _duration = new Duration(milliseconds: 500);
|
||||
new Timer.periodic(_duration, (t) => displayNoti(t));
|
||||
var _duration = Duration(milliseconds: 500);
|
||||
Timer.periodic(_duration, (t) => displayNoti(t));
|
||||
}
|
||||
|
||||
void displayNoti(Timer timer) async {
|
||||
@@ -388,15 +388,15 @@ class _HomePageState extends State<HomePage> {
|
||||
final fcsToggle = ToggleButtons(
|
||||
selectedColor: Colors.white,
|
||||
color: Colors.blue,
|
||||
children: <Widget>[
|
||||
Icon(MaterialCommunityIcons.account_tie, size: 25),
|
||||
],
|
||||
onPressed: (i) => this.setState(() {
|
||||
onPressed: (i) => setState(() {
|
||||
isFcs[0] = !isFcs[0];
|
||||
SharedPref.saveStaffMode(isFcs[0]);
|
||||
}),
|
||||
isSelected: isFcs,
|
||||
selectedBorderColor: Colors.white24,
|
||||
children: <Widget>[
|
||||
Icon(MaterialCommunityIcons.account_tie, size: 25),
|
||||
],
|
||||
);
|
||||
|
||||
final signinBtn = TextButton(
|
||||
@@ -459,64 +459,60 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
);
|
||||
|
||||
var searchInput = Row(children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 3, left: 5, right: 5, top: 3),
|
||||
child: Theme(
|
||||
data: new ThemeData(
|
||||
primaryColor: primaryColor,
|
||||
primaryColorDark: primaryColor,
|
||||
),
|
||||
child: TextField(
|
||||
style: TextStyle(color: Colors.white),
|
||||
controller: _searchCtl,
|
||||
scrollPadding: EdgeInsets.all(0),
|
||||
decoration: new InputDecoration(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.white, width: 1.5),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
borderSide:
|
||||
const BorderSide(color: Colors.white, width: 1.5),
|
||||
),
|
||||
contentPadding: EdgeInsets.only(top: 1, bottom: 1),
|
||||
isDense: true,
|
||||
hintText: getLocalString(context, "home.search"),
|
||||
hintStyle: languageModel.isEng
|
||||
? newLabelStyle(color: Colors.white60)
|
||||
: newLabelStyleMM(color: Colors.white60),
|
||||
prefixIcon: const Icon(
|
||||
Icons.search,
|
||||
color: Colors.grey,
|
||||
),
|
||||
suffixIcon: InkWell(
|
||||
onTap: () => {_searchCtl.clear()},
|
||||
child: const Icon(
|
||||
Icons.close,
|
||||
color: Colors.grey,
|
||||
var searchInput = Padding(
|
||||
padding: const EdgeInsets.only(left: 5, right: 5, bottom: 10, top: 5),
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(),
|
||||
child: Theme(
|
||||
data: ThemeData(
|
||||
primaryColor: primaryColor,
|
||||
primaryColorDark: primaryColor,
|
||||
),
|
||||
child: TextField(
|
||||
style: TextStyle(color: Colors.white),
|
||||
controller: _searchCtl,
|
||||
scrollPadding: EdgeInsets.all(0),
|
||||
cursorColor: Colors.white,
|
||||
decoration: InputDecoration(
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
borderSide: BorderSide(color: Colors.white60, width: 1.5),
|
||||
),
|
||||
),
|
||||
suffixStyle: const TextStyle(color: primaryColor)),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
borderSide: BorderSide(color: Colors.white60, width: 1.5),
|
||||
),
|
||||
contentPadding: EdgeInsets.only(top: 1, bottom: 1),
|
||||
isDense: true,
|
||||
hintText: getLocalString(context, "home.search"),
|
||||
hintStyle: languageModel.isEng
|
||||
? newLabelStyle(color: Colors.grey)
|
||||
: newLabelStyleMM(color: Colors.grey),
|
||||
prefixIcon: const Icon(Icons.search, color: Colors.grey),
|
||||
suffixIcon: InkWell(
|
||||
onTap: () => {_searchCtl.clear()},
|
||||
child: const Icon(Icons.close, color: Colors.grey),
|
||||
),
|
||||
suffixStyle: const TextStyle(color: primaryColor)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: LocalText(
|
||||
context,
|
||||
"home.search.btn",
|
||||
color: Colors.white,
|
||||
InkWell(
|
||||
onTap: _lookup,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: LocalText(
|
||||
context,
|
||||
"home.search.btn",
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: _lookup,
|
||||
)
|
||||
]);
|
||||
)
|
||||
]),
|
||||
);
|
||||
widgets.insert(0, searchInput);
|
||||
|
||||
return LocalProgress(
|
||||
@@ -528,8 +524,8 @@ class _HomePageState extends State<HomePage> {
|
||||
elevation: 0,
|
||||
backgroundColor: primaryColor,
|
||||
title: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(30.0),
|
||||
child: Image.asset("assets/logo.jpg", height: 40),
|
||||
borderRadius: new BorderRadius.circular(30.0),
|
||||
),
|
||||
actions: login
|
||||
? user.isCustomer()
|
||||
@@ -557,6 +553,7 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 10),
|
||||
Column(children: [
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
|
||||
Reference in New Issue
Block a user