M
This commit is contained in:
+39
-41
@@ -43,7 +43,19 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
int _total_tasks = 15;
|
int _total_tasks = 15;
|
||||||
int _water = 7;
|
int _water = 7;
|
||||||
|
|
||||||
final screens = [];
|
List<Widget> screens = [
|
||||||
|
SpannableGrid(
|
||||||
|
cells: [],
|
||||||
|
rows: 1,
|
||||||
|
columns: 1,
|
||||||
|
),
|
||||||
|
SpannableGrid(
|
||||||
|
cells: [],
|
||||||
|
rows: 1,
|
||||||
|
columns: 1,
|
||||||
|
),
|
||||||
|
Stack()
|
||||||
|
];
|
||||||
|
|
||||||
void set_total_tasks() {
|
void set_total_tasks() {
|
||||||
_total_tasks = tasks.length;
|
_total_tasks = tasks.length;
|
||||||
@@ -107,10 +119,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_profile_page() {
|
Stack create_profile_page() {
|
||||||
setState(() {
|
return Stack(
|
||||||
screens.add(
|
|
||||||
Stack(
|
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -164,8 +174,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 60,
|
height: 60,
|
||||||
@@ -181,8 +190,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
color: Colors.grey[300],
|
color: Colors.grey[300],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
@@ -220,8 +228,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
height: 20.0,
|
height: 20.0,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.accessibility_new,
|
Icons.accessibility_new,
|
||||||
@@ -256,8 +263,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
height: 20.0,
|
height: 20.0,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.favorite,
|
Icons.favorite,
|
||||||
@@ -313,8 +319,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Achievements',
|
'Achievements',
|
||||||
style: TextStyle(
|
style:
|
||||||
color: Colors.grey[400], fontSize: 14.0),
|
TextStyle(color: Colors.grey[400], fontSize: 14.0),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 5.0,
|
height: 5.0,
|
||||||
@@ -331,8 +337,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Text(
|
Text(
|
||||||
'Birthday',
|
'Birthday',
|
||||||
style: TextStyle(
|
style:
|
||||||
color: Colors.grey[400], fontSize: 14.0),
|
TextStyle(color: Colors.grey[400], fontSize: 14.0),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 5.0,
|
height: 5.0,
|
||||||
@@ -350,8 +356,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Age',
|
'Age',
|
||||||
style: TextStyle(
|
style:
|
||||||
color: Colors.grey[400], fontSize: 14.0),
|
TextStyle(color: Colors.grey[400], fontSize: 14.0),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 5.0,
|
height: 5.0,
|
||||||
@@ -368,15 +374,11 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
),
|
),
|
||||||
)))
|
)))
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_targets_page() {
|
SpannableGrid create_targets_page() {
|
||||||
setState(() {
|
return SpannableGrid(
|
||||||
screens.add(
|
|
||||||
SpannableGrid(
|
|
||||||
gridSize: SpannableGridSize.parent,
|
gridSize: SpannableGridSize.parent,
|
||||||
cells: [
|
cells: [
|
||||||
SpannableGridCellData(
|
SpannableGridCellData(
|
||||||
@@ -405,8 +407,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
row: 2,
|
row: 2,
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.fromLTRB(10, 0, 20, 10),
|
margin: EdgeInsets.fromLTRB(10, 0, 20, 10),
|
||||||
decoration:
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(16)),
|
||||||
BoxDecoration(borderRadius: BorderRadius.circular(16)),
|
|
||||||
child: LinearPercentIndicator(
|
child: LinearPercentIndicator(
|
||||||
alignment: MainAxisAlignment.center,
|
alignment: MainAxisAlignment.center,
|
||||||
width: MediaQuery.of(context).size.width * 0.8,
|
width: MediaQuery.of(context).size.width * 0.8,
|
||||||
@@ -443,14 +444,11 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
],
|
],
|
||||||
rows: 10,
|
rows: 10,
|
||||||
columns: 1,
|
columns: 1,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_home_page() {
|
SpannableGrid create_home_page() {
|
||||||
setState(() {
|
return SpannableGrid(
|
||||||
screens.add(SpannableGrid(
|
|
||||||
cells: [
|
cells: [
|
||||||
SpannableGridCellData(
|
SpannableGridCellData(
|
||||||
id: 1,
|
id: 1,
|
||||||
@@ -529,8 +527,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
child: LinearPercentIndicator(
|
child: LinearPercentIndicator(
|
||||||
alignment: MainAxisAlignment.center,
|
alignment: MainAxisAlignment.center,
|
||||||
width:
|
width: MediaQuery.of(context).size.width * 0.8,
|
||||||
MediaQuery.of(context).size.width * 0.8,
|
|
||||||
animation: true,
|
animation: true,
|
||||||
lineHeight: 20.0,
|
lineHeight: 20.0,
|
||||||
animationDuration: 2500,
|
animationDuration: 2500,
|
||||||
@@ -622,9 +619,11 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
Colors.deepPurple),
|
Colors.deepPurple),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(
|
||||||
|
() {
|
||||||
_water = _water + 1;
|
_water = _water + 1;
|
||||||
});
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'TextButton',
|
'TextButton',
|
||||||
@@ -654,8 +653,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
style: SpannableGridStyle(
|
style: SpannableGridStyle(
|
||||||
spacing: 10,
|
spacing: 10,
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onItemTapped(int index) {
|
void _onItemTapped(int index) {
|
||||||
@@ -666,9 +664,9 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
create_targets_page();
|
screens[0] = create_targets_page();
|
||||||
create_home_page();
|
screens[1] = create_home_page();
|
||||||
create_profile_page();
|
screens[2] = create_profile_page();
|
||||||
return Container(
|
return Container(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
|
|||||||
Reference in New Issue
Block a user