Posts

Showing posts from August, 2025

EXPERIMENT-7

 7a)Design a form with various input fields. import 'package:flutter/material.dart'; void main() {   runApp(MyApp()); } class MyApp extends StatelessWidget {   @override   Widget build(BuildContext context) {     return MaterialApp(       title: 'User Form',       home: Scaffold(         appBar: AppBar(           title: Text('User Input Form'),         ),         body: SingleChildScrollView(           padding: EdgeInsets.all(16.0),           child: UserForm(),         ),       ),     );   } } class UserForm extends StatefulWidget {   @override   State<UserForm> createState() => _UserFormState(); } class _UserFormState extends State<UserForm> {   String? _name;   String? _email;   String? _phoneNumber; ...

EXPERIMENT-6

  6. a) Create custom widgets for specific UI elements. Custom widgets play a vital role in Flutter code optimization. They allow you to create reusable components that can be used throughout your codebase. This can help to reduce the amount of code that you need to write and maintain. Overall, custom widgets in Flutter empower developers to create highly customized and efficient user interfaces. They are an essential tool for building complex and feature-rich mobile applications while maintaining code modularity and reusability.   import 'package:flutter/material.dart'; void main() {   runApp(MyApp()); }   class MyApp extends StatelessWidget {   @override   Widget build(BuildContext context) {     return MaterialApp(       home: Scaffold(         appBar: AppBar(           title: Text('Custom Animated Container'...

EXPERIMENT-5

Image
  Stateless widgets don’t change once built. Stateful widgets can change — they have some state (data) which can change over time, such as a counter, user input, or animations. 1. initState() It is called exactly once when the state object is first created. It’s used to initialize data, set up listeners, or perform any setup work before the widget is displayed. 2. setState() setState() is a method you call when you want to update the UI because some state data has changed. It tells Flutter: "Hey, something changed in this widget’s state, please rebuild the UI!" It triggers the build() method to run again with the updated state. 5.a) Learn about stateful and stateless widgets. import 'package:flutter/material.dart'; void main() {   runApp(MyApp()); } class MyApp extends StatelessWidget {   @override   Widget build(BuildContext context) {     return MaterialApp(       home: Scaffold(         appBar: AppBar(title: Text('State...

EXPERIMENT-1

Image
  1.   a) Install Flutter and Dart SDK.   Dart SDK Installation: Step 1: Download Dart SDK. Download     Dart     SDK     from      the      Dart      SDK      archive      page.      The      URL is: https://dart.dev/tools/sdk/archive Click on DART SDK to download SDK for Windows 64-Bit Architecture. The download will start and a zip file will be downloaded. Step 2: Extract the downloaded zip file Step 3: Running Dart. Now open bin folder and type “cmd” as given below: Command Prompt will open with our desired path of bin folder and now type dart”. Step 4: Run Dart Using cmd Flutter SDK Installation: STEP 1: Open Flutter Docs website and select web platform https://docs.flutter.dev/get-started/install/windows STEP 2: Download and install the Windows version of the following p...