├── .github
└── workflows
│ └── dart.yml
├── .gitignore
├── .idea
├── .gitignore
├── encodings.xml
├── libraries
│ ├── Dart_Packages.xml
│ ├── Dart_SDK.xml
│ ├── Flutter_Plugins.xml
│ └── Flutter_for_Android.xml
├── misc.xml
├── modules.xml
├── runConfigurations
│ └── main_dart.xml
└── vcs.xml
├── .metadata
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── flutternewsweb
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable
│ │ └── launch_background.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── flutter_01.log
├── flutter_news_web.iml
├── flutter_news_web_android.iml
├── images
├── business_news.png
├── entertainment_news.png
├── health.jpg
├── health_news.png
├── no_image_available.png
├── politics_news.png
├── science_news.png
├── sports_news.png
├── tech_news.png
└── top_news.png
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ └── contents.xcworkspacedata
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── 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
│ └── main.m
├── lib
├── main.dart
└── src
│ ├── app.dart
│ ├── bloc
│ └── news_bloc.dart
│ ├── model
│ ├── categories_model.dart
│ └── news_model.dart
│ ├── network
│ ├── api_base_helper.dart
│ ├── api_exception.dart
│ ├── api_response.dart
│ └── repository
│ │ ├── I_news_api.dart
│ │ └── news_api.dart
│ └── ui
│ ├── home_page.dart
│ ├── news_details.dart
│ ├── news_list.dart
│ └── web_view.dart
├── pubspec.lock
├── pubspec.yaml
├── screenshots
├── device-2018-12-05-220930.png
├── device-2018-12-05-220954.png
└── device-2018-12-05-221016.png
└── test
└── widget_test.dart
/.github/workflows/dart.yml:
--------------------------------------------------------------------------------
1 | on: push
2 | name: Test, Build and Release apk
3 | jobs:
4 | build:
5 | name: Build APK
6 | runs-on: ubuntu-latest
7 | steps:
8 | - uses: actions/checkout@v1
9 | - uses: actions/setup-java@v1
10 | with:
11 | java-version: '12.x'
12 | - uses: subosito/flutter-action@v1
13 | with:
14 | flutter-version: '1.7.8+hotfix.4'
15 | - run: chmod +x gradlew
16 | - run: flutter pub get
17 | - run: flutter build apk
18 | - name: Create a Release APK
19 | uses: ncipollo/release-action@v1
20 | with:
21 | artifacts: "build/app/outputs/apk/debug/*.apk"
22 | token: ${{ secrets.TOKEN }}
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /workspace.xml
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_Packages.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/.idea/libraries/Flutter_Plugins.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/libraries/Flutter_for_Android.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_news_web
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.io/).
9 |
10 |
11 | # Screenshots
12 |
13 | 

