Rebuild about screen

This commit is contained in:
Moe Poi ~ 2021-09-03 15:30:46 +07:00
parent 40d11dc8c1
commit 16c8a23176
9 changed files with 240 additions and 25 deletions

View file

@ -4,6 +4,13 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries>
<application
android:label="Easy Learn"
android:icon="@mipmap/launcher_icon">

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 KiB

View file

@ -1,12 +1,44 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
class About extends StatelessWidget {
import 'package:easy_learn/view/widgets/developer_box.dart';
import 'package:easy_learn/view/widgets/developer_list.dart';
class About extends StatefulWidget {
const About({Key? key}) : super(key: key);
@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"
}
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.black,
image: DecorationImage(
@ -16,35 +48,53 @@ class About extends StatelessWidget {
)
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children : const [
Text("About", style: TextStyle(fontSize: 40.0, color: Colors.white),)
]
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const Text("Developed by : ", style: TextStyle(fontSize: 25.0, color: Colors.white),),
Container(
padding: const EdgeInsets.only(left: 100.0),
alignment: Alignment.centerLeft,
child: const Text("- Michael William Jonathan", style: TextStyle(fontSize: 15.0, color: Colors.white),)
Draggable<int>(
data: 0,
child: DeveloperList(imagePath: developers[0]['image'], dragging: false),
childWhenDragging: const SizedBox.shrink(),
feedback: DeveloperList(imagePath: developers[0]['image'], dragging: true),
),
Container(
padding: const EdgeInsets.only(left: 100.0),
alignment: Alignment.centerLeft,
child: const Text("- Kelvin Samuel", style: TextStyle(fontSize: 15.0, color: Colors.white),)
),
Container(
padding: const EdgeInsets.only(left: 100.0),
alignment: Alignment.centerLeft,
child: const Text("- Hans Edison", style: TextStyle(fontSize: 15.0, color: Colors.white),)
Draggable<int>(
data: 1,
child: DeveloperList(imagePath: developers[1]['image'], dragging: false),
childWhenDragging: const SizedBox.shrink(),
feedback: DeveloperList(imagePath: developers[1]['image'], dragging: true),
),
Draggable<int>(
data: 2,
child: DeveloperList(imagePath: developers[2]['image'], dragging: false),
childWhenDragging: const SizedBox.shrink(),
feedback: DeveloperList(imagePath: developers[2]['image'], dragging: true),
)
],
),
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),),
)
);
},
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children : [
@ -58,8 +108,8 @@ class About extends StatelessWidget {
]
),
],
),
)
)
),
);
}
}

View file

@ -0,0 +1,63 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class DeveloperBox extends StatelessWidget {
const DeveloperBox({Key? key, required this.imagePath, required this.name, required this.telegram}) : super(key: key);
final String imagePath;
final String name;
final String telegram;
void telegramChat() async {
await canLaunch(telegram) ? await launch(telegram) : throw 'Could not launch $telegram';
}
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(10.0),
padding: const EdgeInsets.all(10.0),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(25.0))
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/developers/$imagePath.png'),
fit: BoxFit.contain
),
borderRadius: const BorderRadius.all(Radius.circular(50.0))
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(name, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 17.0),),
Container(
margin: const EdgeInsets.only(top: 8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
telegramChat();
},
child: const Icon(Icons.chat)
)
],
),
)
],
)
],
)
);
}
}

View file

@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
class DeveloperList extends StatelessWidget {
const DeveloperList({Key? key, required this.imagePath, required this.dragging}) : super(key: key);
final String imagePath;
final bool dragging;
@override
Widget build(BuildContext context) {
return (dragging) ? Container(
width: 80,
height: 80,
decoration: BoxDecoration(
image: DecorationImage(
colorFilter: ColorFilter.mode(Colors.white.withOpacity(0.5), BlendMode.dstATop),
image: AssetImage('assets/images/developers/$imagePath.png')
),
borderRadius: const BorderRadius.all(Radius.circular(50.0))
),
) : Container(
width: 80,
height: 80,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/developers/$imagePath.png')
),
borderRadius: const BorderRadius.all(Radius.circular(50.0))
),
);
}
}

View file

@ -102,6 +102,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
image:
dependency: transitive
description:
@ -109,6 +114,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
lints:
dependency: transitive
description:
@ -151,6 +163,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
sky_engine:
dependency: transitive
description: flutter
@ -212,6 +231,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.10"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
vector_math:
dependency: transitive
description:
@ -235,4 +296,4 @@ packages:
version: "3.1.0"
sdks:
dart: ">=2.13.0 <3.0.0"
flutter: ">=1.10.0"
flutter: ">=2.0.0"

View file

@ -33,6 +33,7 @@ dependencies:
flutter_launcher_icons: ^0.9.2
page_transition: ^2.0.2
tflite_audio: ^0.1.8+1
url_launcher: ^6.0.10
dev_dependencies:
flutter_lints: ^1.0.0
@ -57,6 +58,7 @@ flutter:
assets:
- assets/images/
- assets/images/buttons/
- assets/images/developers/
- assets/datasets/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.