You are on page 1of 68

ACKNOWLEDGEMENT

I am very grateful to my project advisor Mr. Balvinder Singh CEO and Trainer Mr. Mohit Bhatia at
Cyber Magic Private Limited for his valuable time and continuous support of my project work, for his
patience, motivation, enthusiasm, and immense knowledge. His guidance helped me in all the time of
development and writing of this project. We could not have imagined having a better advisor and mentor for
our project work. He consistently allowed this project to be our own work, but steered me in the right
direction whenever he thought Is needed.

Besides our advisor, I would like to thank the rest of our faculty members for their encouragement, insightful
comments, and hard questions.

Finally, I must express our very profound gratitude to our parents for providing us with unfailing support and
continuous encouragement throughout our years of study and through the process of researching and writing
this project work. This accomplishment would not have been possible without them.

I
DECLARATION

I hereby certify that the work which is being presented in the B.Tech. Project Work- I Report entitled
“NEWS APPLICATION”, in partial fulfillment of the requirements for the award of the Bachelor of
Technology in Computer Science & Engineering and submitted to the Department of Computer Science &
Engineering of Atal Bihari Vajpayee Govt. Institute of Engineering & Technology, Pragatinagar, Shimla,
HP is an authentic record of my own work carried out during a period from August 2023 to November 2023
under the supervision of Name & Designation of supervisor(s), CSE Department.

Signature
Shavnam
20010203043

This is to certify that the above statement made by the candidate is correct to the best of my knowledge.

Signature of Supervisor
Date: Er. Navdeep Sharma
Assistant Professor CSE

Head
Computer Science & Engineering Department
Atal Bihari Vajpayee Govt. Institute of Engineering & Technology, Pragatinagar

II
CERTIFICATE

III
ABSTARCT

The ‘NEWS APPLICATION’ is a cutting-edge mobile application designed to deliver a seamless and
personalized news consumption experience to users. Leveraging the power of Flutter’s cross-platform
capabilities.

Cross-Platform mobile application development is the pressing priority in today’s world and generation.
Developers are enforced to either construct the same application numerous times for various OS (operating
systems) or accept a low-quality similar solution that trades native speed and accuracy for portability. Flutter
is an open-source SDK for developing high-performance and more reliable mobile applications for operating
systems like iOS and Android.

The application boasts an intuitive and user-friendly interface, ensuring that users of all ages and
backgrounds can easily navigate and engaging content. Users can access a wide range of news sources,
including international, national, local. The app provides real-time updates by using webpage of news
channels. Users can select any language according to their interest such as Hindi, English, Punjabi and also
can select news channels. The app is designed with accessibility in mind, catering the diverse user base, and
supports multiple languages for global search.

IV
TABLE OF CONTENTS

CHAPTER NO. CONTENT PAGE NO.


TITLE PAGE

ACKNOWLEDGEMENT i

DECLARATION ii

CERTIFICATE iii

ABSTRACT iv
INTRODUCTION
CHAPTER 1 1-9
INTRODUCTION TO FLUTTER
FEATURES OF FLUTTER
FLUTTER FRAMEWORK ARCHTECTURE
MVC PATTERN

CHAPTER 2 SYSTEM REQUIREMENTS 10


SYSTEM ANALYSIS
CHAPTER 3 11-12
3.1 IDENTIFICATION OF NEED
3.2 PRELIMINARY INVESTIGATION
FEASIBILITY STUDY
CHAPTER 4 13-14
4.1 TECHNICAL FEASIBLITY
4.2 ECONOMICAL FEASIBILTY
4.3 OPERATIONAL FEASIBILTY
CHAPTER 5 SOFTWARE ENGINEERING PARADIGM APPLIED 15-21
SYSTEM DESIGN
CHAPTER 6 22-26
6.1 USER INTERFACE
6.1.1 PERFORMANCE OPTIMIZATION
6.1.2 TESTING
FLOW CHART
CHAPTER 7 27-28
CHAPTER 8 SCREEN SHOTS 29-35

CHAPTER 9 CODING’S MAIN MODULE 36-39

CHAPTER 10 VALIDATION CHECKS 40-41

CHAPTER 11 TESTING 42-50

CHAPTER 12 IMPLEMENTATION AND MAINTAINCE 51-52

CHAPTER 13 SYSTEM SECURITY MEASURES 53-54

CHAPTER 14 VARIOUS TYPES OF MODULES 55-56

CHAPTER 15 FUTURE SCOPE 57

CHAPTER 16 CONCLUSION 58

REFRENCES 59

V
TABLE OF FIGURES

FIGURE NO. TITLE PAGE NO.

FIGURE 1.1.1 FLUTTER LOGO 1

FIGURE 1.1.2 WIDGET HIERARCHY 3

FIGURE 1.1.3 LAYERS IN FLUTTER 4

FIGURE 1.1.4 VISUAL REPRESENTATION 5

FIGURE 1.2 FEATURES OF FLUTTER 6

FIGURE 1.3 FLUTTER FRAMEWORK ARCHITECTURE 7

FIGURE 1.4 MODEL-VIEW-CONTROLLER 8

FIGURE 5.1.1 AGILE METHODOLOGY 15

FIGURE 5.1.2 DEVOPS 18

FIGURE 5.1.3 MODEL-VIEW-VIEW-MODEL 21

FIGURE 11.1.1 TYPES OF TESTING 45

FIGURE 11.1.2 BLACK BOX TESTING 45

FIGURE 11.1.3 WHITE BOX TESTING 46

FIGURE 11.1.4 GRAY BOX TESTING 47

FIGURE 11.1.5 UNIT TESTING 49

FIGURE 11.1.6 INTEGRATION TESTING 49

FIGURE 11.1.7 SYSTEM TESTING 50

FIGURE 11.1.8 ACCEPTANCE TESTING 50

VI
CHAPTER: 1

INTRODUCTION

1.1 INTRODUCTION TO FLUTTER

Flutter is a cross-platform framework that targets developing high-performance mobile applications. Flutter
was publicly released in 2016 by Google. Flutter is exceptional because it is dependent on the device’s OEM
widgets rather than consuming web views. Flutter uses a high-performance rendering engine to render each
view component using its own.

Fig 1.1.1 Flutter Logo

Android provides a native framework based on Java language and iOS provides a native framework based
on Objective-C / Shift language. However, to develop an application supporting both the OSs, we need to
code in two different languages using two different frameworks. To help overcome this complexity, there
exists mobile frameworks supporting both OS. These frameworks range from simple HTML based hybrid
mobile application framework (which uses HTML for User Interface and JavaScript for application logic) to
complex language specific framework (which do the heavy lifting of converting code to native code).
Irrespective of their simplicity or complexity, these frameworks always have many disadvantages, one of the
main drawbacks being their slow performance. In this scenario, Flutter – a simple and high-performance
framework based on Dart language, provides high performance by rendering the UI directly in the operating
system’s canvas rather than through native framework. Flutter also offers many ready to use widgets (UI) to
create a modern application. These widgets are optimized for mobile environment and designing the
application using widgets is as simple as designing HTML. To be specific, Flutter application is itself a
widget. Flutter widgets also supports animations and gestures. The application logic is based on reactive
programming. Widget may optionally have a state. By changing the state of the widget, Flutter will

1
automatically (reactive programming) compare the widget’s state (old and new) and render the widget with
only the necessary changes instead of re-rendering the whole widget.

The Flutter framework consists of both a software development kit (SDK) and their widget-based UI library.
This library consists of various reusable UI elements, such as sliders, buttons, and text inputs.

Dart Language: Dart is a programming language. Google invents the language in October 2011. It is a
Frontend development language used to create mobile and online applications. Dart is a client-optimized
language for developing fast apps on any platform. Its goal is to offer the most productive programming
language for multi-platform development, paired with a flexible execution runtime platform for app
frameworks. Dart also forms the foundation of Flutter.

Dart is an open-source general-purpose programming language. It is originally developed by Google. Dart is


an object-oriented language with C-style syntax. It supports programming concepts like interfaces, classes,
unlike other programming languages Dart doesn’t support arrays. Dart collections can be used to replicate
data structures such as arrays, generics, and optional typing.

The following code shows a simple Dart program:

