|
|
|
|
@ -19,6 +19,7 @@ class GeneralSettings extends StatefulWidget {
|
|
|
|
|
class _GeneralSettings extends State<GeneralSettings>
|
|
|
|
|
with TickerProviderStateMixin {
|
|
|
|
|
var themeNotifier;
|
|
|
|
|
var mediaQueryData;
|
|
|
|
|
int blindValue = 0;
|
|
|
|
|
bool vibration =false;
|
|
|
|
|
bool accsibility =false;
|
|
|
|
|
@ -26,7 +27,6 @@ class _GeneralSettings extends State<GeneralSettings>
|
|
|
|
|
bool location =false;
|
|
|
|
|
var sharedPref = new AppSharedPreferences();
|
|
|
|
|
var permission = new PermissionService();
|
|
|
|
|
var mediaQueryData;
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
getValues();
|
|
|
|
|
@ -81,104 +81,104 @@ class _GeneralSettings extends State<GeneralSettings>
|
|
|
|
|
setState(() {
|
|
|
|
|
accsibility = value;
|
|
|
|
|
});
|
|
|
|
|
//setAccessibility(value);
|
|
|
|
|
permission.openSettings();
|
|
|
|
|
},
|
|
|
|
|
activeTrackColor: Colors.lightGreenAccent,
|
|
|
|
|
activeColor: Colors.green,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).blindMode,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
new Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
child: new Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
new Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
new Text(
|
|
|
|
|
TranslationBase.of(context).offTheme,
|
|
|
|
|
style: new TextStyle(fontSize: 16.0),
|
|
|
|
|
),
|
|
|
|
|
Radio(
|
|
|
|
|
value: 0,
|
|
|
|
|
groupValue: blindValue,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() => {this.blindValue = value});
|
|
|
|
|
setTheme(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
new Text(
|
|
|
|
|
TranslationBase.of(context).invertTheme,
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
new Radio(
|
|
|
|
|
value: 1,
|
|
|
|
|
groupValue: blindValue,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() => {this.blindValue = value});
|
|
|
|
|
setTheme(value);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
new Text(
|
|
|
|
|
TranslationBase.of(context).dimTheme,
|
|
|
|
|
style: new TextStyle(fontSize: 16.0),
|
|
|
|
|
),
|
|
|
|
|
new Radio(
|
|
|
|
|
value: 2,
|
|
|
|
|
groupValue: blindValue,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() => {this.blindValue = value});
|
|
|
|
|
setTheme(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
new Text(
|
|
|
|
|
TranslationBase.of(context).bwTheme,
|
|
|
|
|
style: new TextStyle(fontSize: 16.0),
|
|
|
|
|
),
|
|
|
|
|
new Radio(
|
|
|
|
|
value: 3,
|
|
|
|
|
groupValue: blindValue,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() => {this.blindValue = value});
|
|
|
|
|
|
|
|
|
|
setTheme(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
])),
|
|
|
|
|
// Container(
|
|
|
|
|
// padding: EdgeInsets.all(10),
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context).blindMode,
|
|
|
|
|
// color: Colors.black,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// new Container(
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// padding: EdgeInsets.all(8.0),
|
|
|
|
|
// child: new Column(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// new Column(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// new Text(
|
|
|
|
|
// TranslationBase.of(context).offTheme,
|
|
|
|
|
// style: new TextStyle(fontSize: 16.0),
|
|
|
|
|
// ),
|
|
|
|
|
// Radio(
|
|
|
|
|
// value: 0,
|
|
|
|
|
// groupValue: blindValue,
|
|
|
|
|
// onChanged: (value) {
|
|
|
|
|
// setState(() => {this.blindValue = value});
|
|
|
|
|
// setTheme(value);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// new Text(
|
|
|
|
|
// TranslationBase.of(context).invertTheme,
|
|
|
|
|
// style: new TextStyle(
|
|
|
|
|
// fontSize: 16.0,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// new Radio(
|
|
|
|
|
// value: 1,
|
|
|
|
|
// groupValue: blindValue,
|
|
|
|
|
// onChanged: (value) {
|
|
|
|
|
// setState(() => {this.blindValue = value});
|
|
|
|
|
// setTheme(value);
|
|
|
|
|
// },
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// new Text(
|
|
|
|
|
// TranslationBase.of(context).dimTheme,
|
|
|
|
|
// style: new TextStyle(fontSize: 16.0),
|
|
|
|
|
// ),
|
|
|
|
|
// new Radio(
|
|
|
|
|
// value: 2,
|
|
|
|
|
// groupValue: blindValue,
|
|
|
|
|
// onChanged: (value) {
|
|
|
|
|
// setState(() => {this.blindValue = value});
|
|
|
|
|
// setTheme(value);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// new Text(
|
|
|
|
|
// TranslationBase.of(context).bwTheme,
|
|
|
|
|
// style: new TextStyle(fontSize: 16.0),
|
|
|
|
|
// ),
|
|
|
|
|
// new Radio(
|
|
|
|
|
// value: 3,
|
|
|
|
|
// groupValue: blindValue,
|
|
|
|
|
// onChanged: (value) {
|
|
|
|
|
// setState(() => {this.blindValue = value});
|
|
|
|
|
//
|
|
|
|
|
// setTheme(value);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// )
|
|
|
|
|
// ])),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppText(
|
|
|
|
|
@ -200,6 +200,7 @@ class _GeneralSettings extends State<GeneralSettings>
|
|
|
|
|
setState(() {
|
|
|
|
|
camera = value;
|
|
|
|
|
});
|
|
|
|
|
permission.setCameraLocationPermission(context);
|
|
|
|
|
},
|
|
|
|
|
activeTrackColor: Colors.lightGreenAccent,
|
|
|
|
|
activeColor: Colors.green,
|
|
|
|
|
@ -219,6 +220,7 @@ class _GeneralSettings extends State<GeneralSettings>
|
|
|
|
|
setState(() {
|
|
|
|
|
location = value;
|
|
|
|
|
});
|
|
|
|
|
permission.setCameraLocationPermission(context);
|
|
|
|
|
},
|
|
|
|
|
activeTrackColor: Colors.lightGreenAccent,
|
|
|
|
|
activeColor: Colors.green,
|
|
|
|
|
@ -266,16 +268,18 @@ class _GeneralSettings extends State<GeneralSettings>
|
|
|
|
|
permission.setVibrationPermission(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setAccessibility(){
|
|
|
|
|
if(!accsibility){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// permission.setVibrationPermission(value);
|
|
|
|
|
}
|
|
|
|
|
getValues() async{
|
|
|
|
|
blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled();
|
|
|
|
|
vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled();
|
|
|
|
|
// accsibility = mediaQueryData.accessibleNavigation;
|
|
|
|
|
blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled();
|
|
|
|
|
vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled();
|
|
|
|
|
camera = await permission.isCameraEnabled();
|
|
|
|
|
location = await permission.isLocationEnabled();
|
|
|
|
|
setState(() {
|
|
|
|
|
location =location;
|
|
|
|
|
camera = camera;
|
|
|
|
|
vibration = vibration;
|
|
|
|
|
blindValue =blindValue;
|
|
|
|
|
accsibility = mediaQueryData.accessibleNavigation;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
getTheme(value) async{
|
|
|
|
|
|
|
|
|
|
|