├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── viewus
│ │ │ │ ├── wp_blog
│ │ │ │ └── MainActivity.kt
│ │ │ │ └── wp_blog_app
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── images
│ ├── img_error.jpg
│ ├── newLoading.gif
│ └── pageloading.gif
└── logo
│ ├── naijaguy.png
│ ├── naijatechguy.png
│ └── naijatechguyD.png
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── app
│ ├── screens
│ │ ├── blog_View.dart
│ │ ├── bookmark.dart
│ │ ├── category.dart
│ │ ├── category_screens
│ │ │ ├── accessories.dart
│ │ │ ├── android_cart.dart
│ │ │ ├── apps_cart.dart
│ │ │ ├── gaming_android.dart
│ │ │ ├── gaming_cart.dart
│ │ │ ├── hacking_cart.dart
│ │ │ ├── internet_cart.dart
│ │ │ ├── ios_cart.dart
│ │ │ ├── network_cart.dart
│ │ │ ├── reviews_cart.dart
│ │ │ ├── smart_phones_cart.dart
│ │ │ ├── social_cart.dart
│ │ │ ├── tech_cart.dart
│ │ │ ├── tutorial_cart.dart
│ │ │ └── tweaks_cart.dart
│ │ ├── home_screen.dart
│ │ ├── post_view.dart
│ │ ├── settings.dart
│ │ └── tab_view.dart
│ └── src
│ │ ├── app.dart
│ │ └── splash.dart
├── const_values.dart
├── custom_theme.dart
├── main.dart
├── models
│ ├── posts.dart
│ └── posts.g.dart
├── providers
│ └── theme_provider.dart
├── size_config.dart
├── widgets
│ ├── example.dart
│ ├── horizonatl_view.dart
│ ├── list_view_post.dart
│ └── refresh_button.dart
└── wp_api.dart
├── pubspec.lock
├── pubspec.yaml
├── ss
├── naijatechguy.gif
└── naijtechguyTwo.gif
└── test
└── widget_test.dart
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | #size configuration settings
37 | #lib/size_config.dart
38 |
39 | # store key properties
40 | android/key.properties
41 |
42 | # Exceptions to above rules.
43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
44 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
17 | base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
18 | - platform: android
19 | create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
20 | base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
21 | - platform: ios
22 | create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
23 | base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
24 | - platform: linux
25 | create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
26 | base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
27 | - platform: macos
28 | create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
29 | base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
30 | - platform: web
31 | create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
32 | base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
33 | - platform: windows
34 | create_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
35 | base_revision: ee4e09cce01d6f2d7f4baebd247fde02e5008851
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Wordpress Blog App
2 |
3 | A simple Flutter Blog Application, which fetches data from naijatechguy.com, which is a blog, using the blog api. Still working on it and new features will be added soon.
4 |
5 |
check out app on Google Play Store here
6 |
7 | ## Plugin's Used
8 | 1.
Http
9 | 2. Html (To remove html formats from text)
10 | 3. Intl (Date formater)
11 | 4. Provider (Manage State)
12 | 5. Hive
13 | 6. Auto Size Text
14 | 6. Pull to Refresh
15 | 7. Shimmer
16 | 7. Cached Network Image (To cache image)
17 |
18 |
19 | You can fork or clone the repo and send a pull request, any help to make the app better will be accepted. Thank you.
20 |
21 |
22 |
23 |
24 |
25 |
26 |  |
27 |
28 |
29 |
30 |
31 |
32 | ## Getting Started
33 |
34 | This project is a starting point for a Flutter application.
35 |
36 | For help getting started with Flutter, view our
37 | [online documentation](https://flutter.dev/docs), which offers tutorials,
38 | samples, guidance on mobile development, and a full API reference.
39 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | //def keystoreProperties = new Properties()
29 | //def keystorePropertiesFile = rootProject.file('key.properties')
30 | //if (keystorePropertiesFile.exists()) {
31 | // keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
32 | //}
33 |
34 | android {
35 | compileSdkVersion 32
36 |
37 | sourceSets {
38 | main.java.srcDirs += 'src/main/kotlin'
39 | }
40 |
41 | lintOptions {
42 | disable 'InvalidPackage'
43 | }
44 |
45 | defaultConfig {
46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 | applicationId "com.viewus.wp_blog"
48 | minSdkVersion 19
49 | targetSdkVersion 32
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
53 | }
54 |
55 | // signingConfigs {
56 | // release {
57 | // keyAlias keystoreProperties['keyAlias']
58 | // keyPassword keystoreProperties['keyPassword']
59 | // storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
60 | // storePassword keystoreProperties['storePassword']
61 | // }
62 | // }
63 |
64 | buildTypes {
65 | release {
66 | // TODO: Add your own signing config for the release build.
67 | // Signing with the debug keys for now, so `flutter run --release` works.
68 | signingConfig signingConfigs.debug
69 | // minifyEnabled true
70 | // useProguard true
71 | // shrinkResources true
72 | // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
73 | }
74 | }
75 | }
76 |
77 | flutter {
78 | source '../..'
79 | }
80 |
81 | dependencies {
82 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
83 | testImplementation 'junit:junit:4.12'
84 | androidTestImplementation 'androidx.test:runner:1.1.1'
85 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
86 | }
87 |
--------------------------------------------------------------------------------
/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | #Flutter Wrapper
2 | -keep class io.flutter.app.** { *; }
3 | -keep class io.flutter.plugin.** { *; }
4 | -keep class io.flutter.util.** { *; }
5 | -keep class io.flutter.view.** { *; }
6 | -keep class io.flutter.** { *; }
7 | -keep class io.flutter.plugins.** { *; }
8 | # -keep class com.google.firebase.** { *; } // uncomment this if you are using firebase in the project
9 | -dontwarn io.flutter.embedding.**
10 | -ignorewarnings
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
9 |
13 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/viewus/wp_blog/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.viewus.wp_blog
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 |
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/viewus/wp_blog_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.viewus.wp_blog_app
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.21'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | jcenter()
7 | }
8 |
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:7.2.0'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | jcenter()
20 | }
21 | }
22 |
23 | rootProject.buildDir = '../build'
24 | subprojects {
25 | project.buildDir = "${rootProject.buildDir}/${project.name}"
26 | }
27 | subprojects {
28 | project.evaluationDependsOn(':app')
29 | }
30 |
31 | task clean(type: Delete) {
32 | delete rootProject.buildDir
33 | }
34 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/assets/images/img_error.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/assets/images/img_error.jpg
--------------------------------------------------------------------------------
/assets/images/newLoading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/assets/images/newLoading.gif
--------------------------------------------------------------------------------
/assets/images/pageloading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/assets/images/pageloading.gif
--------------------------------------------------------------------------------
/assets/logo/naijaguy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/assets/logo/naijaguy.png
--------------------------------------------------------------------------------
/assets/logo/naijatechguy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/assets/logo/naijatechguy.png
--------------------------------------------------------------------------------
/assets/logo/naijatechguyD.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/assets/logo/naijatechguyD.png
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sudo-which-qp/wp_blog_app/815dbe5836f657a3b09014ca394455409507c26b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | wp_blog_app
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/lib/app/screens/blog_View.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:hive/hive.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/const_values.dart';
6 | import 'package:wp_blog_app/models/posts.dart';
7 |
8 | class BlogView extends StatefulWidget {
9 | final Posts? index;
10 |
11 | const BlogView({this.index});
12 |
13 | @override
14 | _BlogViewState createState() => _BlogViewState();
15 | }
16 |
17 | class _BlogViewState extends State {
18 | displayTime(String date) {
19 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
20 | }
21 |
22 | Box? storeData;
23 |
24 | @override
25 | void initState() {
26 | super.initState();
27 | storeData = Hive.box(appState);
28 | }
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | return Scaffold(
33 | body: SingleChildScrollView(
34 | child: Column(
35 | children: [
36 | Stack(
37 | children: [
38 | Container(
39 | height: 300.h,
40 | decoration: BoxDecoration(
41 | borderRadius: const BorderRadius.only(
42 | bottomLeft: Radius.circular(33),
43 | bottomRight: Radius.circular(33),
44 | ),
45 | image: DecorationImage(
46 | image: NetworkImage('${widget.index!.image}'),
47 | fit: BoxFit.cover),
48 | ),
49 | ),
50 | ],
51 | ),
52 | Padding(
53 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
54 | child: Column(
55 | crossAxisAlignment: CrossAxisAlignment.start,
56 | children: [
57 | Text(
58 | '${widget.index!.title}',
59 | style: TextStyle(
60 | fontSize: 23.sp,
61 | fontWeight: FontWeight.bold,
62 | ),
63 | ),
64 | const SizedBox(
65 | height: 10,
66 | ),
67 | Text(
68 | "${displayTime(widget.index!.time.toString())}",
69 | style: const TextStyle(
70 | color: Colors.grey,
71 | fontWeight: FontWeight.bold,
72 | ),
73 | ),
74 | const SizedBox(
75 | height: 30,
76 | ),
77 | Text(
78 | '${widget.index!.contents}',
79 | style: TextStyle(
80 | fontSize: 18.sp,
81 | ),
82 | ),
83 | ],
84 | ),
85 | )
86 | ],
87 | ),
88 | ),
89 | );
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/lib/app/screens/bookmark.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:hive/hive.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:wp_blog_app/app/screens/blog_View.dart';
7 | import 'package:wp_blog_app/const_values.dart';
8 | import 'package:wp_blog_app/models/posts.dart';
9 | import 'package:hive_flutter/hive_flutter.dart';
10 |
11 | class Bookmark extends StatefulWidget {
12 | const Bookmark({Key? key}) : super(key: key);
13 |
14 | @override
15 | _BookmarkState createState() => _BookmarkState();
16 | }
17 |
18 | class _BookmarkState extends State {
19 | Box? storeData;
20 |
21 | displayTime(String date) {
22 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
23 | }
24 |
25 | @override
26 | void initState() {
27 | super.initState();
28 | storeData = Hive.box(appState);
29 | }
30 |
31 | /*
32 | * All the null exception in the body is because I stored a bool which I use
33 | * in changing the theme from dark mode to light mode.
34 | * this has been chnanged and fixed but if any user have the app installed
35 | * on their phones before that issue will still be there.
36 | * I will come up with a way to fix this soon.
37 | */
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | return ValueListenableBuilder(
42 | valueListenable: storeData!.listenable(),
43 | builder: (context, Box box, _) {
44 | // List keys = box.keys.cast().toList();
45 | return Scaffold(
46 | body: SingleChildScrollView(
47 | child: Padding(
48 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
49 | child: ListView.builder(
50 | physics: const NeverScrollableScrollPhysics(),
51 | primary: false,
52 | shrinkWrap: true,
53 | itemCount: storeData!.keys.toList().length,
54 | itemBuilder: (_, index) {
55 | final keys = box.keys.toList()[index];
56 | final Posts post = box.get(keys);
57 | return InkWell(
58 | onTap: () {
59 | Navigator.of(context)
60 | .push(MaterialPageRoute(builder: (_) {
61 | return BlogView(index: post);
62 | }));
63 | },
64 | onLongPress: () {
65 | showDialog(
66 | context: context,
67 | builder: (_) {
68 | return AlertDialog(
69 | title: const Text('Warning'),
70 | content: const Text(
71 | 'You are about to delete this bookmark are '
72 | 'you sure about this?',
73 | ),
74 | actions: [
75 | TextButton(
76 | onPressed: () {
77 | Navigator.pop(context);
78 | },
79 | child: const Text('No'),
80 | ),
81 | TextButton(
82 | onPressed: () {
83 | storeData!.delete(keys);
84 | Navigator.pop(context);
85 | },
86 | child: const Text('Yes'),
87 | ),
88 | ],
89 | );
90 | },
91 | );
92 | },
93 | child: Container(
94 | margin: const EdgeInsets.only(bottom: 20, top: 20),
95 | width: MediaQuery.of(context).size.width,
96 | child: Row(
97 | crossAxisAlignment: CrossAxisAlignment.start,
98 | children: [
99 | post.image == null
100 | ? Container()
101 | : Container(
102 | width: 100.w,
103 | height: 100.h,
104 | margin: const EdgeInsets.only(left: 20),
105 | decoration: const BoxDecoration(
106 | borderRadius: BorderRadius.all(
107 | Radius.circular(15.0),
108 | ),
109 | ),
110 | child: CachedNetworkImage(
111 | imageUrl: post.image ?? '',
112 | fit: BoxFit.cover,
113 | width: setContainerWidth(100),
114 | height: setContainerHeight(100),
115 | placeholder: (_, url) {
116 | return Image.asset(
117 | 'assets/images/newLoading.gif',
118 | width: 50,
119 | height: 50,
120 | );
121 | },
122 | ),
123 | ),
124 | const SizedBox(
125 | width: 15,
126 | ),
127 | Expanded(
128 | child: Column(
129 | crossAxisAlignment: CrossAxisAlignment.start,
130 | mainAxisAlignment: MainAxisAlignment.start,
131 | children: [
132 | Padding(
133 | padding: const EdgeInsets.all(8.0),
134 | child: post.title == null
135 | ? Container()
136 | : Text(
137 | '${post.title}',
138 | style: TextStyle(
139 | fontWeight: FontWeight.bold,
140 | fontSize: setTextSize(18),
141 | ),
142 | softWrap: true,
143 | overflow: TextOverflow.fade,
144 | ),
145 | ),
146 | Padding(
147 | padding: const EdgeInsets.all(5.0),
148 | child: post.time == null
149 | ? Container()
150 | : Text(
151 | "${displayTime(post.time.toString())}",
152 | ),
153 | ),
154 | ],
155 | ),
156 | )
157 | ],
158 | ),
159 | ),
160 | );
161 | },
162 | ),
163 | ),
164 | ),
165 | );
166 | },
167 | );
168 | }
169 | }
170 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/accessories.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class AccessoriesScreen extends StatefulWidget {
11 | const AccessoriesScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _AccessoriesScreenState createState() => _AccessoriesScreenState();
15 | }
16 |
17 | class _AccessoriesScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(476),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/android_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class AndroidCartScreen extends StatefulWidget {
11 | const AndroidCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _AndroidCartScreenState createState() => _AndroidCartScreenState();
15 | }
16 |
17 | class _AndroidCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(173),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/apps_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class AppsCartScreen extends StatefulWidget {
11 | const AppsCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _AppsCartScreenState createState() => _AppsCartScreenState();
15 | }
16 |
17 | class _AppsCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(17),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/gaming_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class GamingCartScreen extends StatefulWidget {
11 | const GamingCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _GamingCartScreenState createState() => _GamingCartScreenState();
15 | }
16 |
17 | class _GamingCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(176),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | style: TextStyle(),
136 | ),
137 | RefreshButton(
138 | text: 'Refresh',
139 | onPressed: () {
140 | setState(() {});
141 | },
142 | ),
143 | ],
144 | ),
145 | );
146 | } else if (snapshot.connectionState == ConnectionState.waiting) {
147 | return Center(
148 | child: Column(
149 | mainAxisAlignment: MainAxisAlignment.center,
150 | children: [
151 | const SizedBox(height: 10.0),
152 | Center(
153 | child: Image.asset(
154 | 'assets/images/newLoading.gif',
155 | width: 350,
156 | height: 200,
157 | ),
158 | ),
159 | ],
160 | ),
161 | );
162 | } else {
163 | return Center(
164 | child: Column(
165 | children: [
166 | const Padding(
167 | padding: EdgeInsets.all(20.0),
168 | child: Text(
169 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
170 | style: TextStyle(),
171 | softWrap: true,
172 | textAlign: TextAlign.center,
173 | ),
174 | ),
175 | RefreshButton(
176 | text: 'Refresh',
177 | onPressed: () {
178 | setState(() {});
179 | },
180 | ),
181 | ],
182 | ),
183 | );
184 | }
185 | },
186 | ),
187 | ),
188 | ),
189 | );
190 | }
191 | }
192 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/hacking_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class HackingScreen extends StatefulWidget {
11 | const HackingScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _HackingScreenState createState() => _HackingScreenState();
15 | }
16 |
17 | class _HackingScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(419),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/internet_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class InternetCartScreen extends StatefulWidget {
11 | const InternetCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _InternetCartScreenState createState() => _InternetCartScreenState();
15 | }
16 |
17 | class _InternetCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(416),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/ios_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class IosCartScreen extends StatefulWidget {
11 | const IosCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _IosCartScreenState createState() => _IosCartScreenState();
15 | }
16 |
17 | class _IosCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(286),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/network_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class NetworkCartScreen extends StatefulWidget {
11 | const NetworkCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _NetworkCartScreenState createState() => _NetworkCartScreenState();
15 | }
16 |
17 | class _NetworkCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(413),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .substring(0, 20) +
100 | "...",
101 | style: TextStyle(
102 | fontWeight: FontWeight.bold,
103 | fontSize: 18.sp,
104 | ),
105 | softWrap: true,
106 | overflow: TextOverflow.fade,
107 | ),
108 | ),
109 | Padding(
110 | padding: const EdgeInsets.all(8.0),
111 | child: Text(
112 | "${displayTime(snapshot.data[index].time)}",
113 | ),
114 | ),
115 | ],
116 | ),
117 | )
118 | ],
119 | ),
120 | ),
121 | );
122 | },
123 | );
124 | } else if (snapshot.connectionState == ConnectionState.none) {
125 | return Center(
126 | child: Column(
127 | children: [
128 | const Text(
129 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
130 | ),
131 | RefreshButton(
132 | text: 'Refresh',
133 | onPressed: () {
134 | setState(() {});
135 | },
136 | ),
137 | ],
138 | ),
139 | );
140 | } else if (snapshot.connectionState == ConnectionState.waiting) {
141 | return Center(
142 | child: Column(
143 | mainAxisAlignment: MainAxisAlignment.center,
144 | children: [
145 | const SizedBox(height: 10.0),
146 | Center(
147 | child: Image.asset(
148 | 'assets/images/newLoading.gif',
149 | width: 350,
150 | height: 200,
151 | ),
152 | ),
153 | ],
154 | ),
155 | );
156 | } else {
157 | return Center(
158 | child: Column(
159 | children: [
160 | const Padding(
161 | padding: EdgeInsets.all(20.0),
162 | child: Text(
163 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
164 | softWrap: true,
165 | textAlign: TextAlign.center,
166 | ),
167 | ),
168 | RefreshButton(
169 | text: 'Refresh',
170 | onPressed: () {
171 | setState(() {});
172 | },
173 | ),
174 | ],
175 | ),
176 | );
177 | }
178 | },
179 | ),
180 | ),
181 | ),
182 | );
183 | }
184 | }
185 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/reviews_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class ReviewsCartScreen extends StatefulWidget {
11 | const ReviewsCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _ReviewsCartScreenState createState() => _ReviewsCartScreenState();
15 | }
16 |
17 | class _ReviewsCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(417),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | softWrap: true,
170 | textAlign: TextAlign.center,
171 | ),
172 | ),
173 | RefreshButton(
174 | text: 'Refresh',
175 | onPressed: () {
176 | setState(() {});
177 | },
178 | ),
179 | ],
180 | ),
181 | );
182 | }
183 | },
184 | ),
185 | ),
186 | ),
187 | );
188 | }
189 | }
190 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/social_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class SocialCartScreen extends StatefulWidget {
11 | const SocialCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _SocialCartScreenState createState() => _SocialCartScreenState();
15 | }
16 |
17 | class _SocialCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(185),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 19.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | style: TextStyle(),
136 | ),
137 | RefreshButton(
138 | text: 'Refresh',
139 | onPressed: () {
140 | setState(() {});
141 | },
142 | ),
143 | ],
144 | ),
145 | );
146 | } else if (snapshot.connectionState == ConnectionState.waiting) {
147 | return Center(
148 | child: Column(
149 | mainAxisAlignment: MainAxisAlignment.center,
150 | children: [
151 | const SizedBox(height: 10.0),
152 | Center(
153 | child: Image.asset(
154 | 'assets/images/newLoading.gif',
155 | width: 350,
156 | height: 200,
157 | ),
158 | ),
159 | ],
160 | ),
161 | );
162 | } else {
163 | return Center(
164 | child: Column(
165 | children: [
166 | const Padding(
167 | padding: EdgeInsets.all(20.0),
168 | child: Text(
169 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
170 | style: TextStyle(),
171 | softWrap: true,
172 | textAlign: TextAlign.center,
173 | ),
174 | ),
175 | RefreshButton(
176 | text: 'Refresh',
177 | onPressed: () {
178 | setState(() {});
179 | },
180 | ),
181 | ],
182 | ),
183 | );
184 | }
185 | },
186 | ),
187 | ),
188 | ),
189 | );
190 | }
191 | }
192 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/tech_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class TechCartScreen extends StatefulWidget {
11 | const TechCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _TechCartScreenState createState() => _TechCartScreenState();
15 | }
16 |
17 | class _TechCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(149),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you internet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/category_screens/tutorial_cart.dart:
--------------------------------------------------------------------------------
1 | import 'package:cached_network_image/cached_network_image.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:intl/intl.dart';
5 | import 'package:wp_blog_app/app/screens/post_view.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/widgets/refresh_button.dart';
8 | import 'package:wp_blog_app/wp_api.dart';
9 |
10 | class TutorialCartScreen extends StatefulWidget {
11 | const TutorialCartScreen({Key? key}) : super(key: key);
12 |
13 | @override
14 | _TutorialCartScreenState createState() => _TutorialCartScreenState();
15 | }
16 |
17 | class _TutorialCartScreenState extends State {
18 | WpApi api = WpApi();
19 |
20 | String formatDateTime(DateTime dateTime) {
21 | return "${dateTime.day}/${dateTime.month}/${dateTime.year}";
22 | }
23 |
24 | displayTime(String date) {
25 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
26 | }
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | return Scaffold(
31 | appBar: AppBar(
32 | title: const Text("NaijaTechGuy Blog"),
33 | ),
34 | body: SingleChildScrollView(
35 | child: Padding(
36 | padding: const EdgeInsets.symmetric(horizontal: 20.0),
37 | child: FutureBuilder(
38 | future: api.fetchOtherCategories(371),
39 | builder: (context, AsyncSnapshot snapshot) {
40 | if (snapshot.connectionState == ConnectionState.done &&
41 | snapshot.hasData) {
42 | return ListView.builder(
43 | primary: false,
44 | physics: const NeverScrollableScrollPhysics(),
45 | shrinkWrap: true,
46 | itemCount: snapshot.data.length,
47 | itemBuilder: (_, index) {
48 | return InkWell(
49 | onTap: () {
50 | var post = snapshot.data[index];
51 | Navigator.of(context).push(
52 | MaterialPageRoute(builder: (_) {
53 | return PostView(
54 | posts: post,
55 | );
56 | }),
57 | );
58 | },
59 | child: Container(
60 | margin: const EdgeInsets.only(bottom: 20, top: 20),
61 | width: MediaQuery.of(context).size.width,
62 | child: Row(
63 | crossAxisAlignment: CrossAxisAlignment.start,
64 | children: [
65 | Container(
66 | width: 100.w,
67 | height: 100.h,
68 | margin: const EdgeInsets.only(left: 20),
69 | decoration: BoxDecoration(
70 | borderRadius: const BorderRadius.all(
71 | Radius.circular(15.0),
72 | ),
73 | image: DecorationImage(
74 | image: NetworkImage(
75 | snapshot.data[index].image,
76 | ),
77 | fit: BoxFit.cover,
78 | ),
79 | ),
80 | child: CachedNetworkImage(
81 | imageUrl: snapshot.data[index].image,
82 | fit: BoxFit.cover,
83 | width: 100.w,
84 | height: 100.h,
85 | ),
86 | ),
87 | const SizedBox(
88 | width: 15,
89 | ),
90 | Expanded(
91 | child: Column(
92 | crossAxisAlignment: CrossAxisAlignment.start,
93 | mainAxisAlignment: MainAxisAlignment.start,
94 | children: [
95 | Padding(
96 | padding: const EdgeInsets.all(8.0),
97 | child: Text(
98 | snapshot.data[index].title
99 | .toString()
100 | .length >=
101 | 20
102 | ? snapshot.data[index].title
103 | .substring(0, 20) +
104 | "..."
105 | : snapshot.data[index].title,
106 | style: TextStyle(
107 | fontWeight: FontWeight.bold,
108 | fontSize: 18.sp,
109 | ),
110 | softWrap: true,
111 | overflow: TextOverflow.fade,
112 | ),
113 | ),
114 | Padding(
115 | padding: const EdgeInsets.all(8.0),
116 | child: Text(
117 | "${displayTime(snapshot.data[index].time)}",
118 | ),
119 | ),
120 | ],
121 | ),
122 | )
123 | ],
124 | ),
125 | ),
126 | );
127 | },
128 | );
129 | } else if (snapshot.connectionState == ConnectionState.none) {
130 | return Center(
131 | child: Column(
132 | children: [
133 | const Text(
134 | "Sorry please check you intetnet connection, and swipe on pull down to refresh \n \n Or",
135 | ),
136 | RefreshButton(
137 | text: 'Refresh',
138 | onPressed: () {
139 | setState(() {});
140 | },
141 | ),
142 | ],
143 | ),
144 | );
145 | } else if (snapshot.connectionState == ConnectionState.waiting) {
146 | return Center(
147 | child: Column(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | const SizedBox(height: 10.0),
151 | Center(
152 | child: Image.asset(
153 | 'assets/images/newLoading.gif',
154 | width: 350,
155 | height: 200,
156 | ),
157 | ),
158 | ],
159 | ),
160 | );
161 | } else {
162 | return Center(
163 | child: Column(
164 | children: [
165 | const Padding(
166 | padding: EdgeInsets.all(20.0),
167 | child: Text(
168 | "Please check if you are connected to the internet and swipe or pull down to refresh \n \n Or",
169 | style: TextStyle(),
170 | softWrap: true,
171 | textAlign: TextAlign.center,
172 | ),
173 | ),
174 | RefreshButton(
175 | text: 'Refresh',
176 | onPressed: () {
177 | setState(() {});
178 | },
179 | ),
180 | ],
181 | ),
182 | );
183 | }
184 | },
185 | ),
186 | ),
187 | ),
188 | );
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/lib/app/screens/home_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:hive/hive.dart';
3 | import 'package:intl/intl.dart';
4 | import 'package:provider/provider.dart';
5 | import 'package:pull_to_refresh/pull_to_refresh.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/providers/theme_provider.dart';
8 | import 'package:wp_blog_app/widgets/horizonatl_view.dart';
9 | import 'package:wp_blog_app/widgets/list_view_post.dart';
10 |
11 | class HomeScreen extends StatefulWidget {
12 | const HomeScreen({Key? key}) : super(key: key);
13 |
14 | @override
15 | _HomeScreenState createState() => _HomeScreenState();
16 | }
17 |
18 | class _HomeScreenState extends State {
19 | var dateFormat = DateFormat.yMMMMEEEEd().format(DateTime.now());
20 |
21 | RefreshController refreshController =
22 | RefreshController(initialRefresh: false);
23 |
24 | Box? storeData;
25 |
26 | @override
27 | void initState() {
28 | super.initState();
29 | const HorizontalView();
30 | const ListViewPost();
31 | storeData = Hive.box(appState);
32 | }
33 |
34 | void _onRefresh() async {
35 | // monitor network fetch
36 | await Future.delayed(const Duration(milliseconds: 1000));
37 | if (mounted) {
38 | setState(() {});
39 | }
40 | // if failed,use refreshFailed()
41 | refreshController.refreshCompleted();
42 | }
43 |
44 | void _onLoading() async {
45 | // monitor network fetch
46 | await Future.delayed(const Duration(milliseconds: 1000));
47 | // getSermons();
48 | // if (mounted) {
49 | // setState(() {});
50 | // }
51 | refreshController.loadComplete();
52 | }
53 |
54 | @override
55 | Widget build(BuildContext context) {
56 | final isThemeChange = Provider.of(context);
57 | return SafeArea(
58 | top: true,
59 | child: Scaffold(
60 | // backgroundColor: changeData.isDark == false ? mainColor : darkColor,
61 | body: SmartRefresher(
62 | controller: refreshController,
63 | enablePullDown: true,
64 | onRefresh: _onRefresh,
65 | onLoading: _onLoading,
66 | child: SingleChildScrollView(
67 | child: Padding(
68 | padding: const EdgeInsets.symmetric(vertical: 0.0),
69 | child: Column(
70 | crossAxisAlignment: CrossAxisAlignment.start,
71 | children: [
72 | Container(
73 | height: setContainerHeight(290),
74 | decoration: BoxDecoration(
75 | color: isThemeChange.mTheme == false
76 | ? Colors.white
77 | : Colors.grey[900],
78 | borderRadius: const BorderRadius.only(
79 | bottomLeft: Radius.circular(33),
80 | bottomRight: Radius.circular(33),
81 | ),
82 | ),
83 | child: Container(
84 | height: setContainerHeight(290),
85 | child: Column(
86 | children: [
87 | Container(
88 | height: setContainerHeight(50),
89 | child: Padding(
90 | padding: const EdgeInsets.symmetric(
91 | horizontal: 20.0, vertical: 10.0),
92 | child: Row(
93 | mainAxisAlignment:
94 | MainAxisAlignment.spaceBetween,
95 | children: [
96 | Text(
97 | "Latest",
98 | style: TextStyle(
99 | fontWeight: FontWeight.bold,
100 | fontSize: setTextSize(25),
101 | ),
102 | ),
103 | Text(
104 | "$dateFormat",
105 | style: TextStyle(
106 | fontWeight: FontWeight.bold,
107 | color: Colors.grey,
108 | fontSize: setTextSize(10),
109 | ),
110 | ),
111 | ],
112 | ),
113 | ),
114 | ),
115 | HorizontalView(),
116 | ],
117 | ),
118 | ),
119 | ),
120 | Container(
121 | padding:
122 | const EdgeInsets.only(left: 30, bottom: 10, top: 15),
123 | child: Column(
124 | children: [
125 | Text(
126 | "Smart Phones",
127 | style: TextStyle(
128 | fontWeight: FontWeight.bold,
129 | fontSize: setTextSize(20),
130 | ),
131 | textAlign: TextAlign.left,
132 | ),
133 | ],
134 | ),
135 | ),
136 | ListViewPost(),
137 | ],
138 | ),
139 | ),
140 | ),
141 | ),
142 | ),
143 | );
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/lib/app/screens/post_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:fluttertoast/fluttertoast.dart';
4 | import 'package:hive/hive.dart';
5 | import 'package:intl/intl.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/models/posts.dart';
8 |
9 | class PostView extends StatefulWidget {
10 | final Posts? posts;
11 |
12 | const PostView({Key? key, @required this.posts}) : super(key: key);
13 |
14 | @override
15 | _PostViewState createState() => _PostViewState();
16 | }
17 |
18 | class _PostViewState extends State {
19 | displayTime(String date) {
20 | return DateFormat.yMMMMEEEEd().format(DateTime.parse(date));
21 | }
22 |
23 | Box? storeData;
24 |
25 | @override
26 | void initState() {
27 | super.initState();
28 | storeData = Hive.box(appState);
29 | }
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | return Scaffold(
34 | body: SingleChildScrollView(
35 | child: Column(
36 | children: [
37 | Stack(
38 | children: [
39 | Container(
40 | height: 300.h,
41 | decoration: BoxDecoration(
42 | borderRadius: const BorderRadius.only(
43 | bottomLeft: Radius.circular(33),
44 | bottomRight: Radius.circular(33),
45 | ),
46 | image: DecorationImage(
47 | image: NetworkImage('${widget.posts!.image}'),
48 | fit: BoxFit.cover),
49 | ),
50 | ),
51 | ],
52 | ),
53 | Padding(
54 | padding: const EdgeInsets.all(25.0),
55 | child: Column(
56 | crossAxisAlignment: CrossAxisAlignment.start,
57 | children: [
58 | Text(
59 | '${widget.posts!.title}',
60 | style: TextStyle(
61 | fontSize: 23.sp,
62 | fontWeight: FontWeight.bold,
63 | ),
64 | ),
65 | const SizedBox(
66 | height: 10,
67 | ),
68 | Row(
69 | children: [
70 | Text(
71 | '${displayTime(widget.posts!.time.toString())}',
72 | style: const TextStyle(
73 | color: Colors.grey,
74 | fontWeight: FontWeight.bold,
75 | ),
76 | ),
77 | const SizedBox(
78 | width: 10,
79 | ),
80 | InkWell(
81 | onTap: () async {
82 | Posts post = Posts(
83 | title: widget.posts!.title,
84 | image: widget.posts!.image,
85 | contents: widget.posts!.contents,
86 | time: widget.posts!.time,
87 | authur: widget.posts!.authur,
88 | );
89 | await storeData!.add(post);
90 | Fluttertoast.showToast(
91 | msg: 'Bookmarked!!!',
92 | gravity: ToastGravity.BOTTOM,
93 | toastLength: Toast.LENGTH_SHORT,
94 | );
95 | },
96 | child: const Icon(
97 | Icons.bookmark_border,
98 | ),
99 | ),
100 | ],
101 | ),
102 | const SizedBox(
103 | height: 30,
104 | ),
105 | Text(
106 | '${widget.posts!.contents}',
107 | style: TextStyle(
108 | fontSize: 18.sp,
109 | ),
110 | ),
111 | ],
112 | ),
113 | ),
114 | ],
115 | ),
116 | ),
117 | );
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/lib/app/screens/settings.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:launch_review/launch_review.dart';
4 | import 'package:provider/provider.dart';
5 | import 'package:share/share.dart';
6 | import 'package:wp_blog_app/const_values.dart';
7 | import 'package:wp_blog_app/providers/theme_provider.dart';
8 |
9 | class Settings extends StatefulWidget {
10 | const Settings({Key? key}) : super(key: key);
11 |
12 | @override
13 | _SettingsState createState() => _SettingsState();
14 | }
15 |
16 | class _SettingsState extends State {
17 | String devInfo = "Hi, I'm Godsend Joseph by name, I am a Flutter "
18 | "Developer, you can click on contact us to get my contacts";
19 |
20 | String aboutBlog = "NaijaTechGuy is a Nigerian Technology Website "
21 | "Focused on Publishing the latest news on technology, smartphones,"
22 | " gadgets and more related content";
23 | @override
24 | Widget build(BuildContext context) {
25 | final isThemeChange = Provider.of(context);
26 | return Scaffold(
27 | body: SingleChildScrollView(
28 | child: Padding(
29 | padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
30 | child: Column(
31 | mainAxisAlignment: MainAxisAlignment.center,
32 | children: [
33 | Center(
34 | child: Column(
35 | children: [
36 | Container(
37 | height: 100.h,
38 | width: 300.w,
39 | decoration: BoxDecoration(
40 | image: DecorationImage(
41 | image: isThemeChange.mTheme == false
42 | ? const AssetImage('assets/logo/naijatechguyD.png')
43 | : const AssetImage('assets/logo/naijatechguy.png'),
44 | ),
45 | ),
46 | ),
47 | Text(
48 | aboutBlog,
49 | style: TextStyle(
50 | fontSize: 15.sp,
51 | ),
52 | textAlign: TextAlign.center,
53 | )
54 | ],
55 | ),
56 | ),
57 | const SizedBox(
58 | height: 50,
59 | ),
60 | ListTile(
61 | title: Text(
62 | "Notifications",
63 | style: TextStyle(
64 | fontSize: 18.sp,
65 | ),
66 | ),
67 | subtitle: Text(
68 | "Subscribe to notifications (Not Available Yet!)",
69 | style: TextStyle(
70 | fontSize: 13.sp,
71 | ),
72 | ),
73 | trailing: const Switch(value: true, onChanged: null),
74 | ),
75 | const Divider(),
76 | ListTile(
77 | title: Text(
78 | "About Us",
79 | style: TextStyle(
80 | fontSize: 18.sp,
81 | ),
82 | ),
83 | subtitle: Text(
84 | "About the developer",
85 | style: TextStyle(
86 | fontSize: 13.sp,
87 | ),
88 | ),
89 | trailing: const Icon(
90 | Icons.info,
91 | color: subColor,
92 | ),
93 | onTap: () {
94 | showDialog(
95 | context: context,
96 | builder: (_) {
97 | return AlertDialog(
98 | title: const Text(
99 | "About the Developer",
100 | ),
101 | content: Text(
102 | devInfo,
103 | style: TextStyle(
104 | fontSize: 15.sp,
105 | ),
106 | ),
107 | );
108 | },
109 | );
110 | },
111 | ),
112 | const Divider(),
113 | ListTile(
114 | title: Text(
115 | "Contact Us",
116 | style: TextStyle(
117 | fontSize: 18.sp,
118 | ),
119 | ),
120 | subtitle: Text(
121 | "Contact the developer",
122 | style: TextStyle(
123 | fontSize: 13.sp,
124 | ),
125 | ),
126 | trailing: const Icon(
127 | Icons.phone,
128 | color: subColor,
129 | ),
130 | onTap: () {
131 | showDialog(
132 | context: context,
133 | builder: (_) {
134 | return AlertDialog(
135 | title: const Text(
136 | "Developer Contact",
137 | ),
138 | content: Column(
139 | mainAxisSize: MainAxisSize.min,
140 | children: [
141 | ListTile(
142 | leading: const Icon(
143 | Icons.email,
144 | ),
145 | title: Text(
146 | "godsendjoseph@gmail.com",
147 | style: TextStyle(
148 | fontSize: 15.sp,
149 | ),
150 | ),
151 | ),
152 | ListTile(
153 | leading: const Icon(
154 | Icons.phone,
155 | ),
156 | title: Text(
157 | "+234 8140864923",
158 | style: TextStyle(
159 | fontSize: 15.sp,
160 | ),
161 | ),
162 | ),
163 | ],
164 | ),
165 | );
166 | },
167 | );
168 | },
169 | ),
170 | const Divider(),
171 | ListTile(
172 | title: Text(
173 | "Share",
174 | style: TextStyle(
175 | fontSize: 18.sp,
176 | ),
177 | ),
178 | subtitle: Text(
179 | "Share the app with friends",
180 | style: TextStyle(
181 | fontSize: 13.sp,
182 | ),
183 | ),
184 | trailing: const Icon(
185 | Icons.share,
186 | color: subColor,
187 | ),
188 | onTap: () {
189 | Share.share('check out my blog app for Naija Tech Guy',
190 | subject: 'Look what I made!');
191 | },
192 | ),
193 | const Divider(),
194 | ListTile(
195 | title: Text(
196 | "Rate Us",
197 | style: TextStyle(
198 | fontSize: 18.sp,
199 | ),
200 | ),
201 | subtitle: Text(
202 | "Rate the app on play store",
203 | style: TextStyle(
204 | fontSize: 13.sp,
205 | ),
206 | ),
207 | trailing: const Icon(
208 | Icons.star,
209 | color: subColor,
210 | ),
211 | onTap: () {
212 | LaunchReview.launch(
213 | androidAppId: "com.viewus.wp_blog",
214 | );
215 | },
216 | ),
217 | ],
218 | ),
219 | ),
220 | ),
221 | );
222 | }
223 | }
224 |
--------------------------------------------------------------------------------
/lib/app/screens/tab_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:bottom_navy_bar/bottom_navy_bar.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:hive/hive.dart';
4 | import 'package:provider/provider.dart';
5 | import 'package:wp_blog_app/app/screens/bookmark.dart';
6 | import 'package:wp_blog_app/app/screens/category.dart';
7 | import 'package:wp_blog_app/app/screens/home_screen.dart';
8 | import 'package:wp_blog_app/app/screens/settings.dart';
9 | import 'package:wp_blog_app/const_values.dart';
10 | import 'package:wp_blog_app/providers/theme_provider.dart';
11 |
12 | class TabView extends StatefulWidget {
13 | const TabView({Key? key}) : super(key: key);
14 |
15 | @override
16 | _TabViewState createState() => _TabViewState();
17 | }
18 |
19 | class _TabViewState extends State {
20 | final List