void main() {

print("Dart language is easy to learn");

Dart provides the language and runtimes that power Flutter apps, but Dart also supports many core developer
tasks like formatting, analyzing, and testing code.

Advantages of Flutter

Flutter comes with beautiful and customizable widgets for high performance and outstanding mobile
application. It fulfills all the custom needs and requirements.

Besides these, Flutter offers many more advantages as mentioned below:

 Dart has a large repository of software packages which lets you to extend the capabilities of your
application.
 Developers need to write just a single code base for both applications (both Android and iOS
platforms). Flutter may to be extended to other platform as well in the future.
 Flutter needs lesser testing. Because of its single code base, it is sufficient if we write automated tests
once for both the platforms.
 Flutter’s simplicity makes it a good candidate for fast development. Its customization capability and
extendibility makes it even more powerful.

2
 With Flutter, developers has full control over the widgets and its layout.
 Flutter offers great developer tools, with amazing hot reload.

Disadvantages of Flutter

Despite its many advantages, flutter has the following drawbacks in it:

 Since it is coded in Dart language, a developer needs to learn new language (though it is easy to
learn).
 Modern framework tries to separate logic and UI as much as possible but, in Flutter, user interface
and logic is intermixed. We can overcome this using smart coding and using high level module to
separate user interface and logic.
 Flutter is yet another framework to create mobile application. Developers are having a hard time in
choosing the right development tools in hugely populated segment.

Widgets: The core concept of the Flutter framework is In Flutter, everything is a widget. Widgets are
basically user interface components used to create the user interface of the application.

In Flutter, the application is itself a widget. The application is the top- level widget and its UI is build using
one or more children (widgets), which again build using its children widgets. This composability feature
helps us to create a user interface of any complexity.

For example, the widget hierarchy of the hello world application is as specified in the following diagram:

3
Fig1.1.2 Widget Hierarchy

Gestures: Flutter widgets support interaction through a special widget, GestureDetector. GestureDetector is
an invisible widget having the ability to capture user interactions such as tapping, dragging, etc., of its child
widget. Many native widgets of Flutter support interaction through the use of GestureDetector. We can also
incorporate interactive feature into the existing widget by composing it with the GestureDetector widget.

Concept of State: Flutter widgets support State maintenance by providing a special widget, StatefulWidget.
Widget needs to be derived from StatefulWidget widget to support state maintenance and all other widget
should be derived from StatefulWidget. Flutter widgets are reactive in native. This is similar to reactjs and
StatefulWidget will be auto re- rendered whenever its internal state is changed. The re-rendering is
optimized by finding the difference between old and new widget UI and rendering only the necessary
changes.

Layers: The most important concept of Flutter framework is that the framework is grouped into multiple
category in terms of complexity and clearly arranged in layers of decreasing complexity. A layer is build
using its immediate next level layer. The top most layer is widget specific to Android and iOS. The next
layer has all flutter native widgets. The next layer is Rendering layer, which is low level renderer component
and renders everything in the flutter app. Layers goes down to core platform specific code

The general overview of a layer in Flutter is specified in the below diagram:

Layers in Flutter

4
Fig 1.1.3 Layers in Flutter

Visual representation

5
Fig 1.1.4 Visual Representation

Widget Build Visualization


In Flutter, widgets can be grouped into multiple categories based on their features, as listed below −
 Platform specific widgets
 Layout widgets
 State maintenance widgets
 Platform independent / basic widget

1.2 FEATURES OF FLUTTER

6
Fig. 1.2 Features of Flutter

 Open-Source: Flutter is a free and open-source framework for developing mobile applications.
 Cross-platform: This feature allows Flutter to write the code once, maintain, and can run on
different platforms. It saves the time, effort, and money of the developers.
 Hot Reload: Whenever the developer makes changes in the code, then these changes can be seen
instantaneously with Hot Reload. It means the changes immediately visible in the app itself. It is a
very handy feature, which allows the developer to fix the bugs instantly.
 Accessible Native Features and SDKs: This feature allows the app development process easy and
delightful through Flutter's native code, third-party integration, and platform APIs. Thus, we can
easily access the SDKs on both platforms.
 Minimal code: Flutter app is developed by Dart programming language, which uses JIT and AOT
compilation to improve the overall start-up time, functioning and accelerates the performance. JIT
enhances the development system and refreshes the UI without putting extra effort into building a
new one.
 Widgets: The Flutter framework offers widgets, which are capable of developing customizable
specific designs. Most importantly, Flutter has two sets of widgets: Material Design and Cupertino
widgets that help to provide a glitch-free experience on all platforms.

1.3 FLUTTER FRAMEWORK ARCHTECTURE

7
Fig. 1.3 Flutter Framework Architecture

 Framework: This is the more “visible” part of Flutter’s technology. This layer of Flutter’s
architecture is based on Dart.

The framework layer has three main layer components, which are the following:

o Foundation layer
o Rendering layer
o Widget layer

Foundation layer: To Flutter, some foundational classes and some building block services provide
abstraction. Some of the main building block services are animations and gestures.

o Flutter can support animations like tween, hero, silver, transform, fade in the widget,
animation builder, animated opacity, and any animation related to physics.
o The gesture is a widget used to detect gestures like tapping, dragging, and scaling. It has an
invisible widget name gesture detector.

Rendering layer: This layer is responsible for converting widgets in a flutter to pixels and showing them
on the screen. It takes a tree of renderable objects called the widgets tree. Whenever any animation, input, or
state of the widget changes, this layer is called, which updates the layout and shows them on the screen.

Widget layer: A widget is a like component in ReactJS. Each renderable object has its widget, which the
developer uses to make a widget tree. There are many predefined widgets.
8
 Engine: This layer is written in C/C++. The engine provides a low-level implementation of the
Flutter framework, as well as other core APIs, for example, graphics, accessibility support, text
layout, and plugin architecture.
 Embedder: The embedder is a platform-specific layer that allows the Flutter app to run on any OS.

The embedder layer has platform-specific embedders, many of which provide an entry point and coordinate
with their respective operating system to access services like rendering, storage, and more. It has many
embedders for possible targeted platforms.

Java and C++ are used in embedders for android, objective-C/ C++ for IOS and macOS, and C++ for Linux
and windows.

1.4 MVC PATTERN (MODEL – VIEW – CONTROLLER)

Fig. 1.4 Model-View-Controller

MVC (MODEL-VIEW-CONTROLLER): MVC is one of the classic architectural patterns. This pattern is
widely used in various frameworks, including Flutter. It separates the app into three components.

 Model: Represents the data and business logic of the application. It's important to note that the
Model folder should not contain any UI code. The sole purpose of this folder is to store the data and
logic of the application, keeping it separate from the presentation. This way, changes to the data and
logic do not affect the UI and vice versa, making it easier to maintain and scale the code.
9
 View: Handles the UI elements and their layout.
Examples of what can be included in the View folder are:
o Widgets that display data, such as Text, Image, ListView, etc.
o Pages and routes, such as the main screen, detail screen, login screen, etc.
o UI components, such as AppBar, BottomNavigationBar, Drawer, etc.
o Custom widgets, such as Card and Button widgets, etc
 Controller: Acts as an intermediary between the model and view. It handles user input and updates
the model and view accordingly.
The controller layer should contain classes and functions that perform the following tasks:
o Handle user inputs.
o Update the Model.
o Notify the view.
o Validate data.
o Manage navigation.

10
CHAPTER: 2

SYSTEM REQUIREMENTS

Minimum Requirements:

Requirement Minimum
OS Windows 10, Windows 11, or later(64-bit), x86-64 based

Free Storage 1.64 GB


Memory 4 GB of RAM
Pre-installed tools Windows PowerShell 5.0 or newer, Git 2.x

Recommended Requirements:

The build process consumes lots of resources, especially the CPU. If our machine is too old, it will be too
hot, and we may have to pay more time than usual, as well as suffer stress while developing apps with
Flutter. Besides, using Android emulators during application development also consumes a large amount of
computer resources.

Requirement Recommended
OS Windows 10, Windows 11, Pro(64-bit)

Free Storage 20 GB (SSD is strongly recommended)


Memory 16 GB of RAM
CPU Intel Core i5-8400
Pre-installed tools Windows PowerShell 5.0 or newer, Git 2.x

11
CHAPTER: 3

SYSTEM ANALYSIS

3.1 IDENTIFICATION OF NEED

Identifying the need for a news application built with Flutter can be based on various factors and
considerations:

 Market Research: Conduct market research to understand if there is a demand for a news
application in our target audience. Analyze existing news apps and identify gaps or opportunities for
improvement.
 User Surveys: Collect feedback from potential users to understand their preferences and pain points
when it comes to news consumption. This can help us tailor our application to meet their needs.
 Interest Area: Explore the possibility of creating a news app that caters to a specific interest area,
such as technology, sports, or local news. A specialized app can attract a dedicated user base.
 Flutter Capabilities: Evaluate the advantages of using Flutter for our app development. Flutter
offers cross-platform compatibility, which can save development time and costs.
 Competition: Analyze the competition in the news app market. Identify what sets our app apart from
existing ones and we can offer a unique user experience.
 User Experience: Focus on delivering a user-friendly and visually appealing experience. Flutter’s UI
capabilities can help us to create an attractive and responsive app.
 User Engagement: Think about features that can engage users, such as multiple language options,
multiple news channels.

3.2 PRELIMINARY INVESTIGATION

 Defining Objectives and Goals: Clearly stated the purpose of our news application. What we are
aiming to achieve with it?
 Market Analysis: Conduct market research to understand if there is a demand for a news
application in our target audience. Analyze existing news apps and identify gaps or opportunities
for improvement.
 User Experience Design: Begin thinking about the app’s user interface and user experience.
Sketch out rough ideas and concepts for the app’s layout and features.
 Feature List: Creating an initial list of features of our news app.

12
 Development Resources: Assess the availability of development resources, including developers
in Flutter, designers.
 Technical Feasibility: Evaluating the technical feasibility of our project. Ensuring that Flutter
can meet our app’s requirements and that potential marketing or promotional costs.
 Risk Assessment: Identifying potential risks and challenges that could arise during development.
 Prototyping and Mock-ups: Creating preliminary prototypes to visualize that app’s layout and
functionality.
 Feedback and Validation: Gather feedback from potential users to validate our ideas and
concepts.

13
CHAPTER: 4

FEASIBILITY STUDY

4.1 Technical feasibility:

Technical feasibility assesses whether it's possible to develop the news application using the chosen
technology stack (in this case, Flutter). Consider the following:

 Skill Set: Evaluate whether your development team has the necessary skills and expertise in Flutter,
Dart, and related technologies. If not, you may need to invest in training or hire skilled developers.
 Tools and Resources: Ensure that the required development tools, libraries, and frameworks for
Flutter app development are available and up-to-date.
 Integration with APIs: Check if you can access and integrate with news APIs or sources to fetch
and display news content. Assess the availability and stability of these APIs.
 Performance: Determine if Flutter can provide the performance and responsiveness required for a
news application, especially if it includes multimedia content.
 Scalability: Assess whether the architecture can scale to accommodate a potentially large user base
and increasing data volume over time.
 Compatibility: Ensure that the app will be compatible with a variety of devices and screen sizes, as
well as different versions of Android and iOS.

4.2 Economical Feasibility:

Economical feasibility evaluates the financial aspects of the project. We need to analyze whether the
development and maintenance costs can be justified by potential revenues and benefits. Consider the
following:

 Development Costs: Estimate the costs associated with hiring developers, designers, and other
necessary personnel, as well as expenses for hardware, software licenses, and development tools.
 Operating Costs: Calculate ongoing expenses for hosting, maintenance, updates, and support.
 Revenue Model: Define how the news application will generate income, such as through
advertising, subscription fees, or in-app purchases. Analyze the potential revenue streams.
 Return on Investment (ROI): Assess the expected ROI over a specified period, factoring in
development and operating costs.
 Break-Even Analysis: Determine how many users or subscribers you need to reach the break-even
point and start making a profit.
14
4.3 Operational Feasibility:

Operational feasibility assesses whether the news application can be effectively managed and operated
within your organization. Consider the following:

 User Acceptance: Identify potential user groups and gather feedback to ensure the application meets
their needs and expectations.
 Staffing and Training: Determine whether your team has the capacity to manage and support the
application. If not, assess the need for additional staff and training.
 Data Management: Plan for the collection, storage, and retrieval of news content, user data, and
analytics, ensuring compliance with data privacy regulations.
 Security and Compliance: Evaluate the security measures in place to protect user data and ensure
compliance with relevant regulations.
 Disaster Recovery and Contingency Planning: Develop strategies to handle unforeseen technical
issues, data loss, or service interruptions.
 Sustainability: Consider the long-term sustainability of the news application, including its ability to
adapt to evolving technologies and user preferences

15
CHAPTER: 5

SOFTWARE ENGINEERING PARADIGM APPLIED

5.1 Development Models

 Agile Development: Scrum is a popular Agile framework that can be used for news applications. It
involves breaking the project into small iterations called sprints, which typically last 2-4 weeks. This
approach allows for flexibility and responsiveness to changing requirements in the fast-paced news
industry.
o Scrum is a subset of Agile. It is a lightweight process framework for agile development, and the most
widely-used one.
o A “process framework” is a particular set of practices that must be followed in order for a process to
be consistent with the framework. (For example, the Scrum process framework requires the use of
development cycles called Sprints, the XP framework requires pair programming, and so forth.)
o “Lightweight” means that the overhead of the process is kept as small as possible, to maximize the
amount of productive time available for getting useful work done.

Fig. 5.1.1 Agile Methodology

The four Agile values give you an inside look at what the methodology is founded upon:

 Individuals and interactions over processes and tools

 Working software over comprehensive documentation

 Customer collaboration over contract negotiation

16
 Responding to change by following a plan

The Agile process down into three main stages:

o Preparation
o Sprint planning
o Sprint

Preparation: In the preparation stage, the product owner creates a backlog of features they want to include
in the final product. This is known as the product backlog. Then, the development team estimates how long
each feature will take to build.

Sprint Planning: The sprint planning meeting is where the team decides which features from the product
backlog they are going to work on during the sprint.

A sprint is a set period (usually two weeks) during which the development team must achieve a specific goal.
The team also decides how many of each type of task they can complete during the sprint.

Sprint: During the sprint, the team works on completing the tasks in the sprint backlog. They may also come
across new issues to address. If this happens, they will add these issues to the product backlog and prioritize
them accordingly.

At the end of the sprint, the development team should have completed all features in the sprint backlog.

Benefits of Agile Development

There are many benefits of agile development methodology, some of which include:

o Increased flexibility: Agile development is more flexible than other project management
methodologies. Development teams can make changes on the fly more easily.

o Improved communication: Agile development helps to improve communication between the


development team and the product owner. Because of this, there is a greater focus on collaboration
and feedback.

o Reduced risks: Agile development can help to reduce the risks associated with complex projects. By
breaking down complex projects into smaller sprints, project managers can dissect them and achieve
shareholder demands.

o Increased customer satisfaction: Agile development environments often lead to increased


customer satisfaction. This is because the customer is involved in the development process and
provides feedback at each stage of the project.

o Superior quality product: In Agile project management, testing is an integrated part of the project
execution phase which means that the overall quality of the final product is greater. The client
17
remains involved in the development process and can ask for changes depending on the market
realities. Since Agile is an iterative process, self-organizing teams keep on learning and growing with
time and continue improving.

o Better control: Agile allows managers to have better control over the project due to its transparency,
feedback integration, and quality-control features. Quality is ensured throughout the implementation
phase of the project and all stakeholders are involved in the process with daily progress reports
through advanced reporting tools and techniques.
o Continuous improvement: Working on self-reflection and striving for continuous improvement is
one of the 12 core principles of the Agile manifesto. The methodology works in iterations which
means that each sprint will be better than the last one and previous mistakes will not be repeated.
Agile methodologies foster an open culture of idea exchange and collaboration which allows team
members to learn from shared experiences and improve together.

Limitations of Agile Model

There are also some disadvantages of agile development methodology, which include:

o Limited control: Because agile development is more flexible, it can be difficult for a project owner
to exert control over the project. This is a problem for projects that need to meet strict deadlines or
stay within a certain budget.
o Lack of documentation: Agile development often produces less documentation than other project
management methodologies. This is an issue for projects that require extensive documentation.
o High level of collaboration: The high level of collaboration required by agile development can be a
problem for remote teams that are not used to working together. This can lead to conflict and
frustration.
o Complex projects can be lengthy: Agile development often requires more time than other project
management methodologies. This is due to the need for more frequent meetings and the need to
create more documentation.
o No finite end: The fact that Agile requires minimal planning at the beginning makes it easy to get
sidetracked delivering new, unexpected functionality. Additionally, it means that projects have no
finite end, as there is never a clear vision of what the “final product” looks like.

18
 DevOps: DevOps is a paradigm that emphasizes collaboration between development and operations
teams. It can be beneficial for news applications that require frequent updates and continuous
integration/continuous deployment (CI/CD) pipelines to deliver new features and fixes quickly.

DevOps Work

o A DevOps team includes developers and IT operations working collaboratively throughout the
product lifecycle, in order to increase the speed and quality of software deployment. It’s a new
way of working, a cultural shift, that has significant implications for teams and the organizations
they work for.
o Under a DevOps model, development and operations teams are no longer “siloed.” Sometimes,
these two teams merge into a single team where the engineers work across the entire application
lifecycle — from development and test to deployment and operations — and have a range of
multidisciplinary skills.
o DevOps teams use tools to automate and accelerate processes, which helps to increase reliability.
A DevOps toolchain helps teams tackle important DevOps fundamentals including continuous
integration, continuous delivery, automation, and collaboration.
o DevOps values are sometimes applied to teams other than development. When security teams
adopt a DevOps approach, security is an active and integrated part of the development process.
This is called DevSecOps.

Fig. 5.1.2 DevOps

19
DevOps Lifecycle

The DevOps lifecycle consists of eight phases representing the processes, capabilities, and tools needed for
development (on the left side of the loop) and operations (on the right side of the loop). Throughout each
phase, teams collaborate and communicate to maintain alignment, velocity, and quality.

o Discover: Building software is a team sport. In preparation for the upcoming sprint, teams must
workshop to explore, organize, and prioritize ideas. Ideas must align to strategic goals and deliver
customer impact. Agile can help guide DevOps teams.
o Plan: DevOps teams should adopt agile practices to improve speed and quality. Agile is an iterative
approach to project management and software development that helps teams break work into smaller
pieces to deliver incremental value.
o Build: Git is a free and open source version control system. It offers excellent support for branching,
merging, and rewriting repository history, which has led to many innovative and powerful workflows
and tools for the development build process.
o Test: Continuous integration (CI) allows multiple developers to contribute to a single shared
repository. When code changes are merged, automated tests are run to ensure correctness before
integration. Merging and testing code often help development teams gain reassurance in the quality
and predictability of code once deployed.
o Deploy: Continuous deployment (CD) allows teams to release features frequently into production in
an automated fashion. Teams also have the option to deploy with feature flags, delivering new code
to users steadily and methodically rather than all at once. This approach improves velocity,
productivity, and sustainability of software development teams.
o Operate: Manage the end-to-end delivery of IT services to customers. This includes the practices
involved in design, implementation, configuration, deployment, and maintenance of all IT
infrastructure that supports an organization’s services.
o Observe: Quickly identify and resolve issues that impact product uptime, speed, and functionality.
Automatically notify your team of changes, high-risk actions, or failures, so you can keep services
on.
o Continuous feedback: DevOps teams should evaluate each release and generate reports to improve
future releases. By gathering continuous feedback, teams can improve their processes and
incorporate customer feedback to improve the next release.

20
Benefits of DevOps

o Speed: Teams that practice DevOps release deliverables more frequently, with higher quality and
stability. In fact, the DORA 2019 State of DevOps report found that elite teams deploy 208 times
more frequently and 106 times faster than low-performing teams. Continuous delivery allows teams
to build, test, and deliver software with automated tools.
o Improved collaboration: The foundation of DevOps is a culture of collaboration between
developers and operations teams, who share responsibilities and combine work. This makes teams
more efficient and saves time related to work handoffs and creating code that is designed for the
environment where it runs.
o Rapid deployment: By increasing the frequency and velocity of releases, DevOps teams improve
products rapidly. A competitive advantage can be gained by quickly releasing new features and
repairing bugs.
o Quality and reliability: Practices like continuous integration and continuous delivery ensure
changes are functional and safe, which improves the quality of a software product. Monitoring helps
teams keep informed of performance in real-time.
o Security: By integrating security into a continuous integration, continuous delivery, and continuous
deployment pipeline, DevSecOps is an active, integrated part of the development process. Security is
built into the product by integrating active security audits and security testing into agile development
and DevOps workflows
 SERVERLESS COMPUTING: Serverless computing abstracts server management, allowing
developers to focus on writing code without worrying about infrastructure. It can be used for specific
components or functions within a news application, like handling user authentication or processing
image uploads.
 MVC (Model-View-Controller): MVC is a widely used design pattern that separates an application
into three interconnected components - Model, View, and Controller. In the context of a news
application:
o Model: Represents the data and business logic, such as fetching and managing news articles.
o View: Represents the user interface components for displaying news articles.
o Controller: Acts as an intermediary between the Model and View, handling user input and
managing the flow of data.
 MVVM (Model-View-View Model): MVVM is a design pattern that separates the user interface
from the application's business logic. In Flutter, you can use packages like provider or flutter_bloc to
implement MVVM architecture. The View Model acts as an abstraction layer between the Model and
the View, making it easier to test and maintain the code.
21
 Reactive Programming: Flutter works well with reactive programming libraries like RxDart or the
built-in Stream and Future constructs. These libraries enable you to handle asynchronous operations,
such as fetching news data, in a more responsive and efficient manner.
 Continuous Integration and Continuous Delivery (CI/CD): Implementing CI/CD practices
ensures that your Flutter news application is automatically built, tested, and deployed to various
platforms, helping maintain code quality and streamline the release process.

Fig 5.1.3 Model-View-View Model

FEATURES

 Life Cycle state of Application will be maintained.


 The application will be in the same position as where the user left it.
 UI Components are kept away from Business Logic.
 Business Logic is kept away from Database operations.
 Easy to understand and read.

22
CHAPTER: 6

SYSTEM DESIGN

6.1 USER INTERFACE

 Slash screen: Splash screen (also known as launch screen) provide a simple initial experience while
our application loads. They set the stage for our application, while allowing time for the app engine
to load and our app to initialize.
 Login Page: In login or welcome page the user has to enter their name to proceed further. Login
page consists username field, user can only proceed after enter the name.
 Alert Dialog: Login page consists username field in which the user can only proceed if he/she will
enter the name otherwise the alert dialog box will appear on top of the login page.
 Language Selection: After entering the username, the user will navigate to language selection page.
There are three options of languages user can select the language according to their need.
o Hindi
o English
o Punjabi
 Home Page: After selecting the language the user will navigate to Home Page where the can see
multiple news channels. We use Flutter’s ‘GridView’ widget to display news logos.
o View all: In homepage, there is view all option on bottom-right which will display all news
channels in grid view.
o Scrollable view: Grid View consists automatic scrollable feature with which we can scroll
down the page to see multiple news channels. To proceed further, the click is introduced on
logo the user has to click on any news channel’s logo according to their interest through
which user will navigate to web page of that particular news channel.
o Carousel Slider: A carousel slider widget, support infinite scroll. It is one of the most popular
image slider used nowadays in most apps.

6.1.1 Performance Optimization

Optimizing our Flutter application for performance, including lazy loading of images, efficient data fetching,
and reducing unnecessary widget rebuilds.

The best ways to optimize the performance of your Flutter app.

23
1. Use the Latest Version of Flutter

The first and most important step in improving the performance of your Flutter app is to ensure that you’re
using the latest version of the framework. Flutter is constantly being updated with new features, bug fixes,
and performance improvements. By staying up-to-date with the latest version of Flutter, you can take
advantage of these improvements and ensure that your app is performing at its best.

2. Minimize Widget Rebuilds

One of the main advantages of Flutter is its ability to build complex user interfaces with ease. However, this
can come at a cost in terms of performance. One way to improve the performance of your Flutter app is to
minimize the number of widget rebuilds that occur during the rendering process. To achieve this, you can
use the shouldRebuild method to determine whether a widget needs to be rebuilt or not. This method allows
you to compare the current and previous states of a widget and only rebuild it if necessary.

3. Use Stateless Widgets

Stateless widgets are a type of widget that does not have any mutable state, meaning that their appearance
does not change over time. Instead, they are purely a function of their input parameters and the context in
which they are rendered. Using stateless widgets can improve the performance of your Flutter app in several
ways:

 Reduced Build Time: Stateless widgets can be built faster than stateful widgets because they do not
have to maintain any mutable state. This can improve the startup time of your app and reduce the
time it takes to render widgets on the screen.

 Improved Reusability: Because stateless widgets are purely a function of their input parameters,
they can be easily reused across different parts of your app. This can help reduce the amount of code
duplication in your app and make it easier to maintain over time.

 Increased Testability: Stateless widgets are easier to test because they do not have any mutable state
that needs to be mocked or manipulated during testing. This can help improve the reliability of your
app and reduce the likelihood of bugs or errors.

4. Use Const Keyword

In Flutter, you can use the const keyword to create compile-time constants for various elements in your app,
including widgets, strings, and data models. By using const, you can improve the performance of your
Flutter app in several ways. When you use the const keyword to create a widget, it tells Flutter that the
widget’s properties and children will not change during the widget’s lifetime. This allows Flutter to optimize
the widget’s rendering and layout, as it can assume that the widget’s properties will remain constant and
doesn’t need to check for changes.

24
5. Use the ListView.builder Widget

The ListView.builder widget is a Flutter widget that provides a way to lazily create and display a list of
widgets based on an underlying data source. The builder callback function passed to the ListView.builder
widget is called only for the items that are visible on the screen or will be visible soon, instead of creating all
the items at once. ListView.builder widget can significantly improve the performance of your Flutter app
when dealing with large lists of data. By creating only the visible items and avoiding the creation of
unnecessary widgets, you can reduce the memory and CPU usage of your app and make it more efficient and
responsive.

6. Optimize Image Loading

Images are an important part of many mobile and web applications, but they can also be a source of
performance issues if not handled correctly. To improve the performance of your Flutter app, you should
optimize the way images are loaded. One way to do this is to use the CachedNetworkImage package,
which caches images to reduce the number of network requests required to load them. You can also use the
fade-in image technique to improve the perceived performance of your app by displaying a low-resolution
image first and then gradually replacing it with a high-resolution version.

7. Use a State Management Library

State management is an important aspect of building high-performing Flutter apps. By using a state
management library, you can centralize your app’s state and reduce the number of rebuilds required to
update the UI. Some popular state management libraries for Flutter include Provider, Redux, and Bloc.
Each of these libraries has its own strengths and weaknesses, so it’s important to choose the one that best fits
your app’s needs.

8. Use the Right Data Structures

Using the right data structures can also have a significant impact on the performance of your Flutter app. For
example, using a List instead of a Map can be more efficient in certain situations, such as when you need
to iterate over the elements in a collection. Similarly, using a Set instead of a List can be more efficient
when you need to perform operations that involve checking for the presence of a particular element.

9. Optimize the Build Process

The build process can also have a significant impact on the performance of your Flutter app. To optimize the
build process, you should use the release mode when building your app for production. This mode generates
an optimized version of your code that runs faster and consumes less memory. You can also use code
splitting to reduce the size of your app and improve its performance. Code splitting involves breaking your
code into smaller, more manageable chunks that can be loaded on demand.

25
10. Use Lazy Loading

Lazy loading is another technique that can be used to improve the performance of your Flutter app. This
involves delaying the loading of resources, such as images until they are actually needed. By using lazy
loading, you can reduce the initial load time of your app and improve its perceived performance. The Flutter
framework provides several ways to implement lazy loading, including
the Visibility and ScrollController classes.

11. Optimize Animations

Animations can be a great way to make your Flutter app more engaging and visually appealing, but they can
also be a source of performance issues if not optimized properly. To improve the performance of your app’s
animations, you should use the AnimatedBuilder widget instead of the AnimatedWidget widget. The
AnimatedBuilder widget allows you to separate the animation logic from the widget itself, which can reduce
the number of rebuilds required to update the UI. You can also use the Tween animation instead of the Curve
animation. The Tween animation allows you to define the start and end values of the animation, while the
Curve animation defines the rate at which the animation progresses.

12. Use Asynchronous Operations

Asynchronous operations can be used to improve the performance of your Flutter app by allowing long-
running tasks to be performed in the background. This prevents the UI from becoming unresponsive while
the task is being executed. To implement asynchronous operations in your Flutter app, you can use the async
and await keywords. These keywords allow you to define asynchronous methods that can be called from
your app’s UI. You can also use the FutureBuilder widget to asynchronously load data into your app’s UI.
The FutureBuilder widget displays a loading indicator while the data is being loaded and then displays the
data once it’s available.

13. Use Performance Analysis Tools

Finally, one of the best ways to improve the performance of your Flutter app is to use performance analysis
tools. These tools can help you identify performance bottlenecks in your code and optimize it for better
performance.

Flutter provides several built-in performance analysis tools, including the Dart Observatory and the Flutter
Performance tab in the DevTools. These tools allow you to monitor your app’s performance in real time and
identify issues such as excessive CPU usage, slow frame rates, and memory leaks.

6.1.2 Testing

Performing extensive testing including unit tests, widget tests, and integration tests using Flutter’s testing
framework.

26
 Unit Tests: A unit test tests a single function, method, or class. The goal of a unit test is to verify the
correctness of a unit of logic under a variety of conditions. External dependencies of the unit under
test are generally mocked out. Unit tests generally don’t read from or write to disk, render to screen,
or receive user actions from outside the process running the test. For more information regarding unit
tests, you can view the following recipes or run flutter test --help in your terminal.

 Widget tests: A widget test (in other UI frameworks referred to as component test) tests a single
widget. The goal of a widget test is to verify that the widget’s UI looks and interacts as expected.
Testing a widget involves multiple classes and requires a test environment that provides the
appropriate widget lifecycle context.
For example, the Widget being tested should be able to receive and respond to user actions and
events, perform layout, and instantiate child widgets. A widget test is therefore more comprehensive
than a unit test.
 Integration tests: An integration test tests a complete app or a large part of an app. The goal of an
integration test is to verify that all the widgets and services being tested work together as expected.
Furthermore, you can use integration tests to verify your app’s performance.
Generally, an integration test runs on a real device or an OS emulator, such as iOS Simulator or
Android Emulator. The app under test is typically isolated from the test driver code to avoid skewing
the results.

27
CHAPTER: 7

FLOW CHART

NEWS APPLICATION

SPLASH SCREEN

LOGIN PAGE

TEXTFIELD FOR USERNAME

IS
EMPTY?

YES NO

ALERT!
LANGUAGE SELECTION
ENTER USERNAME

28
HINDI ?

ENGLISH?

PUNJABI?

HINDI NEWS PUNJABI NEWS

CHANNELS CHANNELS

ENGLISH
NEWS CHANNELS

END

29
CHAPTER: 8

SCREEN SHOTS

 Splash Screen: The first UI is Splash screen of news application.

 Login: Login page consists username field in which the user can only proceed if he/she will enter the
name otherwise the alert dialog box will appear on top of the login page.

30
 Alert Dialog: Alert dialog is used for notify the user to enter the field. The user can only proceed
after entering the username

 Enter the username: The user will enter the name, and will navigate to homepage. The username is
entered here- Shavnam

31
 Language Selection: Language selection page consists three options: Hindi, English and Punjabi,
user can select any of one language according to their interest. Here I select Hindi.

32
 Home Page: Home page contains a carousel slider and the channel list in grid view. Here we have an
option of view all on bottom-right it will navigate to next page which has multiple news channels.
o Here I click on AajTak news logo.

o It will navigate to web page of AajTak Hindi news channel.

o Here I select English language and Zee news channel.

33
o It will navigate to web page of Zee news English news channel.

Here I select Punjabi language and Punjabi Tribune channel.

34
o It will navigate to web page of Punjabi Tribune news channel.

35
Here I select Punjabi language and channel.

o It will navigate to web page of ABP news channel.

36
37
CHAPTER: 9

CODING

8.1CODING:

The coding is the process of transforming the design of a system into a computer language format. This
coding phase of software development is concerned with software translating design specification into the
source code. It is necessary to write source code & internal documentation so that conformance of the code
to its specification can be easily verified.

Coding is done by the coder or programmers who are independent people than the designer. The goal is not
to reduce the effort and cost of the coding phase, but to cut to the cost of a later stage. The cost of testing and
maintenance can be significantly reduced with efficient coding.

Goals of Coding

1. To translate the design of system into a computer language format: The coding is the process of
transforming the design of a system into a computer language format, which can be executed by a
computer and that perform tasks as specified by the design of operation during the design phase.

2. To reduce the cost of later phases: The cost of testing and maintenance can be significantly reduced
with efficient coding.

3. Making the program more readable: Program should be easy to read and understand. It increases
code understanding having readability and understandability as a clear objective of the coding
activity can itself help in producing more maintainable software.

Coding Standards

1. Indentation: Proper and consistent indentation is essential in producing easy to read and
maintainable programs.
Indentation should be used to:
o Emphasize the body of a control structure such as a loop or a select statement.
o Emphasize the body of a conditional statement
o Emphasize a new scope block
2. Inline comments: Inline comments analyze the functioning of the subroutine, or key aspects of the
algorithm shall be frequently used.

38
3. Rules for limiting the use of global: These rules file what types of data can be declared global and
what cannot.
4. Structured Programming: Structured (or Modular) Programming methods shall be used. "GOTO"
statements shall not be used as they lead to "spaghetti" code, which is hard to read and maintain,
except as outlined line in the FORTRAN Standards and Guidelines.
5. Naming conventions for global variables, local variables, and constant identifiers: A possible
naming convention can be that global variable names always begin with a capital letter, local variable
names are made of small letters, and constant names are always capital letters.
6. Error return conventions and exception handling system: Different functions in a program report
the way error conditions are handled should be standard within an organization. For example,
different tasks while encountering an error condition should either return a 0 or 1 consistently

Features of coding in Flutter

Coding in Flutter involves building cross-platform mobile applications using the Flutter framework, which is
known for its expressive and flexible UI components. Flutter allows you to create native-like apps for iOS,
Android, web, and desktop from a single codebase.

Here are some key features and concepts of Flutter development:

 Widgets: Flutter uses a widget-based architecture where everything is a widget. Widgets are building
blocks for creating the user interface. Flutter provides a rich set of pre-built widgets for common UI
elements like buttons, text, images, and more. You can also create custom widgets.
 Hot Reload: One of the standout features of Flutter is its hot reload capability. It allows developers
to see the effects of code changes in real-time without restarting the app. This speeds up the
development process and makes it easier to iterate on designs and features.
 Dart Language: Flutter uses the Dart programming language, which is easy to learn and has a rich
set of libraries and tools. Dart is compiled to native code, resulting in high-performance apps.
 Material Design and Cupertino: Flutter provides two sets of widgets: Material Design widgets for
Android-style apps and Cupertino widgets for iOS-style apps. You can choose the appropriate set of
widgets for your target platform or customize them as needed.
 State Management: Flutter offers various options for managing the state of your app, including
setState, Provider, Redux, and more. Choosing the right state management solution depends on the
complexity of your app.
 Navigation: Flutter offers built-in navigation support, allowing you to manage the navigation stack
and transition between screens or pages. You can use the Navigator widget to navigate between
routes.

39
 Platform Integration: Flutter provides plugins and packages to integrate with platform-specific
features and services like camera access, geolocation, Firebase, and more. These plugins help you
leverage native capabilities in your app.

 Internationalization and Localization: Flutter supports internationalization and localization,


making it easy to create apps that can be used in multiple languages and regions.
 Responsive Layouts: Flutter supports responsive design, enabling you to create apps that adapt to
various screen sizes and orientations, including mobile, tablet, and desktop.
 Testing and Debugging: Flutter offers a rich set of tools for testing and debugging your app,
including unit testing, widget testing, and integration testing. The Flutter DevTools suite provides
additional debugging capabilities.
 Performance: Flutter is known for its excellent performance, thanks to its compiled nature and the
use of the Skia graphics engine. It can achieve 60fps on most devices, providing a smooth user
experience.
 Community and Ecosystem: Flutter has a vibrant and growing community, with a wide range of
packages and libraries available on pub.dev, Flutter's package repository.
 Desktop and Web Support: Flutter has expanded beyond mobile platforms to include support for
building desktop and web applications, allowing you to target even more platforms with a single
codebase.
 Animations: Flutter provides powerful animation support, making it easy to create smooth and
complex animations for your app's user interface.
 Accessibility: Flutter is committed to accessibility, and it provides tools and guidelines to ensure that
your app is accessible to users with disabilities. oding in Flutter involves building cross-platform
mobile applications using the Flutter framework, which is known for its expressive and flexible UI
components. Flutter allows you to create native-like apps for iOS, Android, web, and desktop from a
single codebase. Here are some key features and concepts of Flutter development:

40
Coding main module

main.dart

import 'package:flutter/material.dart';

import 'package:get/get_navigation/get_navigation.dart';

import 'package:newz/view/splash.dart';

void main() {

runApp(const MyApp());

class MyApp extends StatelessWidget {

const MyApp({Key? key}) : super(key: key);

@override

Widget build(BuildContext context) {

return GetMaterialApp(

title: 'News',

theme: ThemeData(

primarySwatch: Colors.blue,

),

home: Splash(),

);

41
CHAPTER: 10

VALIDATION CHECKS

In a news application developed using Flutter, validation checks are crucial to ensure data accuracy, security,
and a seamless user experience.

Here are some common validation checks we should consider implementing:

 Input Validation
o Required Fields: Ensure that essential fields, such as search queries or user inputs, are not empty
before making requests or processing data.
o Length Validation: Check the length of user inputs, such as article titles or comments, to ensure
they meet specified criteria (e.g., not too short or too long).
o Data Types: Validate that the data type of inputs matches the expected format (e.g., date should be
in a specific format).
 Authentication and Authorization:
o User Authentication: Verify the identity of users before allowing access to certain features like
saving articles or posting comments.
o Role-Based Access Control: Ensure that users have the appropriate permissions to perform specific
actions (e.g., only admin users can delete articles).
 Network Connectivity
o Internet Connection: Check for an active internet connection before making API requests to fetch
news articles.
o Request Timeout: Implement timeouts and error handling for API requests to prevent the app from
freezing or crashing due to network issues.
 Data Integrity
o Data Integrity Checks: Ensure that the data fetched from external sources (e.g., APIs) is in the
expected format and contains all required fields.

42
o Checksums or Hashes: Implement checksums or hashes to detect any data corruption during
transmission.
 Security
o SQL Injection Prevention: Use parameterized queries or an Object-Relational Mapping (ORM)
library to prevent SQL injection attacks when interacting with databases.

o Cross-Site Scripting (XSS) Prevention: Sanitize user-generated content (e.g., comments) to prevent
XSS attacks.
o HTTPS: Use HTTPS for all network requests to encrypt data in transit.
 User Feedback
o Error Messages: Provide clear and user-friendly error messages to guide users when validation
checks fail.
o Form Validation: Implement real-time validation feedback for forms (e.g., highlighting invalid input
fields).
 Performance
o Data Caching: Implement caching mechanisms to store previously fetched news articles, reducing
the need for frequent network requests.
o Image Optimization: Optimize the loading and caching of images to improve app performance.
 Testing
o Unit Testing: Write unit tests to verify the correctness of validation and business logic.
o Integration Testing: Perform integration tests to ensure that various parts of your app work together
as expected.
 Accessibility
o Accessibility Checks: Ensure that your app is accessible to users with disabilities by following
accessibility guidelines.
 User Experience
o User-Friendly Feedback: Provide meaningful feedback to users when validations fail, guiding them
on how to correct the issue.

43
CHAPTER: 11

TESTING

11.1 INTRODUCTION TO TESTING:

Testing is a method to assess the functionality of the software program. The process checks whether the
actual software matches the expected requirements and ensures the software is bug-free. The purpose of
software testing is to identify the errors, faults, or missing requirements in contrast to actual requirements. It
mainly aims at measuring the specification, functionality, and performance of a software program or
application.

Testing can be divided into two steps:

 Verification: It refers to the set of tasks that ensure that the software correctly implements a specific
function. It means “Are we building the product right?”.
 Validation: It refers to a different set of tasks that ensure that the software that has been built is
traceable to customer requirements. It means “Are we building the right product?”.

Automated tests help ensure that your app performs correctly before you publish it, while retaining your feature and
bug fix velocity.

Automated testing falls into a few categories:

o A unit test tests a single function, method, or class.


o A widget test (in other UI frameworks referred to as component test) tests a single widget.
o An integration test tests a complete app or a large part of an app.

Generally speaking, a well-tested app has many unit and widget tests, tracked by code coverage, plus enough
integration tests to cover all the important use cases. This advice is based on the fact that there are trade-offs
between different kinds of testing, seen below.

44
Unit Widget Integration

Confidence Low Higher Highest

Maintenance cost Low Higher Highest

Dependencies Few More Most

Execution speed Quick Quick Slow

 Unit tests: A unit test tests a single function, method, or class. The goal of a unit test is to verify the
correctness of a unit of logic under a variety of conditions. External dependencies of the unit under
test are generally mocked out. Unit tests generally don’t read from or write to disk, render to screen,
or receive user actions from outside the process running the test. For more information regarding unit
tests, you can view the following recipes or run flutter test --help in our terminal.

 Widget tests: A widget test (in other UI frameworks referred to as component test) tests a single
widget. The goal of a widget test is to verify that the widget’s UI looks and interacts as expected.
Testing a widget involves multiple classes and requires a test environment that provides the
appropriate widget lifecycle context.
For example, the Widget being tested should be able to receive and respond to user actions and
events, perform layout, and instantiate child widgets. A widget test is therefore more comprehensive
than a unit test. However, like a unit test, a widget test’s environment is replaced with an
implementation much simpler than a full-blown UI system.
 Integration tests: An integration test tests a complete app or a large part of an app. The goal of an
integration test is to verify that all the widgets and services being tested work together as expected.
Furthermore, you can use integration tests to verify your app’s performance.

Generally, an integration test runs on a real device or an OS emulator, such as iOS Simulator or Android
Emulator. The app under test is typically isolated from the test driver code to avoid skewing the results.

Importance of Testing

 Defects can be identified early: Software testing is important because if there are any bugs they can
be identified early and can be fixed before the delivery of the software.
 Improves quality of software: Software Testing uncovers the defects in the software, and fixing
them improves the quality of the software.
45
 Increased customer satisfaction: Software testing ensures reliability, security, and high
performance which results in saving time, costs, and customer satisfaction.
 Helps with scalability: Software testing type non-functional testing helps to identify the scalability
issues and the point where an application might stop working.
 Saves time and money: After the application is launched it will be very difficult to trace and resolve
the issues, as performing this activity will incur more costs and time. Thus, it is better to conduct
software testing at regular intervals during software development.

Need of Testing

Software bugs can cause potential monetary and human loss. There are many examples in history that clearly
depicts that without the testing phase in software development lot of damage was incurred. Below are some
examples:

 1985: Canada’s Therac-25 radiation therapy malfunctioned due to a software bug and resulted in
lethal radiation doses to patients leaving 3 injured and 3 people dead.
 1994: China Airlines Airbus A300 crashed due to a software bug killing 264 people.
 1996: A software bug caused U.S. bank accounts of 823 customers to be credited with 920 million
US dollars.
 1999: A software bug caused the failure of a $1.2 billion military satellite launch.
 2015: A software bug in fighter plan F-35 resulted in making it unable to detect targets correctly.
 2015: Bloomberg terminal in London crashed due to a software bug affecting 300,000 traders on the
financial market and forcing the government to postpone the 3bn pound debt sale.
 Starbucks was forced to close more than 60% of its outlet in the U.S. and Canada due to a software
failure in its POS system.
 Nissan cars were forced to recall 1 million cars from the market due to a software failure in the car’s
airbag sensory detectors.

Different types of Testing

Testing can be broadly classified into 3 types:

1. Functional Testing: Functional testing is a type of software testing that validates the software
systems against the functional requirements. It is performed to check whether the application is
working as per the software’s functional requirements or not. Various types of functional testing are
Unit testing, Integration testing, System testing, Smoke testing, and so on.

2. Non-functional Testing: Non-functional testing is a type of software testing that checks the
application for non-functional requirements like performance, scalability, portability, stress, etc.

46
Various types of non-functional testing are Performance testing, Stress testing, Usability Testing, and
so on.

3. Maintenance Testing: Maintenance testing is the process of changing, modifying, and updating the
software to keep up with the customer’s needs. It involves regression testing that verifies that recent
changes to the code have not adversely affected other previously working parts of the software.

Fig11.1.1: Types of Testing

Testing Techniques

Testing techniques can be majorly classified into two categories:

1. Black Box Testing: Black box technique of testing in which the tester doesn’t have access to the
source code of the software and is conducted at the software interface without any concern with the
internal logical structure of the software known as black-box testing.

47
Fig 11.1.2 Black Box Testing

Black Box Testing Techniques

Following are the prominent Test Strategy amongst the many used in Black box Testing

 Equivalence Class Testing: It is used to minimize the number of possible test cases to an
optimum level while maintains reasonable test coverage.
 Boundary Value Testing: Boundary value testing is focused on the values at boundaries. This
technique determines whether a certain range of values are acceptable by the system or not. It is
very useful in reducing the number of test cases. It is most suitable for the systems where an input
is within certain ranges.
 Decision Table Testing: A decision table puts causes and their effects in a matrix. There is a
unique combination in each column.

2. White-Box Testing: White box technique of testing in which the tester is aware of the internal
workings of the product, has access to its source code, and is conducted by making sure that all
internal operations are performed according to the specifications is known as white box testing.

Fig 11.1.3 White Box Testing

48
 Understand the source code: A tester needs to learn and understand the app’s source code at first.
White box testing involves the inner functions of an app. So, the tester must have sound knowledge
of the programming languages that the developers have used to write the app.

The tester should be aware of source coding practice. Ensuring security is the primary objective of
white box testing. The tester has to find out the security-related issues of the software and prevent
attacks from hackers.

 Create test case: The second step of white-box testing is verifying the application’s source codes for
proper structure and flow. They usually write more code to test the source code of the software. The
testers develop small tests for every series or process in the application.

Pros and Cons of Using White Box Testing

Pros:

 Easy to automate
 White box testing is a very thorough technique method
 All the code structures are thoroughly tested
 It helps the testers to optimize the code and remove error from it
 White box testing helps to remove extra lines of code
 This testing method can start earlier as it doesn’t need any interface.

Cons:

 It is a complex testing method


 Sometimes white box testing is not realistic
 All the existing codes are tested. So, it is tough to detect missing functionalities
 Testers need to have in-depth knowledge of the code and the programming language
 Rewriting and redesigning of code demand test cases to be written again
 It is costly

3. Gray Box Testing: Gray Box technique is testing in which the testers should have knowledge of
implementation, however, they need not be experts.

49
Fig 11.1.4 Gray Box Testing

Gray Box Testing is performed for the following reason:

 It provides combined benefits of both black box testing and white box testing both
 It combines the input of developers as well as testers and improves overall product quality
 It reduces the overhead of long process of testing functional and non-functional types
 It gives enough free time for a developer to fix defects
 Testing is done from the user point of view rather than a designer point of view

To perform Gray box Testing:

 It applies a straightforward technique of black box testing


 It is based on requirement test case generation, as such, it presets all the conditions before the
program is tested by assertion method.

Techniques used for Gray box Testing are:

 Matrix Testing: This testing technique involves defining all the variables that exist in their
programs.
 Regression Testing: To check whether the change in the previous version has regressed other aspects
of the program in the new version. It will be done by testing strategies like retest all, retest risky use
cases, retest within a firewall.
 Orthogonal Array Testing or OAT: It provides maximum code coverage with minimum test cases.
 Pattern Testing: This testing is performed on the historical data of the previous system defects.
Unlike black box testing, grey box testing digs within the code and determines why the failure
happened.

50
Advantages

 Gray box testing gives the advantages of black-box testing and white box testing.
 The product quality is better because the inputs of developers and testers are considered.
 The testing process is comparatively shorter.
 It provides the developer to fix defects.
 The testing goals are clear which makes it an easier process for developers as well as testers.
 Testers are not required to be experts.
 Gray box testing is cheaper than integration testing.
 Testing is done on the basis of high-level database diagrams and data flow diagrams

Disadvantages

 Gray box testing cannot be used for the testing of algorithms.


 It might be difficult to design the test cases.
 Even though it is a combination of black box and white box testing, it does not have the full benefits
of white box testing.
 There might be difficulty in understanding the link between a defect and its root cause.

Different levels of Testing

Software level testing can be majorly classified into 4 levels:

 Unit Testing: Unit testing is a level of the software testing process where individual
units/components of a software/system are tested. The purpose is to validate that each unit of the
software performs as designed.

51
Fig 11.1.5 Unit Testing

 Integration Testing: Integration testing is a level of the software testing process where individual
units are combined and tested as a group. The purpose of this level of testing is to expose faults in the
interaction between integrated units.

Fig 11.1.6 Integration Testing

 System Testing: System testing is a level of the software testing process where a complete,
integrated system/software is tested. The purpose of this test is to evaluate the system’s compliance
with the specified requirements.

52
Fig 11.1.7 System Testing

 Acceptance Testing: Acceptance testing is a level of the software testing process where a system is
tested for acceptability. The purpose of this test is to evaluate the system’s

Fig 11.1.8 Acceptance Testing

CHAPTER: 12

IMPLEMENTATION AND MAINTENANCE

53
Creating and maintaining a news application in Flutter involves several steps, including designing the user
interface, fetching and displaying news data, and keeping the app up to date with the latest news. Here's a
high-level overview of the process:

Implementation

 Project Setup
o Install Flutter and set up your development environment.
o Create a new Flutter project using the flutter create command.
 UI Design
o Design the user interface for your news app. You can use Flutter's widgets to create a visually
appealing and responsive design.
o Consider using packages like flutter_bloc or Provider for state management to handle UI updates
efficiently.
 API Integration
o Choose a news API or multiple APIs to fetch news data. Popular choices include NewsAPI, The New
York Times API, or any other reputable news source API.
o Create a class to handle API requests and responses. You can use the http package for making HTTP
requests.
 Fetching News Data
o Make API calls to retrieve news articles, categories, and other relevant information.
o Parse the JSON responses into Dart objects.
 Displaying News
o Use Flutter widgets like ListView, GridView, or custom layouts to display the news articles in a user-
friendly way.
o Implement features like infinite scrolling or pagination to load more articles as the user scrolls.
 User Interactions
o Implement features like tapping on an article to view its details.
o Add the ability to save favorite articles or share them on social media.
 Notifications
o If desired, add push notifications to notify users of breaking news or updates.

Maintenance

 Bug Fixes
54
o Regularly test your app and fix any bugs or crashes that users report.
 Content Update
o Continuously update your news data by fetching the latest articles from the API(s).
o Consider implementing background fetch or push notifications to keep the app up to date.
 Performance Optimization
o Monitor and optimize the app's performance, especially if it starts to lag or consume excessive
resources.
 Security Updates
o Keep your app and its dependencies up to date to address any security vulnerabilities.
 User Feedback
o Listen to user feedback and make improvements based on their suggestions.
 App Store Updates
o Update your app in the app stores (e.g., Google Play Store, Apple App Store) to provide users with
the latest features and bug fixes.
 Server Maintenance
o If you have a backend server, ensure it is well-maintained and secure to prevent data breaches or
downtime.
 Legal and Compliance
o Stay compliant with copyright laws and ensure your app's content does not violate any regulations.
 Monetization
o If you plan to monetize your app, implement the chosen monetization strategy (e.g., ads,
subscriptions) and monitor its performance.
 User Support
o Provide user support through a feedback system, email, or a dedicated support team to address user
issues and questions.

CHAPTER: 13

55
SYSTEM SECURITY MEASURES

Securing a news application in Flutter, or any mobile app for that matter, is crucial to protect user data,
ensure the app's integrity, and maintain user trust. Here are some system security measures you should
consider when developing a news application in Flutter:

 Authentication and Authorization

Implement user authentication using secure protocols like OAuth 2.0 or Firebase Authentication. Verify user
identity before granting access to sensitive data or features.

Enforce proper authorization rules to ensure that users can only access the information they are entitled to.

 Secure Data Storage

Use encrypted storage for sensitive data such as user credentials, tokens, and other user-related information.

Store API keys and other secrets securely using methods like Flutter's flutter_secure_storage or the platform-
specific Keychain (iOS) and SharedPreferences (Android).

 HTTPS and Data Encryption

Ensure that all data transmission between the app and your backend server is encrypted using HTTPS
(SSL/TLS).

Implement end-to-end encryption for sensitive user-generated content, if applicable.

 API Security

Secure your APIs with proper authentication and authorization mechanisms. Use API keys, tokens, or OAuth
tokens to protect access.

Implement rate limiting and request throttling to prevent abuse and protect your server from DoS attacks.

 Code Obfuscation

Obfuscate your Flutter code to make it more challenging for attackers to reverse-engineer your app and
discover vulnerabilities.

 Input Validation

Always validate user inputs on both the client and server sides to prevent injection attacks such as SQL
injection and Cross-Site Scripting (XSS).

 Authentication Tokens

56
Use short-lived authentication tokens and refresh tokens to reduce the window of opportunity for attackers.

 Securely Manage Secrets

Avoid hardcoding sensitive information in your code. Use environment variables or configuration files for
storing secrets and ensure that they are not exposed in the source code repository.

 App Permissions

Only request and use necessary permissions. Explain to users why you need certain permissions, and allow
them to grant or deny these permissions explicitly.

 Regular Security Audits

Conduct regular security audits and penetration testing to identify and fix vulnerabilities in your app.

 Data Privacy Compliance

Ensure compliance with data privacy regulations such as GDPR, CCPA, or any other relevant local
regulations. Handle user data with care and respect their privacy.

 Secure Third-party Libraries

Be cautious when using third-party packages and libraries. Make sure they are reputable and up-to-date to
avoid vulnerabilities.

 Error Handling

Implement proper error handling and logging to monitor and respond to security incidents effectively.

 User Education

Educate users about security best practices, such as creating strong passwords and being cautious with their
personal information.

 Regular Updates

Keep your Flutter app and its dependencies up-to-date to benefit from security patches and improvements.

CHAPTER: 14
57
VARIOUS TYPES OF MODULES

Designing a news application in Flutter involves various components and considerations from the user
interface presentation.

10.1 User Interface Design


 Splash Screen:

Splash screen (also known as launch screen) provide a simple initial experience while our application loads.
They set the stage for our application, while allowing time for the app engine to load and our app to
initialize. In our UI, splash screen contains a news logo.

 User Login:

User login page contains the field of username, where the user has to enter their name to proceed further, if
user click on next button without enter their name it will get a alert dialog box.

 Alert Dialog:

Login page consists username field in which the user can only proceed if he/she will enter the name
otherwise the alert dialog box will appear on top of the login page.

 Language Selection:

After entering the username, the user will navigate to language selection page. There are three options of
languages user can select the language according to their need.

o Hindi
o English
o Punjabi
 Home Page:

After selecting the language, the user will navigate to Home Page where the can see multiple news channels.
We use Flutter’s ‘GridView’ widget to display news logos.

o Carousel Slider: A carousel slider widget, support infinite scroll. It is one of the most popular image
slider used nowadays in most apps.
o View all: In homepage, there is view all option on bottom-right which will display all news channels
in grid view.
o Scrollable view: Grid View consists automatic scrollable feature with which we can scroll down the
page to see multiple news channels. To proceed further, the click is introduced on logo the user has to
58
click on any news channel’s logo according to their interest through which user will navigate to web
page of that particular news channel.
 Channel list:

On clicking, view all option the next page is channel list. It contains all the channels in Grid View we can
click on any news channel’s logo to visit the webpage of that channel.

 Web Page:

When we click on any logo it will navigate to web page of the news channel where we can read the updated
or live news on that particular channel.

The webpage will show after click the logo of channel, it will show all latest highlights and overall news.

CHAPTER: 15

FUTURE SCOPE
59
 Cross-Platform Development: Flutter allows developers to build applications for multiple platforms
(iOS, Android, web, desktop, and potentially more) using a single codebase. This cross-platform
capability reduces development time and costs while reaching a wider audience.
 Fast Development and Hot Reload: Flutter's hot reload feature enables developers to see the
changes they make in real-time, which speeds up the development process. This is crucial for news
applications that need to respond quickly to breaking news and user feedback.
 Beautiful and Customizable UI: Flutter offers a rich set of pre-designed widgets and allows for
high customization, enabling developers to create visually appealing and unique news app interfaces
that can stand out in a crowded market.

Flutter has cross-platform and hot reload feature which enables the developers to see changes in real-time,
news application can be run on multi-platforms.

In future, we can add multiple languages or channels according to the requirements of the users.

60
CHAPTER: 16

CONCLUSION

Creating a news application in Flutter can be rewarding project, offering a platform deliver up-to-date news
content to users in an engaging and efficient manner. Flutter provides a rich set of widgets and tools to
design an attractive user interface.

Creating a news application provides the latest news to the users with different languages. User can select
the language according to their choice. It provides the information or latest news from different channels.

61
REFRENCES

 https://www.javatpoint.com/flutter
 https://docs.flutter.dev/resources/architectural-overview
 https://www.codingninjas.com/studio/library/flutter-architecture
 https://invedus.com/blog/white-box-testing/
 https://www.kindacode.com/article/flutter-system-requirements-on-windows-and-macos/

62

You might also like