(PRAC-5)Designing the mobile app to implement the theming and styling.

import 'package:flutter/material.dart';


void main() {

  runApp(

    MaterialApp(

      debugShowCheckedModeBanner: false,

      title: "Practical 5",

      theme: ThemeData(

        primaryColor: Colors.deepPurple,

        primarySwatch: Colors.purple,

        fontFamily: 'Times New Roman',

        textTheme: TextTheme(

          titleLarge: TextStyle(

            fontSize: 50,

            fontWeight: FontWeight.bold,

            color: Colors.cyan,

          ),

          bodyMedium: TextStyle(

            fontSize: 20,

            fontFamily: 'Arial',

          ),

        ),

      ),

      home: HomePage(),

    ),

  );

}


class HomePage extends StatelessWidget {

  @override

  Widget build(BuildContext context) {

    return Scaffold(

      appBar: AppBar(

        title: Text('Home Page'),

      ),

      body: Center(

        child: Column(

          mainAxisSize: MainAxisSize.min,

          children: [

            Text('425_Devesh'),

            Text(

              'HeadLine',

              style: Theme.of(context).textTheme.titleLarge,

            ),

            SizedBox(height: 20),

            Text('SubTitle', style: Theme.of(context).textTheme.bodyLarge),

            SizedBox(height: 20),

            Container(

              color: Theme.of(context).primaryColor,

              height: 50,

              width: 50,

            ),

            SizedBox(height: 20),

            ElevatedButton(

              onPressed: () {

                Navigator.push(

                  context,

                  MaterialPageRoute(

                    builder: (context) => SecondPage(),

                  ),

                );

              },

              child: Text('Next Page'),

            ),

          ],

        ),

      ),

    );

  }

}


class SecondPage extends StatelessWidget {

  @override

  Widget build(BuildContext context) {

    return Scaffold(

      appBar: AppBar(

        title: Text('Second Page'),

      ),

      body: Center(

        child: ElevatedButton(

          onPressed: () {

            Navigator.pop(context);

          },

          child: Text('Home Page'),

        ),

      ),

    );

  }

}

Comments

Popular posts from this blog

python(BI)

(PP-7)Create a class called Numbers, which has a single class attribute called MULTIPLIER, and a constructor which takes the parameters x and y (these should all be numbers). i. Write a method called add which returns the sum of the attributes x and y. ii. Write a class method called multiply, which takes a single number parameter a and returns the product of a and MULTIPLIER. iii. Write a static method called subtract, which takes two number parameters, b and c, and returns b - c. iv. Write a method called value which returns a tuple containing the values of x and y. Make this method into a property, and write a setter and a deleter for manipulating the values of x and y.