Name: Zukhriddin Fakhriddinov
Group: JSE 02
ID: 2110053
-
Clone the Repository:
git clone <repository_url> cd <repository_directory>
-
Install Dependencies:
flutter pub get
-
Run the Application:
flutter run
-
main.dart
:- Entry point of the application.
- Sets up the main
MyApp
widget. - Initializes the
ChangeNotifierProvider
for managing state using theDataModel
.
-
DataModel.dart
:- Manages the state for the application using the
ChangeNotifier
pattern. - Provides a
message
variable and a method (setMessage
) to update it, triggering a UI update.
- Manages the state for the application using the
-
LoginPage.dart
:- Represents the login page.
- Uses a
TextField
for the name, aDropdownButtonFormField
for selecting a country, and anElevatedButton
for login. - Navigates to the home page on login button press.
-
HomePage.dart
:- Displays the News Home Page with a list of news articles.
- Uses the
ListView
to display threeCard
widgets, each representing a news article. - Each card has an image, a title, and a "Read More" button.
- Navigates to the respective news page on the "Read More" button press.
-
NewsPage.dart
:- Represents a single news article page.
- Displays the title, image, and content of the news article.
- Provides a button to navigate back to the Home Page.
- Sends a message back to the Home Page using
Navigator.pop()
.
-
Images:
- The
lib/images
directory contains images used in the news articles.
- The
-
pubspec.yaml
:- Specifies the dependencies for the project, including
flutter
andprovider
.
- Specifies the dependencies for the project, including
-
MultiProvider
:- In
main.dart
, theMultiProvider
widget is used to manage multiple providers, mainly theDataModel
provider.
- In
-
Routing:
- The
routes
property inMaterialApp
is used to define different routes for each page/screen in the application.
- The
-
Navigation:
Navigator.pushNamed
is used for navigating to different screens.Navigator.pop
is used to navigate back and pass data.
-
UI Elements:
- Various Flutter UI elements such as
Scaffold
,AppBar
,Column
,TextField
,DropdownButtonFormField
,ElevatedButton
,Card
,Image
, andText
are used to build the user interface.
- Various Flutter UI elements such as