diff --git a/.gitignore b/.gitignore index 9d532b1..dfbc658 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,45 @@ .pub-cache/ .pub/ /build/ +.lock + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* # Web related lib/generated_plugin_registrant.dart diff --git a/android/gradle.properties b/android/gradle.properties index 94adc3a..a673820 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,4 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +android.enableR8=true diff --git a/android/local.properties b/android/local.properties index ca8cffc..e56c555 100644 --- a/android/local.properties +++ b/android/local.properties @@ -1,2 +1,5 @@ -sdk.dir=/Users/mohamedmekawy/Library/Android/sdk -flutter.sdk=/Users/mohamedmekawy/Desktop/flutter \ No newline at end of file +sdk.dir=C:\\Users\\sikander.saleem\\Documents\\Sdks\\android +flutter.sdk=C:\\Users\\sikander.saleem\\Documents\\Sdks\\flutter +flutter.buildMode=debug +flutter.versionName=1.0.0 +flutter.versionCode=1 \ No newline at end of file diff --git a/assets/fonts/DroidKufi-Bold.ttf b/assets/fonts/DroidKufi-Bold.ttf new file mode 100644 index 0000000..650919e Binary files /dev/null and b/assets/fonts/DroidKufi-Bold.ttf differ diff --git a/assets/fonts/DroidKufi-Regular.ttf b/assets/fonts/DroidKufi-Regular.ttf new file mode 100644 index 0000000..af85975 Binary files /dev/null and b/assets/fonts/DroidKufi-Regular.ttf differ diff --git a/assets/fonts/UthmanicHafs-Bold.ttf b/assets/fonts/UthmanicHafs-Bold.ttf new file mode 100644 index 0000000..4ac9569 Binary files /dev/null and b/assets/fonts/UthmanicHafs-Bold.ttf differ diff --git a/assets/fonts/UthmanicHafs-Regular.ttf b/assets/fonts/UthmanicHafs-Regular.ttf new file mode 100644 index 0000000..97163af Binary files /dev/null and b/assets/fonts/UthmanicHafs-Regular.ttf differ diff --git a/assets/icons/About.svg b/assets/icons/About.svg new file mode 100644 index 0000000..b15fe2d --- /dev/null +++ b/assets/icons/About.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/assets/icons/Accessibility.svg b/assets/icons/Accessibility.svg new file mode 100644 index 0000000..54a601c --- /dev/null +++ b/assets/icons/Accessibility.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Bookmark.svg b/assets/icons/Bookmark.svg new file mode 100644 index 0000000..8a09e83 --- /dev/null +++ b/assets/icons/Bookmark.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/assets/icons/Browse.svg b/assets/icons/Browse.svg new file mode 100644 index 0000000..b3850fe --- /dev/null +++ b/assets/icons/Browse.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/icons/Contact.svg b/assets/icons/Contact.svg new file mode 100644 index 0000000..d460a87 --- /dev/null +++ b/assets/icons/Contact.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Copyrights.svg b/assets/icons/Copyrights.svg new file mode 100644 index 0000000..061d260 --- /dev/null +++ b/assets/icons/Copyrights.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Download.svg b/assets/icons/Download.svg new file mode 100644 index 0000000..921b85b --- /dev/null +++ b/assets/icons/Download.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Encyclopedia.svg b/assets/icons/Encyclopedia.svg new file mode 100644 index 0000000..e3450eb --- /dev/null +++ b/assets/icons/Encyclopedia.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Facebook.svg b/assets/icons/Facebook.svg new file mode 100644 index 0000000..44ef2e5 --- /dev/null +++ b/assets/icons/Facebook.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/assets/icons/GO_Forward.svg b/assets/icons/GO_Forward.svg new file mode 100644 index 0000000..29477ca --- /dev/null +++ b/assets/icons/GO_Forward.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/assets/icons/Home.svg b/assets/icons/Home.svg new file mode 100644 index 0000000..6632de6 --- /dev/null +++ b/assets/icons/Home.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/assets/icons/Instgram.svg b/assets/icons/Instgram.svg new file mode 100644 index 0000000..2ae03ce --- /dev/null +++ b/assets/icons/Instgram.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/LinkedIn.svg b/assets/icons/LinkedIn.svg new file mode 100644 index 0000000..1e445cf --- /dev/null +++ b/assets/icons/LinkedIn.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/Members.svg b/assets/icons/Members.svg new file mode 100644 index 0000000..a14f971 --- /dev/null +++ b/assets/icons/Members.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/Notification.svg b/assets/icons/Notification.svg new file mode 100644 index 0000000..60fee60 --- /dev/null +++ b/assets/icons/Notification.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/icons/Password.svg b/assets/icons/Password.svg new file mode 100644 index 0000000..f9322f3 --- /dev/null +++ b/assets/icons/Password.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Pause.svg b/assets/icons/Pause.svg new file mode 100644 index 0000000..b55f2ea --- /dev/null +++ b/assets/icons/Pause.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Pinterest.svg b/assets/icons/Pinterest.svg new file mode 100644 index 0000000..cb67ffc --- /dev/null +++ b/assets/icons/Pinterest.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/assets/icons/Record.svg b/assets/icons/Record.svg new file mode 100644 index 0000000..a5ff57d --- /dev/null +++ b/assets/icons/Record.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/Return.svg b/assets/icons/Return.svg new file mode 100644 index 0000000..4d4ac7e --- /dev/null +++ b/assets/icons/Return.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/assets/icons/Search.svg b/assets/icons/Search.svg new file mode 100644 index 0000000..ebb5ce1 --- /dev/null +++ b/assets/icons/Search.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/Stop.svg b/assets/icons/Stop.svg new file mode 100644 index 0000000..e03f9ac --- /dev/null +++ b/assets/icons/Stop.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/assets/icons/Twitter.svg b/assets/icons/Twitter.svg new file mode 100644 index 0000000..8742394 --- /dev/null +++ b/assets/icons/Twitter.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/assets/icons/User.svg b/assets/icons/User.svg new file mode 100644 index 0000000..1c9aee0 --- /dev/null +++ b/assets/icons/User.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/User_logged.svg b/assets/icons/User_logged.svg new file mode 100644 index 0000000..5f6e47f --- /dev/null +++ b/assets/icons/User_logged.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/assets/icons/Whatsapp.svg b/assets/icons/Whatsapp.svg new file mode 100644 index 0000000..33f521e --- /dev/null +++ b/assets/icons/Whatsapp.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/assets/icons/add_comment.svg b/assets/icons/add_comment.svg new file mode 100644 index 0000000..2aa4068 --- /dev/null +++ b/assets/icons/add_comment.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + قيلعت ةفاضأ + + + + + diff --git a/assets/icons/audio_level.svg b/assets/icons/audio_level.svg new file mode 100644 index 0000000..fdada5a --- /dev/null +++ b/assets/icons/audio_level.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/assets/icons/audio_level_1.svg b/assets/icons/audio_level_1.svg new file mode 100644 index 0000000..046e590 --- /dev/null +++ b/assets/icons/audio_level_1.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/bookmark_aya.svg b/assets/icons/bookmark_aya.svg new file mode 100644 index 0000000..45df3b5 --- /dev/null +++ b/assets/icons/bookmark_aya.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/assets/icons/dark_mode.svg b/assets/icons/dark_mode.svg new file mode 100644 index 0000000..f1a0e41 --- /dev/null +++ b/assets/icons/dark_mode.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/assets/icons/download_aya.svg b/assets/icons/download_aya.svg new file mode 100644 index 0000000..b1b08f2 --- /dev/null +++ b/assets/icons/download_aya.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/download_recording.svg b/assets/icons/download_recording.svg new file mode 100644 index 0000000..6f56ced --- /dev/null +++ b/assets/icons/download_recording.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + ليجستلا ليزنت + + + + + diff --git a/assets/icons/drop_menu.svg b/assets/icons/drop_menu.svg new file mode 100644 index 0000000..a90cc6e --- /dev/null +++ b/assets/icons/drop_menu.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/assets/icons/increase_size.svg b/assets/icons/increase_size.svg new file mode 100644 index 0000000..1fac338 --- /dev/null +++ b/assets/icons/increase_size.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/next_aya.svg b/assets/icons/next_aya.svg new file mode 100644 index 0000000..661941f --- /dev/null +++ b/assets/icons/next_aya.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/assets/icons/play_aya.svg b/assets/icons/play_aya.svg new file mode 100644 index 0000000..d0ba96a --- /dev/null +++ b/assets/icons/play_aya.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/assets/icons/previous_aya.svg b/assets/icons/previous_aya.svg new file mode 100644 index 0000000..a992dc9 --- /dev/null +++ b/assets/icons/previous_aya.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/assets/icons/read_quran.svg b/assets/icons/read_quran.svg new file mode 100644 index 0000000..1adf263 --- /dev/null +++ b/assets/icons/read_quran.svg @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/assets/icons/reduce_size.svg b/assets/icons/reduce_size.svg new file mode 100644 index 0000000..918ef40 --- /dev/null +++ b/assets/icons/reduce_size.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/assets/icons/share_aya.svg b/assets/icons/share_aya.svg new file mode 100644 index 0000000..6251f69 --- /dev/null +++ b/assets/icons/share_aya.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/assets/logos/tangheem_logo.svg b/assets/logos/tangheem_logo.svg new file mode 100644 index 0000000..afd1b94 --- /dev/null +++ b/assets/logos/tangheem_logo.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + Tangheem + + + + + + + + + + + diff --git a/assets/logos/tangheem_logo_dark_mode.svg b/assets/logos/tangheem_logo_dark_mode.svg new file mode 100644 index 0000000..8801190 --- /dev/null +++ b/assets/logos/tangheem_logo_dark_mode.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + Tangheem + + + + + + + + + + + diff --git a/ios/Flutter/Generated.xcconfig b/ios/Flutter/Generated.xcconfig index c074c56..9a12e57 100644 --- a/ios/Flutter/Generated.xcconfig +++ b/ios/Flutter/Generated.xcconfig @@ -1,11 +1,11 @@ // This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/mohamedmekawy/Desktop/flutter -FLUTTER_APPLICATION_PATH=/Users/mohamedmekawy/Desktop/Flutter Apps/tangheem -FLUTTER_TARGET=lib/main.dart +FLUTTER_ROOT=C:\Users\sikander.saleem\Documents\Sdks\flutter +FLUTTER_APPLICATION_PATH=C:\Users\sikander.saleem\Documents\AndroidStudioProjects\tangheem +FLUTTER_TARGET=lib\main.dart FLUTTER_BUILD_DIR=build -SYMROOT=${SOURCE_ROOT}/../build/ios +SYMROOT=${SOURCE_ROOT}/../build\ios OTHER_LDFLAGS=$(inherited) -framework Flutter -FLUTTER_FRAMEWORK_DIR=/Users/mohamedmekawy/Desktop/flutter/bin/cache/artifacts/engine/ios +FLUTTER_FRAMEWORK_DIR=C:\Users\sikander.saleem\Documents\Sdks\flutter\bin\cache\artifacts\engine\ios FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NUMBER=1 DART_OBFUSCATION=false diff --git a/ios/Flutter/flutter_export_environment.sh b/ios/Flutter/flutter_export_environment.sh index d48d969..fa999f9 100755 --- a/ios/Flutter/flutter_export_environment.sh +++ b/ios/Flutter/flutter_export_environment.sh @@ -1,12 +1,12 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/mohamedmekawy/Desktop/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/mohamedmekawy/Desktop/Flutter Apps/tangheem" -export "FLUTTER_TARGET=lib/main.dart" +export "FLUTTER_ROOT=C:\Users\sikander.saleem\Documents\Sdks\flutter" +export "FLUTTER_APPLICATION_PATH=C:\Users\sikander.saleem\Documents\AndroidStudioProjects\tangheem" +export "FLUTTER_TARGET=lib\main.dart" export "FLUTTER_BUILD_DIR=build" -export "SYMROOT=${SOURCE_ROOT}/../build/ios" +export "SYMROOT=${SOURCE_ROOT}/../build\ios" export "OTHER_LDFLAGS=$(inherited) -framework Flutter" -export "FLUTTER_FRAMEWORK_DIR=/Users/mohamedmekawy/Desktop/flutter/bin/cache/artifacts/engine/ios" +export "FLUTTER_FRAMEWORK_DIR=C:\Users\sikander.saleem\Documents\Sdks\flutter\bin\cache\artifacts\engine\ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" export "DART_OBFUSCATION=false" diff --git a/lib/classes/const.dart b/lib/classes/const.dart new file mode 100644 index 0000000..8fb8115 --- /dev/null +++ b/lib/classes/const.dart @@ -0,0 +1,22 @@ +import 'package:flutter/cupertino.dart'; + +class Const { + static Color primaryBlack = Color(0xff1C2238); + static Color primaryBlue = Color(0xff374061); + + static Color secondaryPink = Color(0xffE4697B); + static Color secondaryOrange = Color(0xffFF8C67); + static Color secondaryWhite = Color(0xffF2F2F2); + + static Color tertiaryPurple = Color(0xff5A3C60); + static Color secondaryCyan = Color(0xff94D5F0); + + static Color gradientOrange = Color(0xffFF8C67); + static Color gradientPink = Color(0xffE4697B); + + static Color textGrey = Color(0xff787F95); + static Color textGrey1 = Color(0xffA6A8BA); + static Color textHintGrey = Color(0xffcccccc); + + static Color sliderBackground = Color(0xffdfdfdf); +} diff --git a/lib/main.dart b/lib/main.dart index 11655b6..84860fa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,117 +1,57 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:tangheem/ui/home_screen.dart'; +import 'package:tangheem/ui/search_screen.dart'; +import 'package:tangheem/widgets/common_appbar_widget.dart'; + +import 'classes/const.dart'; void main() { - runApp(MyApp()); + runApp(Application()); } -class MyApp extends StatelessWidget { +class Application extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - // This is the theme of your application. - // - // Try running your application with "flutter run". You'll see the - // application has a blue toolbar. Then, without quitting the app, try - // changing the primarySwatch below to Colors.green and then invoke - // "hot reload" (press "r" in the console where you ran "flutter run", - // or simply save your changes to "hot reload" in a Flutter IDE). - // Notice that the counter didn't reset back to zero; the application - // is not restarted. - primarySwatch: Colors.blue, - // This makes the visual density adapt to the platform that you run - // the app on. For desktop platforms, the controls will be smaller and - // closer together (more dense) than on mobile platforms. - visualDensity: VisualDensity.adaptivePlatformDensity, - ), - home: MyHomePage(title: 'Flutter Demo Home Page'), - ); + title: 'Flutter Demo', + theme: lightTheme(), + //locale: Locale("ar"), + // supportedLocales: [Locale("ar")], + //locale: Locale("ar"), + debugShowCheckedModeBanner: false, + initialRoute: HomeScreen.routeName, + onGenerateRoute: (settings) { + var className; + switch (settings.name) { + case HomeScreen.routeName: + className = CommonAppbarWidget(showDrawer: true, child: HomeScreen()); + break; + case SearchScreen.routeName: + String query = settings.arguments.toString(); + className = CommonAppbarWidget(child: SearchScreen(query: query)); + break; + } + return goToNavigation(className); + }); } -} - -class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); + PageRoute goToNavigation(var className) { + print("classNameType:${className.runtimeType}"); + return CupertinoPageRoute(builder: (context) => className); } - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Invoke "debug painting" (press "p" in the console, choose the - // "Toggle Debug Paint" action from the Flutter Inspector in Android - // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) - // to see the wireframe for each widget. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'You have pushed the button this many times:', - ), - Text( - '$_counter', - style: Theme.of(context).textTheme.headline4, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. + ThemeData lightTheme() { + return ThemeData( + fontFamily: 'DroidKufi', + brightness: Brightness.light, + backgroundColor: Const.secondaryWhite, + primarySwatch: Colors.blue, + primaryColor: Colors.white, + primaryColorBrightness: Brightness.light, + primaryColorLight: Colors.white, + visualDensity: VisualDensity.adaptivePlatformDensity, ); } } diff --git a/lib/ui/home_screen.dart b/lib/ui/home_screen.dart new file mode 100644 index 0000000..9a30dbd --- /dev/null +++ b/lib/ui/home_screen.dart @@ -0,0 +1,123 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:tangheem/classes/const.dart'; +import 'package:tangheem/ui/search_screen.dart'; +import 'package:tangheem/widgets/common_dropdown_button.dart'; + +class HomeScreen extends StatefulWidget { + static const String routeName = "/home"; + + HomeScreen({Key key}) : super(key: key); + + @override + _HomeScreenState createState() { + return _HomeScreenState(); + } +} + +class _HomeScreenState extends State { + TextEditingController _searchController = TextEditingController(); + + @override + void initState() { + super.initState(); + SystemChannels.textInput.invokeMethod('TextInput.hide'); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.fromLTRB(16, 16, 16, 0), + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "موسوعةالأداء القرآني", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Const.primaryBlue, height: 1), + ), + SizedBox(height: 4), + Text( + "للأساليب اللغوية", + style: TextStyle(fontSize: 20, color: Const.primaryBlue, height: 1), + ), + SizedBox(height: 8), + Text( + "تساعدك موسوعة \"تنغيم\" على أداء الأساليب اللغوية القرآنية (كالاستفهام والأمر والنهي والإتمام) بما يخدم معنى الآية. وقد أشرف عليها متخصصون في اللغة العربية والدراسات القرآنية.", + style: TextStyle(fontSize: 14, color: Const.textGrey, height: 1), + ), + SizedBox(height: 32), + Row( + children: [ + Expanded( + child: CommonDropDownButton("الأسلوب اللغوي", onPressed: () {}), + ), + SizedBox(width: 8), + Expanded( + child: CommonDropDownButton("السورة", onPressed: () {}), + ) + ], + ), + SizedBox(height: 16), + CommonDropDownButton("ابدأ البحث", color: Const.secondaryPink, icon: "assets/icons/go_forward.svg", widthHeight: 20, iconColor: Colors.white, onPressed: () {}), + SizedBox(height: 16), + SizedBox( + height: 40, + child: TextField( + controller: _searchController, + style: TextStyle(color: Const.primaryBlack, fontSize: 14), + decoration: InputDecoration( + contentPadding: EdgeInsets.fromLTRB(4, 4, 4, 4), + alignLabelWithHint: true, + fillColor: Colors.white, + filled: true, + hintStyle: TextStyle(color: Const.textHintGrey, fontSize: 12), + hintText: "البحث عن سورة أو آية", + prefixIconConstraints: BoxConstraints(maxHeight: 16), + prefixIcon: Padding( + padding: EdgeInsets.only(right: 6), + child: SvgPicture.asset( + "assets/icons/search.svg", + color: Const.secondaryOrange, + ), + ), + suffixIcon: InkWell( + onTap: () { + FocusScope.of(context).unfocus(); + Navigator.pushNamed(context, SearchScreen.routeName, arguments: _searchController.text); + }, + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + child: Container( + alignment: Alignment.center, + width: 80, + child: Text( + "بحث", + style: TextStyle(fontSize: 14, color: Colors.white), + ), + decoration: BoxDecoration( + color: Const.secondaryPink, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(6), + topLeft: Radius.circular(6), + ), + ), + ), + ), + border: OutlineInputBorder(borderRadius: BorderRadius.circular(6), borderSide: BorderSide.none), + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/ui/search_screen.dart b/lib/ui/search_screen.dart new file mode 100644 index 0000000..7203505 --- /dev/null +++ b/lib/ui/search_screen.dart @@ -0,0 +1,282 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'dart:math' as math; +import 'package:tangheem/classes/const.dart'; +import 'package:tangheem/widgets/common_dropdown_button.dart'; + +class SearchScreen extends StatefulWidget { + static const String routeName = "/search"; + final String query; + + SearchScreen({Key key, @required this.query}) : super(key: key); + + @override + _SearchScreenState createState() { + return _SearchScreenState(); + } +} + +class _SearchScreenState extends State { + double sliderValue = 0.4; + bool isPlaying = false; + + @override + void initState() { + super.initState(); + searchQuery(); + } + + void searchQuery() {} + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.fromLTRB(16, 24, 16, 0), + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "اقرأ القرآن الكريم", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Const.primaryBlue, height: 1), + ), + SizedBox(height: 16), + Row( + children: [ + Expanded( + child: CommonDropDownButton("سورة البقرة", onPressed: () {}), + ), + SizedBox(width: 4), + Expanded( + child: CommonDropDownButton("من الاية" + " 158", onPressed: () {}), + ), + SizedBox(width: 4), + Expanded( + child: CommonDropDownButton("الى الاية" + " 123", onPressed: () {}), + ), + ], + ), + SizedBox(height: 16), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 4, bottom: 4), + padding: EdgeInsets.only(top: 16, bottom: 4, right: 16, left: 16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + nextOptionButton("assets/icons/go_forward.svg", "سورة الفاتحة", () {}), + previousOptionButton("assets/icons/go_forward.svg", "سورة آل عمران", () {}), + ], + ), + Expanded( + child: ListView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 16, bottom: 8), + children: [ + Text( + "بسم الله الرحمن الرحيم", + textAlign: TextAlign.center, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Const.primaryBlue, height: 1), + ), + SizedBox(height: 8), + Expanded( + child: Container( + padding: EdgeInsets.only(left: 4, right: 4), + child: Text( + "إِنَّ الصَّفَا وَالْمَرْوَةَ مِنْ شَعَائِرِ اللَّهِ ۖ فَمَنْ حَجَّ الْبَيْتَ أَوِ اعْتَمَرَ فَلَا جُنَاحَ عَلَيْهِ أَنْ يَطَّوَّفَ بِهِمَا ۚ وَمَنْ تَطَوَّعَ خَيْرًا فَإِنَّ اللَّهَ شَاكِرٌ عَلِيمٌ ﴿158﴾ إِنَّ الَّذِينَ يَكْتُمُونَ مَا أَنْزَلْنَا مِنَ الْبَيِّنَاتِ وَالْهُدَىٰ مِنْ بَعْدِ مَا بَيَّنَّاهُ لِلنَّاسِ فِي الْكِتَابِ ۙ أُولَٰئِكَ يَلْعَنُهُمُ اللَّهُ وَيَلْعَنُهُمُ اللَّاعِنُونَ ﴿159﴾ إِلَّا الَّذِينَ تَابُوا وَأَصْلَحُوا وَبَيَّنُوا فَأُولَٰئِكَ أَتُوبُ عَلَيْهِمْ ۚ وَأَنَا التَّوَّابُ الرَّحِيمُ ﴿160﴾ إِنَّ الَّذِينَ كَفَرُوا وَمَاتُوا وَهُمْ كُفَّارٌ أُولَٰئِكَ عَلَيْهِمْ لَعْنَةُ اللَّهِ وَالْمَلَائِكَةِ وَالنَّاسِ أَجْمَعِينَ ﴿161﴾ خَالِدِينَ فِيهَا ۖ لَا يُخَفَّفُ عَنْهُمُ الْعَذَابُ وَلَا هُمْ يُنْظَرُونَ ﴿162﴾ وَإِلَٰهُكُمْ إِلَٰهٌ وَاحِدٌ ۖ لَا إِلَٰهَ إِلَّا هُوَ الرَّحْمَٰنُ الرَّحِيمُ ﴿163﴾إِنَّ فِي خَلْقِ السَّمَاوَاتِ وَالْأَرْضِ وَاخْتِلَافِ اللَّيْلِ وَالنَّهَارِ وَالْفُلْكِ الَّتِي تَجْرِي فِي الْبَحْرِ بِمَا يَنْفَعُ النَّاسَ وَمَا أَنْزَلَ اللَّهُ مِنَ السَّمَاءِ مِنْ مَاءٍ فَأَحْيَا بِهِ الْأَرْضَ بَعْدَ مَوْتِهَا وَبَثَّ فِيهَا مِنْ كُلِّ دَابَّةٍ وَتَصْرِيفِ الرِّيَاحِ وَالسَّحَابِ الْمُسَخَّرِ بَيْنَ السَّمَاءِ وَالْأَرْضِ لَآيَاتٍ لِقَوْمٍ يَعْقِلُونَ ﴿164﴾ وَمِنَ النَّاسِ مَنْ يَتَّخِذُ مِنْ دُونِ اللَّهِ أَنْدَادًا يُحِبُّونَهُمْ كَحُبِّ اللَّهِ ۖ وَالَّذِينَ آمَنُوا أَشَدُّ حُبًّا لِلَّهِ ۗ وَلَوْ يَرَى الَّذِينَ ظَلَمُوا إِذْ يَرَوْنَ الْعَذَابَ أَنَّ الْقُوَّةَ لِلَّهِ جَمِيعًا وَأَنَّ اللَّهَ شَدِيدُ الْعَذَابِ ﴿165﴾ إِذْ تَبَرَّأَ الَّذِينَ اتُّبِعُوا مِنَ الَّذِينَ اتَّبَعُوا وَرَأَوُا الْعَذَابَ وَتَقَطَّعَتْ بِهِمُ الْأَسْبَابُ ﴿166﴾ وَقَالَ الَّذِينَ اتَّبَعُوا لَوْ أَنَّ لَنَا كَرَّةً فَنَتَبَرَّأَ مِنْهُمْ كَمَا تَبَرَّءُوا مِنَّا ۗ كَذَٰلِكَ يُرِيهِمُ اللَّهُ أَعْمَالَهُمْ حَسَرَاتٍ عَلَيْهِمْ ۖ وَمَا هُمْ بِخَارِجِينَ مِنَ النَّارِ ﴿167﴾4", + textAlign: TextAlign.center, + style: TextStyle( + fontFamily: "UthmanicHafs", + color: Const.primaryBlue, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + ], + ), + ), + SizedBox(height: 8), + Text( + "1 2 3 4 5 6 7 8 9", + style: TextStyle(fontSize: 14, color: Const.textHintGrey), + ), + SizedBox(height: 4), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + nextOptionButton("assets/icons/go_forward.svg", "الآيات السابقة", () {}), + previousOptionButton("assets/icons/go_forward.svg", "الآيات التالية", () {}), + ], + ), + ], + ), + ), + ), + // SizedBox(height: 16), + Container( + margin: EdgeInsets.only(top: 4, bottom: 4), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + ), + ), + padding: EdgeInsets.all(8), + child: Column( + children: [ + Row( + children: [ + Transform.rotate( + angle: 180 * math.pi / 180, + child: SvgPicture.asset( + "assets/icons/drop_menu.svg", + color: Const.secondaryOrange, + width: 16, + ), + ), + Container( + width: 50.0, + margin: EdgeInsets.only(left: 8, right: 8), + height: 50.0, + decoration: BoxDecoration( + image: DecorationImage( + fit: BoxFit.cover, + image: NetworkImage("https://i.pinimg.com/originals/91/cf/45/91cf453d79f58df425b6b0267603ccb3.jpg"), + ), + borderRadius: BorderRadius.all( + Radius.circular(30.0), + ), + ), + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "سورة البقسورة البقسورة البقرة", + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: Const.primaryBlack, height: 1), + ), + SizedBox(height: 4), + Text( + "الشيخ عبد الشيخ عبد العزيز الزهراني", + style: TextStyle(fontSize: 10, color: Const.textGrey1, height: 1), + ), + ], + ), + ), + commonIconButton("assets/icons/download_aya.svg", () {}), + commonIconButton("assets/icons/share_aya.svg", () {}), + commonIconButton("assets/icons/bookmark.svg", () {}), + commonIconButton("assets/icons/audio_level.svg", () {}), + ], + ), + SizedBox(height: 8), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + commonIconButton("assets/icons/next_aya.svg", () {}), + SizedBox(width: 4), + commonIconButton(isPlaying ? "assets/icons/pause.svg" : "assets/icons/play_aya.svg", () { + setState(() { + isPlaying = !isPlaying; + }); + }), + SizedBox(width: 4), + commonIconButton("assets/icons/previous_aya.svg", () {}), + Expanded( + child: SliderTheme( + data: SliderTheme.of(context).copyWith( + activeTrackColor: Const.sliderBackground, + inactiveTrackColor: Const.secondaryOrange, + // trackShape: RoundedRectRangeSliderTrackShape(), + trackHeight: 8.0, + thumbColor: Const.primaryBlack, + thumbShape: RoundSliderThumbShape(enabledThumbRadius: 10.0), + overlayColor: Colors.red.withAlpha(32), + overlayShape: RoundSliderOverlayShape(overlayRadius: 12.0), + ), + child: Slider( + value: sliderValue, + onChanged: (value) { + setState(() { + sliderValue = value; + }); + }, + ), + ), + ), + Text( + "06:00", + style: TextStyle(color: Const.textGrey1, height: 1.1, fontFamily: "Roboto"), + ), + ], + ) + ], + ), + ), + ], + ), + ); + } + + Widget commonIconButton(String icon, VoidCallback onPressed) { + return IconButton(constraints: BoxConstraints(), padding: EdgeInsets.only(right: 2), icon: SvgPicture.asset(icon, height: 16, width: 16, color: Const.textGrey), onPressed: onPressed); + } + + Widget nextOptionButton(String icon, String text, VoidCallback onPressed) { + return InkWell( + onTap: onPressed, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset(icon, height: 16, width: 16, color: Const.secondaryOrange), + SizedBox(width: 4), + Text( + text, + style: TextStyle(color: Const.textGrey), + ), + ], + ), + ); + } + + Widget previousOptionButton(String icon, String text, VoidCallback onPressed) { + return InkWell( + onTap: onPressed, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + text, + style: TextStyle(color: Const.textGrey), + ), + SizedBox(width: 4), + SvgPicture.asset(icon, height: 16, width: 16, color: Const.secondaryOrange), + ], + ), + ); + } +} diff --git a/lib/widgets/common_appbar_widget.dart b/lib/widgets/common_appbar_widget.dart new file mode 100644 index 0000000..449c69a --- /dev/null +++ b/lib/widgets/common_appbar_widget.dart @@ -0,0 +1,162 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:tangheem/classes/const.dart'; + +class CommonAppbarWidget extends StatefulWidget { + final bool showDrawer; + final Widget child; + + CommonAppbarWidget({Key key, this.showDrawer = false, @required this.child}) : super(key: key); + + @override + _CommonAppbarWidgetState createState() { + return _CommonAppbarWidgetState(); + } +} + +class _CommonAppbarWidgetState extends State { + final GlobalKey _scaffoldKey = new GlobalKey(); + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + key: widget.showDrawer ? _scaffoldKey : null, + drawer: widget.showDrawer ? drawerView() : null, + drawerScrimColor: Colors.black.withOpacity(.3), + body: SafeArea( + child: Column( + children: [ + Container( + color: Colors.white, + height: 100, + padding: EdgeInsets.only(top: 8, bottom: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + IconButton( + icon: Icon(widget.showDrawer ? Icons.menu : Icons.arrow_back_ios, color: Const.textGrey), + padding: EdgeInsets.only(left: 16), + onPressed: () { + if (widget.showDrawer) { + _scaffoldKey.currentState.openDrawer(); + } else { + Navigator.pop(context); + } + }, + ), + SvgPicture.asset( + "assets/logos/tangheem_logo.svg", + height: 100, + width: 100, + alignment: Alignment.centerRight, + ) + ], + ), + ), + Expanded(child: Directionality(textDirection: TextDirection.rtl, child: widget.child)), + ], + ), + ), + ); + } + + Widget drawerView() { + var height = MediaQuery.of(context).padding.top; + return Drawer( + elevation: 0, + child: Container( + color: Colors.white, + child: Column( + children: [ + Container( + height: 100 + height, + padding: EdgeInsets.only(left: 0, top: height), + alignment: Alignment.centerLeft, + child: IconButton( + icon: Icon(Icons.clear, color: Const.textGrey), + onPressed: () { + if (_scaffoldKey.currentState.isDrawerOpen) { + Navigator.pop(context); + } + }, + ), + ), + Container( + margin: EdgeInsets.only(top: 8, bottom: 16), + padding: EdgeInsets.only(left: 12, right: 12), + child: Row( + children: [ + commonIconButton("assets/icons/accessibility.svg", () {}), + commonIconButton("assets/icons/dark_mode.svg", () {}), + commonIconButton("assets/icons/bookmark.svg", () {}), + commonIconButton("assets/icons/increase_size.svg", () {}), + commonIconButton("assets/icons/reduce_size.svg", () {}), + commonIconButton("assets/icons/notification.svg", () {}), + commonIconButton("assets/icons/user_logged.svg", () {}), + ], + ), + ), + Container( + height: 40, + margin: EdgeInsets.only(left: 24, right: 24), + padding: EdgeInsets.only(left: 8, right: 8), + alignment: Alignment.centerRight, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + gradient: LinearGradient( + stops: [0.0, 0.5], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [Const.gradientPink, Const.gradientOrange], + ), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "الرئيسية", + style: TextStyle(fontSize: 14, color: Colors.white), + ), + SizedBox(width: 8), + SvgPicture.asset("assets/icons /home.svg", height: 20, width: 20, color: Colors.white), + ], + ), + ), + Expanded(child: Container()), + Container( + margin: EdgeInsets.only(top: 16, bottom: 0), + padding: EdgeInsets.only(left: 32, right: 32), + child: Row( + children: [ + commonIconButton("assets/icons/linkedin.svg", () {}, size: 35), + commonIconButton("assets/icons/pinterest.svg", () {}, size: 35), + commonIconButton("assets/icons/whatsapp.svg", () {}, size: 35), + commonIconButton("assets/icons/facebook.svg", () {}, size: 35), + commonIconButton("assets/icons/instgram.svg", () {}, size: 35), + commonIconButton("assets/icons/twitter.svg", () {}, size: 35), + ], + ), + ), + ], + ), + ), + ); + } + + Widget commonIconButton(String icon, VoidCallback onPressed, {double size}) { + return Expanded( + child: IconButton(padding: EdgeInsets.zero, icon: SvgPicture.asset(icon, height: size ?? 25, width: size ?? 30, color: Const.textGrey), onPressed: onPressed), + ); + } +} diff --git a/lib/widgets/common_dropdown_button.dart b/lib/widgets/common_dropdown_button.dart new file mode 100644 index 0000000..37d1af7 --- /dev/null +++ b/lib/widgets/common_dropdown_button.dart @@ -0,0 +1,49 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:tangheem/classes/const.dart'; + +class CommonDropDownButton extends StatelessWidget { + final String text; + final String icon; + final Color iconColor; + final Color color; + final VoidCallback onPressed; + final double widthHeight; + + CommonDropDownButton(this.text, {Key key, this.onPressed, this.color, this.icon, this.widthHeight, this.iconColor}) : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: onPressed, + child: Container( + height: 40, + decoration: BoxDecoration( + color: color ?? Const.primaryBlue, + borderRadius: BorderRadius.circular(6), + ), + padding: EdgeInsets.fromLTRB(8, 8, 16, 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + text, + style: TextStyle(fontSize: 13, color: Colors.white), + ), + SizedBox(width: 8), + SvgPicture.asset( + icon ?? "assets/icons/drop_menu.svg", + width: widthHeight ?? 10, + height: widthHeight ?? 5, + color: iconColor ?? Const.secondaryOrange, + ), + ], + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index d73f490..bed6a96 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.0 + flutter_svg: ^0.19.1 dev_dependencies: flutter_test: @@ -45,9 +46,9 @@ flutter: uses-material-design: true # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + assets: + - assets/icons/ + - assets/logos/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. @@ -60,17 +61,17 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 + fonts: + - family: DroidKufi + fonts: + - asset: assets/fonts/DroidKufi-Regular.ttf + - asset: assets/fonts/DroidKufi-Bold.ttf + weight: 700 + - family: UthmanicHafs + fonts: + - asset: assets/fonts/UthmanicHafs-Regular.ttf + - asset: assets/fonts/UthmanicHafs-Bold.ttf + weight: 700 # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages diff --git a/test/widget_test.dart b/test/widget_test.dart index b55fd14..5ebd9d5 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -13,7 +13,7 @@ import 'package:tangheem/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); + await tester.pumpWidget(Application()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget);