Posts

Showing posts from September, 2025

EXPERIMENT-10

 10a) Write unit tests for UI components Unit tests in UI components are automated tests that verify the smallest parts of the user interface—like individual widgets or components—work correctly in isolation. What are unit tests in UI components? Unit tests focus on testing one small piece of UI code at a time (e.g., a button, text label, or custom widget). They check that the UI component: Displays the right content (like correct text or images). Responds properly to user interactions (like taps or clicks). Changes appearance or behavior as expected when given different inputs or states. Unit tests do not involve testing the entire app or complex user flows; they focus on one component’s logic and rendering. Why are unit tests for UI components important? They help catch bugs early in development. Ensure UI behaves as intended with different data or user actions. Make it safer to refactor or improve code because you can quickly detect if something breaks. Improve code quality...

EXPERIMENT-9

Image
 9a) Fetch data from a REST API. We have a lot of ways to show data in our app: Static Data From a file And another form is from a database or public APIs. The most popularly used form is from Database or Public APIs. An API (Application Programming Interface) is a set of rules and protocols that allows different software applications to communicate and interact with each other.  In simpler terms, an API is like a menu in a restaurant: it tells you what you can order (available functions), how to order it (the request format), and what you will get back (the response). This allows developers to use functionalities of other software or services without needing to understand their internal workings. REST API enables communication between client and server over HTTP by exposing resources via URLs and allowing operations on these resources using standard HTTP methods. It is widely used for building web services and mobile app backends. How do APIs Work? A user application can c...

EXPERIMENT-8

  8a)   Add animations to UI elements using Flutter's animation framework. import 'package:flutter/material.dart'; void main() {   runApp(MyApp()); } class MyApp extends StatelessWidget {   @override   Widget build(BuildContext context) => MaterialApp(home: AnimatedHome()); } class AnimatedHome extends StatefulWidget {   @override   _AnimatedHomeState createState() => _AnimatedHomeState(); } class _AnimatedHomeState extends State<AnimatedHome> with TickerProviderStateMixin {   double position = 0;   late final AnimationController _colorController;   late final Animation<Color?> _colorAnimation;   late final AnimationController _rotationController;   late final Animation<double> _rotationAnimation;   @override   void initState() {     super.initState();     _colorController = AnimationController(vsync: this, duration: Duration(seconds: 3))..repeat(reverse: true); ...

OUTPUTS OF ALL EXPERIMENTS

Image
                                                  2A)                                                    2B)                                                     3A)                                                       3B) 4A) 4B) 5A) 5B) 6A) 6B) 7A) 7B) 8A) 8B) 9A) 9B) 10A) 10B)