Posts

Designing the mobile app to implement the state management.

  import 'package:flutter/material.dart';   void main() {   runApp(MaterialApp(   home: HomeScreen(), )) ; }     class HomeScreen extends StatefulWidget {   const HomeScreen({Key? key}) : super(key: key);   @override   State<HomeScreen> createState() => _HomeScreenState();   }   class _HomeScreenState extends State<HomeScreen> {   TextEditingController nameController = TextEditingController();   TextEditingController idController = TextEditingController();   String genderValue = "";   bool hobby1 = false;   bool hobby2 = false;   bool hobby3 = false;   String strhobby1 = "";   String strhobby2 = "";   String strhobby3 = "";   final formKey = GlobalKey<FormState>();   @override   Widget build(BuildContext context) {   return Scaffold(   appBar: AppBar(   title: Text("User Info"), ) ,   body: Form( ...

Designing the mobile app to implement the theming and styling

    import 'package:flutter/material.dart';   void main() {   runApp(MaterialApp(   home: MyApp(), )) ; }     class MyApp extends StatelessWidget {   const MyApp({Key? key}) : super(key: key);   @override   Widget build(BuildContext context) {   return Scaffold(   appBar: AppBar(   title: Text("Theming And Styling"),   ),   body: Center(   child: Column(   mainAxisAlignment: MainAxisAlignment.spaceEvenly,   children: [   Image.network(   'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRY2N49iCud8Pq84Asp4tK2tBeq   dSFAUcCJPg&s',   height: 500,   width: 500,   ),   ],   ),   ),   );   }   }

Designing the mobile app to implement Gestures

  import 'package:flutter/material.dart';  void main() {  runApp(MaterialApp(home: MyApp())); }   class MyApp extends StatefulWidget {  const MyApp({Key? key}) : super(key: key);  @override  _MyAppState createState() => _MyAppState(); }   class _MyAppState extends State<MyApp> {  int numberOfTimesTapped = 0;  @override  Widget build(BuildContext context) {  return Scaffold(  body: Center(  child: Column(  mainAxisAlignment: MainAxisAlignment.spaceEvenly,  children: [  Text(  'Tapped ' + numberOfTimesTapped.toString() + ' times ',  style: TextStyle(fontSize: 30),  ),  GestureDetector(  onTap: () {  setState(() {  numberOfTimesTapped++;  });  },  child: Container(  padding: EdgeInsets.all(20),  color: Colors.green[200],  child: Text(  'TAP HERE',  style: TextStyle(f...

Designing the mobile app to implement different Layouts

  import 'package:flutter/material.dart';  void main() {  runApp(Demoapp()); }   class Demoapp extends StatelessWidget {  @override  Widget build(BuildContext context) {  return MaterialApp(  title: 'My Application',  debugShowCheckedModeBanner: true,  home: Scaffold(  body: Padding(  padding: const EdgeInsets.all(20.0),  child: Column(  mainAxisAlignment: MainAxisAlignment.center,  children: [  Row(  mainAxisAlignment: MainAxisAlignment.spaceEvenly,  children: [  Container(  height: 100,  width: 100,  color: Colors.red,  ),  Container(  height: 100, width: 100, color: Colors.red[600]),  Container(  height: 100, width: 100, color: Colors.red[900]),  ],  ),  Row(  mainAxisAlignment: MainAxisAlignment.spaceEvenly,  children: [  Container(  height: 100,  width: 100,  col...

Designing the mobile app to implement different widgets

    import 'package:flutter/material.dart'; // Corrected 'marterial' to 'material'   void main() {   runApp(MaterialApp(   debugShowCheckedModeBanner: false,   home: MyApp(), )) ; }     class MyApp extends StatefulWidget {   const MyApp({Key? key}) : super(key: key); // Corrected 'key?' to 'Key?'   @override   _MyAppState createState() => _MyAppState();   }   class _MyAppState extends State<MyApp> {   TextEditingController controller1 = TextEditingController();   TextEditingController controller2 = TextEditingController();   int? num1 = 0, num2 = 0, result = 0;   void add() {   // Added 'void' return type for methods   setState(() {   num1 = int.parse(controller1.text);   num2 = int.parse(controller2.text);   result = num1! + num2!;   });   }   void sub() {   setState(() {   num1 = int.parse(controller1.te...