-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenSplit.dart
More file actions
90 lines (81 loc) · 3.61 KB
/
ScreenSplit.dart
File metadata and controls
90 lines (81 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import 'package:flutter/material.dart';
void main(){
runApp(MaterialApp(
home: MyWidget(),
));
}
class MyWidget extends StatefulWidget {
const MyWidget({Key? key}) : super(key: key);
@override
_MyWidgetState createState() => _MyWidgetState();
}
class _MyWidgetState extends State<MyWidget> {
var appBarBackgroundColor;
var appBackgroundColor = Colors.blueAccent;
String src = 'https://images.unsplash.com/photo-1528493695782-15c16f2c42f9?ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8YmVhdXRpZnVsfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60';
Map listOfFriends = {
'Samta': ['Violet', Colors.purple, Colors.purpleAccent, 'https://images.unsplash.com/photo-1528758054211-22aa4c5300db?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8dmlvbGV0fGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60'],
'Priyanka': ['Indigo', Colors.indigo, Colors.indigoAccent, 'https://images.unsplash.com/photo-1559255267-8f9c0b8df08f?ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8aW5kaWdvfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60'],
'Amanjot': ['Blue', Colors.blue, Colors.blueAccent, 'https://images.unsplash.com/photo-1520690214124-2405c5217036?ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8Ymx1ZXxlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60'],
'Priya': ['Green', Colors.green, Colors.greenAccent, 'https://images.unsplash.com/photo-1589691962030-8d2b7f2a1ffe?ixid=MnwxMjA3fDB8MHxzZWFyY2h8OHx8Z3JlZW58ZW58MHx8MHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60'],
'Jack': ['Yellow', Colors.yellow, Colors.yellowAccent, 'https://images.unsplash.com/photo-1442528010304-834a5d4f3925?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MTB8fHllbGxvd3xlbnwwfHwwfHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60'],
'Jinny': ['Orange', Colors.orange, Colors.orangeAccent, 'https://images.unsplash.com/photo-1442458017215-285b83f65851?ixid=MnwxMjA3fDB8MHxzZWFyY2h8OHx8b3JhbmdlfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60'],
'Joe': ['Red', Colors.red, Colors.redAccent, 'https://images.unsplash.com/photo-1530128118208-89f6ce02b37b?ixid=MnwxMjA3fDB8MHxzZWFyY2h8Mnx8cmVkfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60']
};
getWidgets(){
var listOfWidgets = <Widget>[];
listOfFriends.forEach((key, value) {
listOfWidgets.add(
InkWell(
hoverColor: appBackgroundColor,
child: Row(
children: [Text(key, style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),),
Text('\n'),
SizedBox(width: 20,),
Text(value[0], style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),),
Divider(),
],
),
onTap: (){
setState(() {
appBarBackgroundColor = value[1];
appBackgroundColor = value[2];
src = value[3];
});
},
),
);
});
return listOfWidgets;
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: appBarBackgroundColor,
),
body: ListView(
children: [
Container(
height: MediaQuery.of(context).size.height/2,
child: Column(
children: getWidgets(),
),
),
Container(
height: MediaQuery.of(context).size.height/2,
color: appBackgroundColor,
child: Column(
children: <Widget>[
Image.network(src, height: 315, width: 315,)
],
),
)
],
),
);
}
}