settings page added
parent
0443a37886
commit
875bf10c73
@ -0,0 +1,136 @@
|
|||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class GeneralSettings extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_GeneralSettings createState() => _GeneralSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _GeneralSettings extends State<GeneralSettings>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
bool isVibration = true;
|
||||||
|
var bindValue;
|
||||||
|
return Container(
|
||||||
|
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: AppText(
|
||||||
|
'Modes',
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text('Vibration touch feedback'),
|
||||||
|
Switch(
|
||||||
|
value: isVibration,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
isVibration = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
activeTrackColor: Colors.lightGreenAccent,
|
||||||
|
activeColor: Colors.green,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text('Accsibility Mode'),
|
||||||
|
Switch(
|
||||||
|
value: isVibration,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
isVibration = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
activeTrackColor: Colors.lightGreenAccent,
|
||||||
|
activeColor: Colors.green,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
child: AppText(
|
||||||
|
'Modes for Partially Blind',
|
||||||
|
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(
|
||||||
|
'Carnivore',
|
||||||
|
style: new TextStyle(fontSize: 16.0),
|
||||||
|
),
|
||||||
|
new Radio(
|
||||||
|
value: 0,
|
||||||
|
groupValue: bindValue,
|
||||||
|
onChanged: (value) {
|
||||||
|
bindValue = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
new Text(
|
||||||
|
'Herbivore',
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 16.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
new Radio(
|
||||||
|
value: 1,
|
||||||
|
groupValue: bindValue,
|
||||||
|
onChanged: (value) {
|
||||||
|
bindValue = value;
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
new Text(
|
||||||
|
'Omnivore',
|
||||||
|
style: new TextStyle(fontSize: 16.0),
|
||||||
|
),
|
||||||
|
new Radio(
|
||||||
|
value: 2,
|
||||||
|
groupValue: bindValue,
|
||||||
|
onChanged: (value) {
|
||||||
|
bindValue = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
]))
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ProfileSettings extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_ProfileSettings createState() => _ProfileSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ProfileSettings extends State<ProfileSettings>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
bool isVibration = true;
|
||||||
|
return Container(
|
||||||
|
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
|
||||||
|
Text('Mode'),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text('Vibration touch feedback'),
|
||||||
|
Switch(
|
||||||
|
value: isVibration,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
isVibration = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
activeTrackColor: Colors.lightGreenAccent,
|
||||||
|
activeColor: Colors.green,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text('Accsibility Mode'),
|
||||||
|
Switch(
|
||||||
|
value: isVibration,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
isVibration = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
activeTrackColor: Colors.lightGreenAccent,
|
||||||
|
activeColor: Colors.green,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
))
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/settings/profile_setting.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/settings/general_setting.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Settings extends StatefulWidget {
|
||||||
|
final int type;
|
||||||
|
|
||||||
|
Settings({this.type = 0});
|
||||||
|
@override
|
||||||
|
_Settings createState() => _Settings();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Settings extends State<Settings> with TickerProviderStateMixin {
|
||||||
|
TabController _tabController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_tabController =
|
||||||
|
new TabController(length: 2, vsync: this, initialIndex: widget.type);
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
AppGlobal.context = context;
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
bottom: TabBar(
|
||||||
|
tabs: [
|
||||||
|
Tab(text: TranslationBase.of(context).general),
|
||||||
|
Tab(
|
||||||
|
text: TranslationBase.of(context).profile,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
controller: _tabController,
|
||||||
|
),
|
||||||
|
title: Text(TranslationBase.of(context).settings,
|
||||||
|
style: TextStyle(color: Colors.white)),
|
||||||
|
leading: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return ArrowBack();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: TabBarView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
children: [GeneralSettings(), ProfileSettings()],
|
||||||
|
controller: _tabController),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue