improvements.

merge-requests/22/head
Sikander Saleem 3 years ago
parent 534aab3ceb
commit 4f37bb9476

@ -1,9 +1,9 @@
class URLs{ class URLs{
URLs._(); URLs._();
static const host2 = "http://194.163.164.213/atoms/api"; static const host2 = "http://194.163.164.213/atoms/api";
// static const host1 = "https://atomsdev.hmg.com/api"; // uat url static const host1 = "https://atomsuat.hmg.com"; // uat url
static const host1 = "http://109.123.243.118:9000"; // static const host1 = "http://109.123.243.118:9000";
static String _baseUrl = "$_host/mobile"; static String _baseUrl = "$_host/mobile";

@ -53,7 +53,7 @@ class NotificationsProvider extends ChangeNotifier{
// userId = 397.toString(); // testing id to view data // userId = 397.toString(); // testing id to view data
try{ try{
response = await get( response = await get(
Uri.parse(host+URLs.getNotifications Uri.parse(URLs.getNotifications
+"?uid=${user.id}" +"?uid=${user.id}"
"&token=${user.token}" "&token=${user.token}"
"&page=${(notifications?.length ?? 0) ~/pageItemNumber}"), "&page=${(notifications?.length ?? 0) ~/pageItemNumber}"),

@ -330,13 +330,13 @@ class _LandPageState extends State<LandPage> {
), ),
], ],
), ),
DrawerItem( // DrawerItem(
icon: Icons.notifications, // icon: Icons.notifications,
title: _subtitle.notifications, // title: _subtitle.notifications,
onPressed: () { // onPressed: () {
Navigator.of(context).pushNamed(NotificationsPage.id); // Navigator.of(context).pushNamed(NotificationsPage.id);
}, // },
), // ),
DrawerItem( DrawerItem(
icon: Icons.mail, icon: Icons.mail,
title: _subtitle.email, title: _subtitle.email,

@ -43,66 +43,54 @@ class _AutoCompletePartsFieldState extends State<AutoCompletePartsField> {
_userProvider = Provider.of<UserProvider>(context); _userProvider = Provider.of<UserProvider>(context);
_partsProvider = Provider.of<PartsProvider>(context); _partsProvider = Provider.of<PartsProvider>(context);
//Subtitle _subtitle = AppLocalization.of(context).subtitle; //Subtitle _subtitle = AppLocalization.of(context).subtitle;
return LoadingManager( return Container(
isLoading: _partsProvider.isLoading, padding: const EdgeInsets.symmetric(
isFailedLoading: _partsProvider.parts == null, horizontal: 16
stateCode: _partsProvider.stateCode, ),
onRefresh: () async { decoration: BoxDecoration(
_partsProvider.reset(); color: Colors.white,
await _partsProvider.getParts( border: Border.all(color:AColors.black),
host: _settingProvider.host, borderRadius: BorderRadius.circular(
user: _userProvider.user, AppStyle.borderRadius * AppStyle.getScaleFactor(context)
);
},
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16
), ),
decoration: BoxDecoration( boxShadow: const [
color: Colors.white, AppStyle.boxShadow
border: Border.all(color:AColors.black), ]
borderRadius: BorderRadius.circular( ),
AppStyle.borderRadius * AppStyle.getScaleFactor(context) child: TypeAheadField<Part>(
), textFieldConfiguration: TextFieldConfiguration(
boxShadow: const [ style: Theme.of(context).textTheme.subtitle1,
AppStyle.boxShadow controller: _controller,
] textAlign: TextAlign.center,
), decoration: const InputDecoration(
child: TypeAheadField<Part>( border: InputBorder.none,
textFieldConfiguration: TextFieldConfiguration( disabledBorder: InputBorder.none,
style: Theme.of(context).textTheme.subtitle1, focusedBorder: InputBorder.none,
controller: _controller, enabledBorder: InputBorder.none,
textAlign: TextAlign.center,
decoration: const InputDecoration(
border: InputBorder.none,
disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
textInputAction: TextInputAction.search,
),
suggestionsCallback: (vale) async {
return await _partsProvider.getPartsList(
host: _settingProvider.host,
title: vale
);
},
itemBuilder: (context, part) {
return ListTile(
title: Text(part.code),
subtitle: Text(part.name, style: Theme.of(context).textTheme.caption,),
);
},
onSuggestionSelected: (part) {
if(widget.clearAfterPick){
_controller.clear();
} else{
_controller.text = part.code;
}
widget.onPick(part);
},
), ),
textInputAction: TextInputAction.search,
), ),
suggestionsCallback: (vale) async {
return await _partsProvider.getPartsList(
host: _settingProvider.host,
title: vale
);
},
itemBuilder: (context, part) {
return ListTile(
title: Text(part.code),
subtitle: Text(part.name, style: Theme.of(context).textTheme.caption,),
);
},
onSuggestionSelected: (part) {
if(widget.clearAfterPick){
_controller.clear();
} else{
_controller.text = part.code;
}
widget.onPick(part);
},
),
); );
} }
} }

Loading…
Cancel
Save