14 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/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 GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | apply plugin: 'com.android.application'
15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
16 |
17 | android {
18 | compileSdkVersion 27
19 |
20 | lintOptions {
21 | disable 'InvalidPackage'
22 | }
23 |
24 | defaultConfig {
25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
26 | applicationId "com.example.flutternewsweb"
27 | minSdkVersion 16
28 | targetSdkVersion 27
29 | versionCode 1
30 | versionName "1.0"
31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
32 | }
33 |
34 | buildTypes {
35 | release {
36 | // TODO: Add your own signing config for the release build.
37 | // Signing with the debug keys for now, so `flutter run --release` works.
38 | signingConfig signingConfigs.debug
39 | }
40 | }
41 | }
42 |
43 | flutter {
44 | source '../..'
45 | }
46 |
47 | dependencies {
48 | testImplementation 'junit:junit:4.12'
49 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
51 | }
52 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/example/flutternewsweb/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.flutternewsweb;
2 |
3 | import android.os.Bundle;
4 | import io.flutter.app.FlutterActivity;
5 | import io.flutter.plugins.GeneratedPluginRegistrant;
6 |
7 | public class MainActivity extends FlutterActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | GeneratedPluginRegistrant.registerWith(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.0.1'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/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-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/flutter_01.log:
--------------------------------------------------------------------------------
1 | Flutter crash report; please file at https://github.com/flutter/flutter/issues.
2 |
3 | ## command
4 |
5 | flutter build apk
6 |
7 | ## exception
8 |
9 | ProcessException: ProcessException: Process "E:\Android\FlutterProjects\Flutter-NewsWeb\android\gradlew.bat" exited abnormally:
10 |
11 | FAILURE: Build failed with an exception.
12 |
13 | * What went wrong:
14 | Could not determine java version from '12.0.1'.
15 |
16 | * Try:
17 | Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
18 |
19 | * Get more help at https://help.gradle.org
20 | Command: E:\Android\FlutterProjects\Flutter-NewsWeb\android\gradlew.bat -v
21 |
22 | ```
23 | #0 runCheckedAsync (package:flutter_tools/src/base/process.dart:255:5)
24 |
25 | #1 _initializeGradle (package:flutter_tools/src/android/gradle.dart:225:9)
26 |
27 | #2 _ensureGradle (package:flutter_tools/src/android/gradle.dart:206:37)
28 |
29 | #3 buildGradleProject (package:flutter_tools/src/android/gradle.dart:336:31)
30 |
31 | #4 buildApk (package:flutter_tools/src/android/apk.dart:34:9)
32 |
33 | #5 BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:51:11)
34 |
35 | #6 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:559:18)
36 | #7 _asyncThenWrapperHelper. (dart:async-patch/async_patch.dart:77:64)
37 | #8 _rootRunUnary (dart:async/zone.dart:1132:38)
38 | #9 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
39 | #10 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
40 | #11 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
41 | #12 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
42 | #13 Future._complete (dart:async/future_impl.dart:473:7)
43 | #14 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
44 | #15 _AsyncAwaitCompleter.complete. (dart:async-patch/async_patch.dart:33:20)
45 | #16 _rootRun (dart:async/zone.dart:1124:13)
46 | #17 _CustomZone.run (dart:async/zone.dart:1021:19)
47 | #18 _CustomZone.bindCallback. (dart:async/zone.dart:947:23)
48 | #19 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
49 | #20 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
50 | #21 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
51 | #22 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)
52 | ```
53 |
54 | ## flutter doctor
55 |
56 | ```
57 | [32m[✓][39m Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17134.765], locale en-IN)
58 | [32m•[39m Flutter version 1.5.4-hotfix.2 at E:\flutter
59 | [32m•[39m Framework revision 7a4c33425d (3 weeks ago), 2019-04-29 11:05:24 -0700
60 | [32m•[39m Engine revision 52c7a1e849
61 | [32m•[39m Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
62 |
63 | [33m[!][39m Android toolchain - develop for Android devices (Android SDK version 28.0.3)
64 | [32m•[39m Android SDK at E:\Android\sdk
65 | [32m•[39m Android NDK location not configured (optional; useful for native profiling support)
66 | [32m•[39m Platform android-28, build-tools 28.0.3
67 | [32m•[39m ANDROID_HOME = E:\Android\sdk
68 | [32m•[39m Java binary at: C:\Program Files\Java\jdk-12.0.1\bin\java
69 | [32m•[39m Java version Java(TM) SE Runtime Environment (build 12.0.1+12)
70 | [31m✗[39m Android license status unknown.
71 | Try re-installing or updating your Android SDK Manager.
72 | See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
73 |
74 | [33m[!][39m Android Studio (not installed)
75 | [32m•[39m Android Studio not found; download from https://developer.android.com/studio/index.html
76 | (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
77 |
78 | [32m[✓][39m IntelliJ IDEA Community Edition (version 2019.1)
79 | [32m•[39m IntelliJ at E:\IntelliJ IDEA Community Edition 2019.1.2
80 | [32m•[39m Flutter plugin version 35.3.3
81 | [32m•[39m Dart plugin version 191.7141.49
82 |
83 | [32m[✓][39m Connected device (1 available)
84 | [32m•[39m Nokia 5 1 Plus • PDAID18082500568 • android-arm64 • Android 9 (API 28)
85 |
86 | [33m![39m Doctor found issues in 2 categories.
87 | ```
88 |
--------------------------------------------------------------------------------
/flutter_news_web.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/flutter_news_web_android.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/images/business_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/business_news.png
--------------------------------------------------------------------------------
/images/entertainment_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/entertainment_news.png
--------------------------------------------------------------------------------
/images/health.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/health.jpg
--------------------------------------------------------------------------------
/images/health_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/health_news.png
--------------------------------------------------------------------------------
/images/no_image_available.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/no_image_available.png
--------------------------------------------------------------------------------
/images/politics_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/politics_news.png
--------------------------------------------------------------------------------
/images/science_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/science_news.png
--------------------------------------------------------------------------------
/images/sports_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/sports_news.png
--------------------------------------------------------------------------------
/images/tech_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/tech_news.png
--------------------------------------------------------------------------------
/images/top_news.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/images/top_news.png
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 | .symlinks/
46 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
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/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14 | 59B6EBD8CC3C04486DEDEACC /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E400AFE2ACDC0EEE731D75AF /* libPods-Runner.a */; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXCopyFilesBuildPhase section */
27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
28 | isa = PBXCopyFilesBuildPhase;
29 | buildActionMask = 2147483647;
30 | dstPath = "";
31 | dstSubfolderSpec = 10;
32 | files = (
33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
35 | );
36 | name = "Embed Frameworks";
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXCopyFilesBuildPhase section */
40 |
41 | /* Begin PBXFileReference section */
42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
46 | 7362D2D41BBA462846BC0D5E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
59 | CABB379553436A75F3CE7F8F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
60 | E400AFE2ACDC0EEE731D75AF /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
61 | /* End PBXFileReference section */
62 |
63 | /* Begin PBXFrameworksBuildPhase section */
64 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
65 | isa = PBXFrameworksBuildPhase;
66 | buildActionMask = 2147483647;
67 | files = (
68 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
69 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
70 | 59B6EBD8CC3C04486DEDEACC /* libPods-Runner.a in Frameworks */,
71 | );
72 | runOnlyForDeploymentPostprocessing = 0;
73 | };
74 | /* End PBXFrameworksBuildPhase section */
75 |
76 | /* Begin PBXGroup section */
77 | 9740EEB11CF90186004384FC /* Flutter */ = {
78 | isa = PBXGroup;
79 | children = (
80 | 3B80C3931E831B6300D905FE /* App.framework */,
81 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
82 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
83 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
84 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
85 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
86 | );
87 | name = Flutter;
88 | sourceTree = "";
89 | };
90 | 97C146E51CF9000F007C117D = {
91 | isa = PBXGroup;
92 | children = (
93 | 9740EEB11CF90186004384FC /* Flutter */,
94 | 97C146F01CF9000F007C117D /* Runner */,
95 | 97C146EF1CF9000F007C117D /* Products */,
96 | F569BA5B905E3470EA16129B /* Pods */,
97 | BDC7BB4A360D42B71A6CED1F /* Frameworks */,
98 | );
99 | sourceTree = "";
100 | };
101 | 97C146EF1CF9000F007C117D /* Products */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 97C146EE1CF9000F007C117D /* Runner.app */,
105 | );
106 | name = Products;
107 | sourceTree = "";
108 | };
109 | 97C146F01CF9000F007C117D /* Runner */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
113 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
114 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
115 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
116 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
117 | 97C147021CF9000F007C117D /* Info.plist */,
118 | 97C146F11CF9000F007C117D /* Supporting Files */,
119 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
120 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
121 | );
122 | path = Runner;
123 | sourceTree = "";
124 | };
125 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
126 | isa = PBXGroup;
127 | children = (
128 | 97C146F21CF9000F007C117D /* main.m */,
129 | );
130 | name = "Supporting Files";
131 | sourceTree = "";
132 | };
133 | BDC7BB4A360D42B71A6CED1F /* Frameworks */ = {
134 | isa = PBXGroup;
135 | children = (
136 | E400AFE2ACDC0EEE731D75AF /* libPods-Runner.a */,
137 | );
138 | name = Frameworks;
139 | sourceTree = "";
140 | };
141 | F569BA5B905E3470EA16129B /* Pods */ = {
142 | isa = PBXGroup;
143 | children = (
144 | CABB379553436A75F3CE7F8F /* Pods-Runner.debug.xcconfig */,
145 | 7362D2D41BBA462846BC0D5E /* Pods-Runner.release.xcconfig */,
146 | );
147 | name = Pods;
148 | path = Pods;
149 | sourceTree = "";
150 | };
151 | /* End PBXGroup section */
152 |
153 | /* Begin PBXNativeTarget section */
154 | 97C146ED1CF9000F007C117D /* Runner */ = {
155 | isa = PBXNativeTarget;
156 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
157 | buildPhases = (
158 | 9A841185D099ADDD31151264 /* [CP] Check Pods Manifest.lock */,
159 | 9740EEB61CF901F6004384FC /* Run Script */,
160 | 97C146EA1CF9000F007C117D /* Sources */,
161 | 97C146EB1CF9000F007C117D /* Frameworks */,
162 | 97C146EC1CF9000F007C117D /* Resources */,
163 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
164 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
165 | 188D2A21FED25EE80F22844C /* [CP] Embed Pods Frameworks */,
166 | );
167 | buildRules = (
168 | );
169 | dependencies = (
170 | );
171 | name = Runner;
172 | productName = Runner;
173 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
174 | productType = "com.apple.product-type.application";
175 | };
176 | /* End PBXNativeTarget section */
177 |
178 | /* Begin PBXProject section */
179 | 97C146E61CF9000F007C117D /* Project object */ = {
180 | isa = PBXProject;
181 | attributes = {
182 | LastUpgradeCheck = 0910;
183 | ORGANIZATIONNAME = "The Chromium Authors";
184 | TargetAttributes = {
185 | 97C146ED1CF9000F007C117D = {
186 | CreatedOnToolsVersion = 7.3.1;
187 | };
188 | };
189 | };
190 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
191 | compatibilityVersion = "Xcode 3.2";
192 | developmentRegion = English;
193 | hasScannedForEncodings = 0;
194 | knownRegions = (
195 | en,
196 | Base,
197 | );
198 | mainGroup = 97C146E51CF9000F007C117D;
199 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
200 | projectDirPath = "";
201 | projectRoot = "";
202 | targets = (
203 | 97C146ED1CF9000F007C117D /* Runner */,
204 | );
205 | };
206 | /* End PBXProject section */
207 |
208 | /* Begin PBXResourcesBuildPhase section */
209 | 97C146EC1CF9000F007C117D /* Resources */ = {
210 | isa = PBXResourcesBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
214 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
215 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
216 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
217 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
218 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | };
222 | /* End PBXResourcesBuildPhase section */
223 |
224 | /* Begin PBXShellScriptBuildPhase section */
225 | 188D2A21FED25EE80F22844C /* [CP] Embed Pods Frameworks */ = {
226 | isa = PBXShellScriptBuildPhase;
227 | buildActionMask = 2147483647;
228 | files = (
229 | );
230 | inputPaths = (
231 | );
232 | name = "[CP] Embed Pods Frameworks";
233 | outputPaths = (
234 | );
235 | runOnlyForDeploymentPostprocessing = 0;
236 | shellPath = /bin/sh;
237 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
238 | showEnvVarsInLog = 0;
239 | };
240 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
241 | isa = PBXShellScriptBuildPhase;
242 | buildActionMask = 2147483647;
243 | files = (
244 | );
245 | inputPaths = (
246 | );
247 | name = "Thin Binary";
248 | outputPaths = (
249 | );
250 | runOnlyForDeploymentPostprocessing = 0;
251 | shellPath = /bin/sh;
252 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
253 | };
254 | 9740EEB61CF901F6004384FC /* Run Script */ = {
255 | isa = PBXShellScriptBuildPhase;
256 | buildActionMask = 2147483647;
257 | files = (
258 | );
259 | inputPaths = (
260 | );
261 | name = "Run Script";
262 | outputPaths = (
263 | );
264 | runOnlyForDeploymentPostprocessing = 0;
265 | shellPath = /bin/sh;
266 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
267 | };
268 | 9A841185D099ADDD31151264 /* [CP] Check Pods Manifest.lock */ = {
269 | isa = PBXShellScriptBuildPhase;
270 | buildActionMask = 2147483647;
271 | files = (
272 | );
273 | inputFileListPaths = (
274 | );
275 | inputPaths = (
276 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
277 | "${PODS_ROOT}/Manifest.lock",
278 | );
279 | name = "[CP] Check Pods Manifest.lock";
280 | outputFileListPaths = (
281 | );
282 | outputPaths = (
283 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
284 | );
285 | runOnlyForDeploymentPostprocessing = 0;
286 | shellPath = /bin/sh;
287 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
288 | showEnvVarsInLog = 0;
289 | };
290 | /* End PBXShellScriptBuildPhase section */
291 |
292 | /* Begin PBXSourcesBuildPhase section */
293 | 97C146EA1CF9000F007C117D /* Sources */ = {
294 | isa = PBXSourcesBuildPhase;
295 | buildActionMask = 2147483647;
296 | files = (
297 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
298 | 97C146F31CF9000F007C117D /* main.m in Sources */,
299 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
300 | );
301 | runOnlyForDeploymentPostprocessing = 0;
302 | };
303 | /* End PBXSourcesBuildPhase section */
304 |
305 | /* Begin PBXVariantGroup section */
306 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
307 | isa = PBXVariantGroup;
308 | children = (
309 | 97C146FB1CF9000F007C117D /* Base */,
310 | );
311 | name = Main.storyboard;
312 | sourceTree = "";
313 | };
314 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
315 | isa = PBXVariantGroup;
316 | children = (
317 | 97C147001CF9000F007C117D /* Base */,
318 | );
319 | name = LaunchScreen.storyboard;
320 | sourceTree = "";
321 | };
322 | /* End PBXVariantGroup section */
323 |
324 | /* Begin XCBuildConfiguration section */
325 | 97C147031CF9000F007C117D /* Debug */ = {
326 | isa = XCBuildConfiguration;
327 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
328 | buildSettings = {
329 | ALWAYS_SEARCH_USER_PATHS = NO;
330 | CLANG_ANALYZER_NONNULL = YES;
331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
332 | CLANG_CXX_LIBRARY = "libc++";
333 | CLANG_ENABLE_MODULES = YES;
334 | CLANG_ENABLE_OBJC_ARC = YES;
335 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
336 | CLANG_WARN_BOOL_CONVERSION = YES;
337 | CLANG_WARN_COMMA = YES;
338 | CLANG_WARN_CONSTANT_CONVERSION = YES;
339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
340 | CLANG_WARN_EMPTY_BODY = YES;
341 | CLANG_WARN_ENUM_CONVERSION = YES;
342 | CLANG_WARN_INFINITE_RECURSION = YES;
343 | CLANG_WARN_INT_CONVERSION = YES;
344 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
345 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
347 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
348 | CLANG_WARN_STRICT_PROTOTYPES = YES;
349 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
350 | CLANG_WARN_UNREACHABLE_CODE = YES;
351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
353 | COPY_PHASE_STRIP = NO;
354 | DEBUG_INFORMATION_FORMAT = dwarf;
355 | ENABLE_STRICT_OBJC_MSGSEND = YES;
356 | ENABLE_TESTABILITY = YES;
357 | GCC_C_LANGUAGE_STANDARD = gnu99;
358 | GCC_DYNAMIC_NO_PIC = NO;
359 | GCC_NO_COMMON_BLOCKS = YES;
360 | GCC_OPTIMIZATION_LEVEL = 0;
361 | GCC_PREPROCESSOR_DEFINITIONS = (
362 | "DEBUG=1",
363 | "$(inherited)",
364 | );
365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
367 | GCC_WARN_UNDECLARED_SELECTOR = YES;
368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
369 | GCC_WARN_UNUSED_FUNCTION = YES;
370 | GCC_WARN_UNUSED_VARIABLE = YES;
371 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
372 | MTL_ENABLE_DEBUG_INFO = YES;
373 | ONLY_ACTIVE_ARCH = YES;
374 | SDKROOT = iphoneos;
375 | TARGETED_DEVICE_FAMILY = "1,2";
376 | };
377 | name = Debug;
378 | };
379 | 97C147041CF9000F007C117D /* Release */ = {
380 | isa = XCBuildConfiguration;
381 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
382 | buildSettings = {
383 | ALWAYS_SEARCH_USER_PATHS = NO;
384 | CLANG_ANALYZER_NONNULL = YES;
385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
386 | CLANG_CXX_LIBRARY = "libc++";
387 | CLANG_ENABLE_MODULES = YES;
388 | CLANG_ENABLE_OBJC_ARC = YES;
389 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
390 | CLANG_WARN_BOOL_CONVERSION = YES;
391 | CLANG_WARN_COMMA = YES;
392 | CLANG_WARN_CONSTANT_CONVERSION = YES;
393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
394 | CLANG_WARN_EMPTY_BODY = YES;
395 | CLANG_WARN_ENUM_CONVERSION = YES;
396 | CLANG_WARN_INFINITE_RECURSION = YES;
397 | CLANG_WARN_INT_CONVERSION = YES;
398 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
399 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
400 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
401 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
402 | CLANG_WARN_STRICT_PROTOTYPES = YES;
403 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
404 | CLANG_WARN_UNREACHABLE_CODE = YES;
405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
406 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
407 | COPY_PHASE_STRIP = NO;
408 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
409 | ENABLE_NS_ASSERTIONS = NO;
410 | ENABLE_STRICT_OBJC_MSGSEND = YES;
411 | GCC_C_LANGUAGE_STANDARD = gnu99;
412 | GCC_NO_COMMON_BLOCKS = YES;
413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
414 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
415 | GCC_WARN_UNDECLARED_SELECTOR = YES;
416 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
417 | GCC_WARN_UNUSED_FUNCTION = YES;
418 | GCC_WARN_UNUSED_VARIABLE = YES;
419 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
420 | MTL_ENABLE_DEBUG_INFO = NO;
421 | SDKROOT = iphoneos;
422 | TARGETED_DEVICE_FAMILY = "1,2";
423 | VALIDATE_PRODUCT = YES;
424 | };
425 | name = Release;
426 | };
427 | 97C147061CF9000F007C117D /* Debug */ = {
428 | isa = XCBuildConfiguration;
429 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
430 | buildSettings = {
431 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
432 | CURRENT_PROJECT_VERSION = 1;
433 | ENABLE_BITCODE = NO;
434 | FRAMEWORK_SEARCH_PATHS = (
435 | "$(inherited)",
436 | "$(PROJECT_DIR)/Flutter",
437 | );
438 | INFOPLIST_FILE = Runner/Info.plist;
439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
440 | LIBRARY_SEARCH_PATHS = (
441 | "$(inherited)",
442 | "$(PROJECT_DIR)/Flutter",
443 | );
444 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNewsWeb;
445 | PRODUCT_NAME = "$(TARGET_NAME)";
446 | VERSIONING_SYSTEM = "apple-generic";
447 | };
448 | name = Debug;
449 | };
450 | 97C147071CF9000F007C117D /* Release */ = {
451 | isa = XCBuildConfiguration;
452 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
453 | buildSettings = {
454 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
455 | CURRENT_PROJECT_VERSION = 1;
456 | ENABLE_BITCODE = NO;
457 | FRAMEWORK_SEARCH_PATHS = (
458 | "$(inherited)",
459 | "$(PROJECT_DIR)/Flutter",
460 | );
461 | INFOPLIST_FILE = Runner/Info.plist;
462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
463 | LIBRARY_SEARCH_PATHS = (
464 | "$(inherited)",
465 | "$(PROJECT_DIR)/Flutter",
466 | );
467 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterNewsWeb;
468 | PRODUCT_NAME = "$(TARGET_NAME)";
469 | VERSIONING_SYSTEM = "apple-generic";
470 | };
471 | name = Release;
472 | };
473 | /* End XCBuildConfiguration section */
474 |
475 | /* Begin XCConfigurationList section */
476 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
477 | isa = XCConfigurationList;
478 | buildConfigurations = (
479 | 97C147031CF9000F007C117D /* Debug */,
480 | 97C147041CF9000F007C117D /* Release */,
481 | );
482 | defaultConfigurationIsVisible = 0;
483 | defaultConfigurationName = Release;
484 | };
485 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
486 | isa = XCConfigurationList;
487 | buildConfigurations = (
488 | 97C147061CF9000F007C117D /* Debug */,
489 | 97C147071CF9000F007C117D /* Release */,
490 | );
491 | defaultConfigurationIsVisible = 0;
492 | defaultConfigurationName = Release;
493 | };
494 | /* End XCConfigurationList section */
495 | };
496 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
497 | }
498 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/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 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | flutter_news_web
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
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/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:flutter_news_web/src/app.dart';
4 |
5 | void main() => runApp(new MyApp());
6 |
--------------------------------------------------------------------------------
/lib/src/app.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_news_web/src/ui/home_page.dart';
3 |
4 | import '../main.dart';
5 |
6 | class MyApp extends StatelessWidget {
7 | // This widget is the root of your application.
8 | @override
9 | Widget build(BuildContext context) {
10 | return new MaterialApp(
11 | debugShowCheckedModeBanner: false,
12 | title: 'Flutter Demo',
13 | theme: new ThemeData(
14 | primarySwatch: Colors.blue,
15 | ),
16 | home: HomePage(),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/src/bloc/news_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter_news_web/src/network/api_response.dart';
4 |
5 | import 'package:flutter_news_web/src/network/repository/news_api.dart';
6 | import 'package:flutter_news_web/src/model/news_model.dart';
7 |
8 | class NewsBloc {
9 | NewsRepository _newsRepository;
10 |
11 | StreamController _newsListController;
12 |
13 | StreamSink>> get newsListSink =>
14 | _newsListController.sink;
15 |
16 | Stream>> get newsListStream =>
17 | _newsListController.stream;
18 |
19 | NewsBloc() {
20 | _newsListController = StreamController>>();
21 | _newsRepository = NewsRepository();
22 | }
23 |
24 | fetchCategoryNewsList(String newsType) async {
25 | newsListSink.add(ApiResponse.loading('Fetching News '));
26 | try {
27 | List articles = await _newsRepository.getCategoryNews(newsType);
28 | newsListSink.add(ApiResponse.completed(articles));
29 | } catch (e) {
30 | newsListSink.add(ApiResponse.error(e.toString()));
31 | print(e);
32 | }
33 | }
34 |
35 | fetchTopHeadlinesList() async {
36 | newsListSink.add(ApiResponse.loading('Fetching News '));
37 | try {
38 | List articles = await _newsRepository.getTopHeadlines();
39 | newsListSink.add(ApiResponse.completed(articles));
40 | } catch (e) {
41 | newsListSink.add(ApiResponse.error(e.toString()));
42 | print(e);
43 | }
44 | }
45 |
46 | dispose() {
47 | _newsListController?.close();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/src/model/categories_model.dart:
--------------------------------------------------------------------------------
1 | class CategoriesModel {
2 | String image;
3 | String title;
4 | String newsType;
5 |
6 | CategoriesModel(String image, String title, String newsType) {
7 | this.image = image;
8 | this.title = title;
9 | this.newsType = newsType;
10 | }
11 |
12 |
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/lib/src/model/news_model.dart:
--------------------------------------------------------------------------------
1 | class News {
2 | String status;
3 | int totalResults;
4 | List articles;
5 |
6 | News({
7 | this.status,
8 | this.totalResults,
9 | this.articles,
10 | });
11 |
12 | factory News.fromJson(Map json) => News(
13 | status: json["status"],
14 | totalResults: json["totalResults"],
15 | articles: List.from(json["articles"].map((x) => Article.fromJson(x))),
16 | );
17 |
18 | Map toJson() => {
19 | "status": status,
20 | "totalResults": totalResults,
21 | "articles": List.from(articles.map((x) => x.toJson())),
22 | };
23 | }
24 |
25 | class Article {
26 | Source source;
27 | String author;
28 | String title;
29 | String description;
30 | String url;
31 | String urlToImage;
32 | DateTime publishedAt;
33 | String content;
34 |
35 | Article({
36 | this.source,
37 | this.author,
38 | this.title,
39 | this.description,
40 | this.url,
41 | this.urlToImage,
42 | this.publishedAt,
43 | this.content,
44 | });
45 |
46 | factory Article.fromJson(Map json) => Article(
47 | source: Source.fromJson(json["source"]),
48 | author: json["author"] == null ? null : json["author"],
49 | title: json["title"],
50 | description: json["description"],
51 | url: json["url"],
52 | urlToImage: json["urlToImage"],
53 | publishedAt: DateTime.parse(json["publishedAt"]),
54 | content: json["content"] == null ? null : json["content"],
55 | );
56 |
57 | Map toJson() => {
58 | "source": source.toJson(),
59 | "author": author == null ? null : author,
60 | "title": title,
61 | "description": description,
62 | "url": url,
63 | "urlToImage": urlToImage,
64 | "publishedAt": publishedAt.toIso8601String(),
65 | "content": content == null ? null : content,
66 | };
67 | }
68 |
69 | class Source {
70 | String id;
71 | String name;
72 |
73 | Source({
74 | this.id,
75 | this.name,
76 | });
77 |
78 | factory Source.fromJson(Map json) => Source(
79 | id: json["id"] == null ? null : json["id"],
80 | name: json["name"],
81 | );
82 |
83 | Map toJson() => {
84 | "id": id == null ? null : id,
85 | "name": name,
86 | };
87 | }
88 |
--------------------------------------------------------------------------------
/lib/src/network/api_base_helper.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'package:http/http.dart' as http;
3 | import 'dart:convert';
4 |
5 | import 'dart:async';
6 |
7 | import 'api_exception.dart';
8 |
9 | class ApiBaseHelper {
10 | final String _baseUrl = "https://newsapi.org/v2/";
11 | final String _apiKey = "ae6c3c0f9d8e485a98fd70edcff81134";
12 |
13 | Future get(String url) async {
14 | print('Api Get, url $url');
15 | var responseJson;
16 | try {
17 | final response =
18 | await http.get(_baseUrl + url + "?country=in&apiKey=$_apiKey");
19 | responseJson = _returnResponse(response);
20 | } on SocketException {
21 | print('No net');
22 | throw FetchDataException('No Internet connection');
23 | }
24 | print('api get recieved!');
25 | return responseJson;
26 | }
27 | }
28 |
29 | dynamic _returnResponse(http.Response response) {
30 | switch (response.statusCode) {
31 | case 200:
32 | var responseJson = json.decode(response.body.toString());
33 | print(responseJson);
34 | return responseJson;
35 | case 400:
36 | throw BadRequestException(response.body.toString());
37 | case 401:
38 | case 403:
39 | throw UnauthorisedException(response.body.toString());
40 | case 500:
41 | default:
42 | throw FetchDataException(
43 | 'Error occured while Communication with Server with StatusCode : ${response.statusCode}');
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/src/network/api_exception.dart:
--------------------------------------------------------------------------------
1 | class AppException implements Exception {
2 | final _message;
3 | final _prefix;
4 |
5 | AppException([this._message, this._prefix]);
6 |
7 | String toString() {
8 | return "$_prefix$_message";
9 | }
10 | }
11 |
12 | class FetchDataException extends AppException {
13 | FetchDataException([String message])
14 | : super(message, "Error During Communication: ");
15 | }
16 |
17 | class BadRequestException extends AppException {
18 | BadRequestException([message]) : super(message, "Invalid Request: ");
19 | }
20 |
21 | class UnauthorisedException extends AppException {
22 | UnauthorisedException([message]) : super(message, "Unauthorised: ");
23 | }
24 |
25 | class InvalidInputException extends AppException {
26 | InvalidInputException([String message]) : super(message, "Invalid Input: ");
27 | }
--------------------------------------------------------------------------------
/lib/src/network/api_response.dart:
--------------------------------------------------------------------------------
1 | class ApiResponse {
2 | Status status;
3 |
4 | T data;
5 |
6 | String message;
7 |
8 | ApiResponse.loading(this.message) : status = Status.LOADING;
9 |
10 | ApiResponse.completed(this.data) : status = Status.COMPLETED;
11 |
12 | ApiResponse.error(this.message) : status = Status.ERROR;
13 |
14 | @override
15 | String toString() {
16 | return "Status : $status \n Message : $message \n Data : $data";
17 | }
18 | }
19 |
20 | enum Status { LOADING, COMPLETED, ERROR }
--------------------------------------------------------------------------------
/lib/src/network/repository/I_news_api.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_news_web/src/model/news_model.dart';
2 |
3 | abstract class INewsAPi {
4 | Future> getCategoryNews(String newsType);
5 |
6 | Future> getTopHeadlines();
7 | }
8 |
--------------------------------------------------------------------------------
/lib/src/network/repository/news_api.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_news_web/src/network/repository/I_news_api.dart';
2 | import 'package:flutter_news_web/src/network/api_base_helper.dart';
3 |
4 | import 'package:flutter_news_web/src/model/news_model.dart';
5 |
6 | class NewsRepository extends INewsAPi {
7 | ApiBaseHelper apiBaseHelper = ApiBaseHelper();
8 |
9 | @override
10 | Future> getCategoryNews(String newsType) async {
11 | final response = await apiBaseHelper.get(newsType);
12 | return News.fromJson(response).articles;
13 | }
14 |
15 | @override
16 | Future> getTopHeadlines() async {
17 | final response = await apiBaseHelper.get("top-headlines");
18 | return News.fromJson(response).articles;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/src/ui/home_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import '../model/categories_model.dart';
4 | import 'news_list.dart';
5 |
6 | class HomePage extends StatefulWidget {
7 | @override
8 | _HomePageState createState() => _HomePageState();
9 | }
10 |
11 | class _HomePageState extends State {
12 | List categoriesList;
13 |
14 | @override
15 | void initState() {
16 | categoriesList = new List();
17 | categoriesList = loadCategories();
18 | super.initState();
19 | }
20 |
21 | List loadCategories() {
22 | var categories = [
23 | //adding all the categories of news in the list
24 | new CategoriesModel('images/top_news.png', "Top Headlines", "top_news"),
25 | new CategoriesModel('images/health_news.png', "Health", "health"),
26 | new CategoriesModel(
27 | 'images/entertainment_news.png', "Entertainment", "entertainment"),
28 | new CategoriesModel('images/sports_news.png', "Sports", "sports"),
29 | new CategoriesModel('images/business_news.png', "Business", "business"),
30 | new CategoriesModel('images/tech_news.png', "Technology", "technology"),
31 | new CategoriesModel('images/science_news.png', "Science", "science"),
32 | new CategoriesModel('images/politics_news.png', "Politics", "politics")
33 | ];
34 | return categories;
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | final title = 'News Web';
40 | return Scaffold(
41 | appBar: AppBar(
42 | title: Text(title),
43 | ),
44 | body: GridView.count(
45 | // Create a grid with 2 columns. If you change the scrollDirection to
46 | // horizontal, this would produce 2 rows.
47 | crossAxisCount: 2,
48 | // Generate 100 Widgets that display their index in the List
49 | children: List.generate(8, (index) {
50 | return Padding(
51 | padding: const EdgeInsets.all(8.0),
52 | child: RaisedButton(
53 | color: Colors.white,elevation: 1.0,
54 | shape: RoundedRectangleBorder(
55 | borderRadius: BorderRadius.circular(4.0)),
56 | child: Column(
57 | children: [
58 | Image(
59 | image: AssetImage(categoriesList[index].image),
60 | ),
61 | Padding(
62 | padding: const EdgeInsets.only(top: 8.0),
63 | child: Text(
64 | categoriesList[index].title,
65 | style: TextStyle(color: Colors.black),
66 | ),
67 | ),
68 | ],
69 | ),
70 | onPressed: () {
71 | Navigator.of(context).push(MaterialPageRoute(
72 | builder: (BuildContext context) => NewsListPage(
73 | categoriesList[index].title,
74 | categoriesList[index].newsType)));
75 | },
76 | ),
77 | );
78 | }),
79 | ),
80 | );
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/lib/src/ui/news_details.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:flutter_news_web/src/model/news_model.dart';
4 | import 'package:flutter_news_web/src/ui/web_view.dart';
5 |
6 | class NewsDetails extends StatefulWidget {
7 | final Article article;
8 | final String title;
9 |
10 | NewsDetails(this.article, this.title);
11 |
12 | @override
13 | _NewsDetailsState createState() => _NewsDetailsState();
14 | }
15 |
16 | class _NewsDetailsState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | appBar: AppBar(
21 | title: Text(widget.title),
22 | ),
23 | body: SingleChildScrollView(
24 | child: Column(
25 | crossAxisAlignment: CrossAxisAlignment.stretch,
26 | verticalDirection: VerticalDirection.up,
27 | children: [
28 | Column(
29 | children: [
30 | Image.network(widget.article.urlToImage),
31 | Padding(
32 | padding: const EdgeInsets.all(8.0),
33 | child: Text(
34 | widget.article.title,
35 | style: TextStyle(
36 | fontWeight: FontWeight.bold, fontSize: 20.0),
37 | ),
38 | ),
39 | Padding(
40 | padding: const EdgeInsets.all(8.0),
41 | child: Text(
42 | widget.article.description,
43 | style: TextStyle(fontSize: 19.0),
44 | ),
45 | )
46 | ],
47 | ),
48 | MaterialButton(
49 | height: 50.0,
50 | color: Colors.grey,
51 | child: Text(
52 | "For more news",
53 | style: TextStyle(color: Colors.white, fontSize: 18.0),
54 | ),
55 | onPressed: () {
56 | Navigator.of(context).push(MaterialPageRoute(
57 | builder: (BuildContext context) =>
58 | WebView(widget.article.url)));
59 | },
60 | )
61 | ],
62 | ),
63 | ));
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/lib/src/ui/news_list.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:convert';
3 |
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_news_web/src/ui/news_details.dart';
6 | import 'package:flutter_news_web/src/model/news_model.dart';
7 | import 'package:http/http.dart' as http;
8 |
9 | class NewsListPage extends StatefulWidget {
10 | final String title;
11 | final String newsType;
12 |
13 | NewsListPage(this.title, this.newsType);
14 |
15 | @override
16 | _NewsListPageState createState() => _NewsListPageState();
17 | }
18 |
19 | class _NewsListPageState extends State {
20 | @override
21 | void initState() {
22 | super.initState();
23 | }
24 |
25 | Future> getData(String newsType) async {
26 | List list;
27 | String link;
28 | if (newsType == "top_news") {
29 | link =
30 | "https://newsapi.org/v2/top-headlines?country=in&apiKey=ae6c3c0f9d8e485a98fd70edcff81134";
31 | } else {
32 | link =
33 | "https://newsapi.org/v2/top-headlines?country=in&category=$newsType&apiKey=ae6c3c0f9d8e485a98fd70edcff81134";
34 | }
35 | var res = await http
36 | .get(Uri.encodeFull(link), headers: {"Accept": "application/json"});
37 | // print(res.body);
38 | if (res.statusCode == 200) {
39 | var data = json.decode(res.body);
40 | var rest = data["articles"] as List;
41 | print(rest);
42 | list = rest.map((json) => Article.fromJson(json)).toList();
43 | }
44 | print("List Size: ${list.length}");
45 | return list;
46 | }
47 |
48 | Widget listViewWidget(List article) {
49 | return Container(
50 | child: ListView.builder(
51 | itemCount: 20,
52 | padding: const EdgeInsets.all(2.0),
53 | itemBuilder: (context, position) {
54 | return Card(
55 | child: Container(
56 | height: 120.0,
57 | width: 120.0,
58 | child: Center(
59 | child: ListTile(
60 | subtitle: Padding(
61 | padding: const EdgeInsets.only(top: 5.0),
62 | child: Text(
63 | '${article[position].author}',
64 | ),
65 | ),
66 | title: Text(
67 | '${article[position].title}',
68 | style: TextStyle(
69 | fontSize: 14.0,
70 | color: Colors.black,
71 | fontWeight: FontWeight.bold),
72 | ),
73 | leading: Container(
74 | height: 100.0,
75 | width: 100.0,
76 | child: article[position].urlToImage == null
77 | ? Image.asset(
78 | 'images/no_image_available.png',
79 | height: 70,
80 | width: 70,
81 | )
82 | : Image.network(
83 | '${article[position].urlToImage}',
84 | height: 70,
85 | width: 70,
86 | ),
87 | ),
88 | onTap: () => _onTapItem(context, article[position]),
89 | ),
90 | ),
91 | ),
92 | );
93 | }),
94 | );
95 | }
96 |
97 | void _onTapItem(BuildContext context, Article article) {
98 | Navigator.of(context).push(MaterialPageRoute(
99 | builder: (BuildContext context) => NewsDetails(article, widget.title)));
100 | }
101 |
102 | @override
103 | Widget build(BuildContext context) {
104 | return Scaffold(
105 | backgroundColor: Colors.black,
106 | appBar: AppBar(
107 | title: Text(widget.title),
108 | ),
109 | body: FutureBuilder(
110 | future: getData(widget.newsType),
111 | builder: (context, snapshot) {
112 | return snapshot.data != null
113 | ? listViewWidget(snapshot.data)
114 | : Center(child: CircularProgressIndicator());
115 | }),
116 | );
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/lib/src/ui/web_view.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
4 |
5 | class WebView extends StatefulWidget {
6 | final String url;
7 |
8 | WebView(this.url);
9 |
10 | @override
11 | _WebViewExampleState createState() => _WebViewExampleState();
12 | }
13 |
14 | class _WebViewExampleState extends State {
15 | @override
16 | Widget build(BuildContext context) {
17 | return WebviewScaffold(
18 | appBar: AppBar(),
19 | url: widget.url,
20 | );
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.3.0"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "1.0.5"
18 | charcode:
19 | dependency: transitive
20 | description:
21 | name: charcode
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.1.2"
25 | collection:
26 | dependency: transitive
27 | description:
28 | name: collection
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.14.11"
32 | cupertino_icons:
33 | dependency: "direct main"
34 | description:
35 | name: cupertino_icons
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "0.1.2"
39 | flutter:
40 | dependency: "direct main"
41 | description: flutter
42 | source: sdk
43 | version: "0.0.0"
44 | flutter_test:
45 | dependency: "direct dev"
46 | description: flutter
47 | source: sdk
48 | version: "0.0.0"
49 | flutter_webview_plugin:
50 | dependency: "direct main"
51 | description:
52 | name: flutter_webview_plugin
53 | url: "https://pub.dartlang.org"
54 | source: hosted
55 | version: "0.2.1+2"
56 | http:
57 | dependency: "direct main"
58 | description:
59 | name: http
60 | url: "https://pub.dartlang.org"
61 | source: hosted
62 | version: "0.11.3+17"
63 | http_parser:
64 | dependency: transitive
65 | description:
66 | name: http_parser
67 | url: "https://pub.dartlang.org"
68 | source: hosted
69 | version: "3.1.3"
70 | matcher:
71 | dependency: transitive
72 | description:
73 | name: matcher
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "0.12.5"
77 | meta:
78 | dependency: transitive
79 | description:
80 | name: meta
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "1.1.7"
84 | path:
85 | dependency: transitive
86 | description:
87 | name: path
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.6.4"
91 | pedantic:
92 | dependency: transitive
93 | description:
94 | name: pedantic
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "1.8.0+1"
98 | quiver:
99 | dependency: transitive
100 | description:
101 | name: quiver
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "2.0.5"
105 | sky_engine:
106 | dependency: transitive
107 | description: flutter
108 | source: sdk
109 | version: "0.0.99"
110 | source_span:
111 | dependency: transitive
112 | description:
113 | name: source_span
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "1.5.5"
117 | stack_trace:
118 | dependency: transitive
119 | description:
120 | name: stack_trace
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.9.3"
124 | stream_channel:
125 | dependency: transitive
126 | description:
127 | name: stream_channel
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "2.0.0"
131 | string_scanner:
132 | dependency: transitive
133 | description:
134 | name: string_scanner
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.0.5"
138 | term_glyph:
139 | dependency: transitive
140 | description:
141 | name: term_glyph
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "1.1.0"
145 | test_api:
146 | dependency: transitive
147 | description:
148 | name: test_api
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "0.2.5"
152 | typed_data:
153 | dependency: transitive
154 | description:
155 | name: typed_data
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "1.1.6"
159 | vector_math:
160 | dependency: transitive
161 | description:
162 | name: vector_math
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "2.0.8"
166 | sdks:
167 | dart: ">=2.2.2 <3.0.0"
168 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_news_web
2 | description: A new Flutter project.
3 |
4 | dependencies:
5 | http: "^0.11.3+16"
6 | flutter:
7 | sdk: flutter
8 | flutter_webview_plugin: ^0.2.1+2
9 | # The following adds the Cupertino Icons font to your application.
10 | # Use with the CupertinoIcons class for iOS style icons.
11 | cupertino_icons: ^0.1.2
12 |
13 | dev_dependencies:
14 | flutter_test:
15 | sdk: flutter
16 |
17 |
18 | # For information on the generic Dart part of this file, see the
19 | # following page: https://www.dartlang.org/tools/pub/pubspec
20 |
21 | # The following section is specific to Flutter.
22 | flutter:
23 | uses-material-design: true
24 | assets:
25 | - images/business_news.png
26 | - images/entertainment_news.png
27 | - images/health.jpg
28 | - images/health_news.png
29 | - images/no_image_available.png
30 | - images/politics_news.png
31 | - images/science_news.png
32 | - images/sports_news.png
33 | - images/tech_news.png
34 | - images/top_news.png
35 |
36 |
37 | # An image asset can refer to one or more resolution-specific "variants", see
38 | # https://flutter.io/assets-and-images/#resolution-aware.
39 |
40 | # For details regarding adding assets from package dependencies, see
41 | # https://flutter.io/assets-and-images/#from-packages
42 |
43 | # To add custom fonts to your application, add a fonts section here,
44 | # in this "flutter" section. Each entry in this list should have a
45 | # "family" key with the font family name, and a "fonts" key with a
46 | # list giving the asset and other descriptors for the font. For
47 | # example:
48 | # fonts:
49 | # - family: Schyler
50 | # fonts:
51 | # - asset: fonts/Schyler-Regular.ttf
52 | # - asset: fonts/Schyler-Italic.ttf
53 | # style: italic
54 | # - family: Trajan Pro
55 | # fonts:
56 | # - asset: fonts/TrajanPro.ttf
57 | # - asset: fonts/TrajanPro_Bold.ttf
58 | # weight: 700
59 | #
60 | # For details regarding fonts from package dependencies,
61 | # see https://flutter.io/custom-fonts/#from-packages
62 |
--------------------------------------------------------------------------------
/screenshots/device-2018-12-05-220930.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/screenshots/device-2018-12-05-220930.png
--------------------------------------------------------------------------------
/screenshots/device-2018-12-05-220954.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/screenshots/device-2018-12-05-220954.png
--------------------------------------------------------------------------------
/screenshots/device-2018-12-05-221016.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ashishrawat2911/Flutter-NewsWeb/1253c330aff298a95411eaeeb9e416acd3cfc0f4/screenshots/device-2018-12-05-221016.png
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties
5 | // are correct.
6 |
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_test/flutter_test.dart';
9 |
10 | import 'package:flutter_news_web/main.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(new MyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------