app/lib/view/screens/about.dart

115 lines
4 KiB
Dart
Raw Permalink Normal View History

2021-09-03 15:30:46 +07:00
import 'package:flutter/cupertino.dart';
2021-08-18 17:56:41 +07:00
import 'package:flutter/material.dart';
2021-09-03 15:30:46 +07:00
import 'package:flutter/painting.dart';
2021-08-18 17:56:41 +07:00
2021-09-03 15:30:46 +07:00
import 'package:easy_learn/view/widgets/developer_box.dart';
import 'package:easy_learn/view/widgets/developer_list.dart';
class About extends StatefulWidget {
2021-08-18 17:56:41 +07:00
const About({Key? key}) : super(key: key);
2021-09-03 15:30:46 +07:00
@override
_AboutState createState() => _AboutState();
}
class _AboutState extends State<About> {
bool isAccepted = false;
int state = 0;
final List<dynamic> developers = [
{
"name": "Michael William Jonathan",
"image": "michael",
"telegram": "https://t.me/moepoi"
},
{
"name": "Kelvin Samuel",
"image": "kelvin",
"telegram": "https://t.me/CoganUntar"
},
{
"name": "Hans Edison",
"image": "hans",
"telegram": "https://t.me/Takahashi18"
}
];
2021-08-18 17:56:41 +07:00
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
2021-09-03 15:30:46 +07:00
alignment: Alignment.center,
2021-08-18 17:56:41 +07:00
decoration: BoxDecoration(
color: Colors.black,
image: DecorationImage(
colorFilter: ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop),
image: const AssetImage('assets/images/about_bg.jpg'),
fit: BoxFit.cover
)
),
child: Column(
2021-09-03 15:30:46 +07:00
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
2021-08-18 17:56:41 +07:00
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
2021-09-03 15:30:46 +07:00
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
2021-08-18 17:56:41 +07:00
children: [
2021-09-03 15:30:46 +07:00
Draggable<int>(
data: 0,
child: DeveloperList(imagePath: developers[0]['image'], dragging: false),
childWhenDragging: const SizedBox.shrink(),
feedback: DeveloperList(imagePath: developers[0]['image'], dragging: true),
2021-08-18 17:56:41 +07:00
),
2021-09-03 15:30:46 +07:00
Draggable<int>(
data: 1,
child: DeveloperList(imagePath: developers[1]['image'], dragging: false),
childWhenDragging: const SizedBox.shrink(),
feedback: DeveloperList(imagePath: developers[1]['image'], dragging: true),
2021-08-18 17:56:41 +07:00
),
2021-09-03 15:30:46 +07:00
Draggable<int>(
data: 2,
child: DeveloperList(imagePath: developers[2]['image'], dragging: false),
childWhenDragging: const SizedBox.shrink(),
feedback: DeveloperList(imagePath: developers[2]['image'], dragging: true),
)
2021-08-18 17:56:41 +07:00
],
),
2021-09-03 15:30:46 +07:00
DragTarget<int>(
onWillAccept: (value) => true,
onAccept: (value) {isAccepted = true; state = value;},
builder: (context, candidates, rejected) {
return (isAccepted) ? DeveloperBox(
imagePath: developers[state]['image'],
name: developers[state]['name'],
telegram: developers[state]['telegram']
) : Container(
margin: const EdgeInsets.all(10.0),
padding: const EdgeInsets.all(50.0),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(25.0))
),
child: const Center(
child: Text('DRAG PROFILE PICTURE ABOVE TO HERE', style: TextStyle(fontSize: 10, fontWeight: FontWeight.bold),),
)
);
},
),
2021-08-18 17:56:41 +07:00
Row(
mainAxisAlignment: MainAxisAlignment.center,
children : [
ElevatedButton(
onPressed: (){
Navigator.pop(context);
},
child: const Text("Close", style: TextStyle(color: Colors.white, fontSize: 20.0),),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.blueAccent)),
)
]
),
],
2021-09-03 15:30:46 +07:00
)
),
2021-08-18 17:56:41 +07:00
);
}
}