diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 00660f7..68fd2dd 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -4,6 +4,13 @@ + + + + + + + diff --git a/assets/images/developers/hans.png b/assets/images/developers/hans.png new file mode 100644 index 0000000..a7b01dc Binary files /dev/null and b/assets/images/developers/hans.png differ diff --git a/assets/images/developers/kelvin.png b/assets/images/developers/kelvin.png new file mode 100644 index 0000000..3eca83f Binary files /dev/null and b/assets/images/developers/kelvin.png differ diff --git a/assets/images/developers/michael.png b/assets/images/developers/michael.png new file mode 100644 index 0000000..8a9745b Binary files /dev/null and b/assets/images/developers/michael.png differ diff --git a/lib/view/screens/about.dart b/lib/view/screens/about.dart index 534f237..e078736 100644 --- a/lib/view/screens/about.dart +++ b/lib/view/screens/about.dart @@ -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 { + bool isAccepted = false; + int state = 0; + + final List 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( + 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( + data: 1, + child: DeveloperList(imagePath: developers[1]['image'], dragging: false), + childWhenDragging: const SizedBox.shrink(), + feedback: DeveloperList(imagePath: developers[1]['image'], dragging: true), ), + Draggable( + data: 2, + child: DeveloperList(imagePath: developers[2]['image'], dragging: false), + childWhenDragging: const SizedBox.shrink(), + feedback: DeveloperList(imagePath: developers[2]['image'], dragging: true), + ) ], ), + DragTarget( + 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 { ] ), ], - ), - ) + ) + ), ); } } \ No newline at end of file diff --git a/lib/view/widgets/developer_box.dart b/lib/view/widgets/developer_box.dart new file mode 100644 index 0000000..d4cd233 --- /dev/null +++ b/lib/view/widgets/developer_box.dart @@ -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) + ) + ], + ), + ) + ], + ) + ], + ) + ); + } +} \ No newline at end of file diff --git a/lib/view/widgets/developer_list.dart b/lib/view/widgets/developer_list.dart new file mode 100644 index 0000000..90466d6 --- /dev/null +++ b/lib/view/widgets/developer_list.dart @@ -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)) + ), + ); + } +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index a26a8d7..f9cbcb7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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" diff --git a/pubspec.yaml b/pubspec.yaml index bb17a65..de2dfa0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.