mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 00:51:19 +00:00
41 lines
1018 B
Dart
41 lines
1018 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:myhomie_app/Components/Custom_Navigation_Bar/custom_nav_item.dart';
|
|
import 'package:myhomie_app/Models/homieContext.dart';
|
|
|
|
class Index with ChangeNotifier {
|
|
int _index = 0;
|
|
HomieAppContext _homieAppContext = new HomieAppContext();
|
|
|
|
Index(this._index, this._homieAppContext);
|
|
|
|
getIndex() => _index;
|
|
setIndex(int index) {
|
|
_index = index;
|
|
notifyListeners();
|
|
}
|
|
|
|
getTitle() {
|
|
switch(NavItemIcon.values[_index]) {
|
|
case NavItemIcon.home:
|
|
return "Home";
|
|
case NavItemIcon.security:
|
|
return "Security";
|
|
case NavItemIcon.automations:
|
|
return "Automations";
|
|
case NavItemIcon.energy:
|
|
return "Energy";
|
|
case NavItemIcon.profile:
|
|
return "Profile";
|
|
/*case NavItemIcon.profile:
|
|
if (_homieAppContext == null) {
|
|
return '';
|
|
}
|
|
if (_homieAppContext.userId == null) {
|
|
return 'null';
|
|
}
|
|
return _homieAppContext.userId;
|
|
break;*/
|
|
}
|
|
}
|
|
|
|
} |