Screen 3 :
(Dash.dart)
Screen Description:
Code:-
import ‘package:firebase_auth/firebase_auth.dart’;
import ‘package:flutter/material.dart’;
import ‘package:footer/footer.dart’;
import ‘package:footer/footer_view.dart’;
import ‘package:tis_root01/Screens/add_member.dart’;
import ‘package:tis_root01/broadcast.dart’;
import ‘package:tis_root01/common/CommonFooter.dart’;
import ‘package:tis_root01/common/CommonHeader.dart’;
import ‘package:tis_root01/rec.dart’;
import ‘package:tis_root01/view_member.dart’;
class Dash extends StatefulWidget {
final User? user; // Add this line
const Dash({Key? key, this.user}) : super(key: key);
@override
_DashState createState() => _DashState();
}
class _DashState extends State<Dash> {
Widget build(BuildContext context) {
return Scaffold(
// App bar with a preferred size
appBar: PreferredSize(
preferredSize: const Size.fromHeight(80.0),
child: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: <Color>[Colors.blue, Color.fromRGBO(233, 30, 99, 1)],
),
),
child: const CommonHeader(),
),
),
// Body of the screen
body: FooterView(
children: <Widget>[
// Centered column of buttons
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// “BROADCAST” Button
ElevatedButton(
onPressed: () {
// Navigate to the “Broadcast” screen
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Broadcast()),
);
},
child: Text(‘ BROADCAST ‘),
),
SizedBox(height: 20, width: 25), // Add spacing
// “ADD MEMBER” Button
Center(
child: ElevatedButton(
onPressed: () {
// Navigate to the “Add Member” screen
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Add()),
);
},
child: Text(‘ ADD MEMBER ‘),
),
),
SizedBox(height: 20, width: 25), // Add spacing
// “VIEW MEMBER” Button
Center(
child: ElevatedButton(
onPressed: () {
// Navigate to the “View Member” screen
Navigator.push(
context,
MaterialPageRoute(builder: (context) => view_mem()),
);
},
child: Text(‘VIEW MEMBER’),
),
),
SizedBox(height: 20, width: 25), // Add spacing
// “NANMANAM” Button (Not implemented)
Center(
child: ElevatedButton(
onPressed: () {
// Implement logic for another screen navigation here
},
child: Text(‘ NANMANAM ‘),
),
),
],
),
),
],
// Footer section
footer: new Footer(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
// Application information
Text(
‘TISROOT,’,
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
fontSize: 5,
),
),
SizedBox(height: 1), // Add spacing
Text(
‘a cloud ERP “MAKEININDIA” software of Trust Infosys Incorporation,’,
style: TextStyle(
fontSize: 10,
),
),
Text(
‘Govt. of India accredited STARTUPINDIA venture.’,
style: TextStyle(
fontSize: 10,
),
),
],
),
),
flex: 1,
),
);
}
}
Code Description :
The dash.dart file represents the dashboard screen of a Flutter application. This screen provides various options for users to navigate to different parts of the application.These import statements include the necessary Flutter libraries and custom widget imports.firebase_auth is imported for Firebase Authentication, and various screens and common components are imported for navigation.
- The Dash class is a StatefulWidget representing the dashboard screen.
- It accepts a User? object (from Firebase Authentication) as a parameter. This allows the dashboard to display user-specific information, although the code does not utilize this parameter.
- The _DashState class represents the state of the dashboard screen.
It includes the following components:
- App Bar: The app bar at the top of the screen is customized with a gradient background and includes a common header widget.
- Body: The body of the screen contains a centered column of buttons. These buttons allow users to navigate to different sections of the application.
- “BROADCAST” Button: When pressed, it navigates to the “Broadcast” screen (Broadcast widget).
- “ADD MEMBER” Button: When pressed, it navigates to the “Add Member” screen (Add widget).
- “VIEW MEMBER” Button: When pressed, it navigates to the “View Member” screen (view_mem widget).
- “NANMANAM” Button: This button is a placeholder and does not have navigation logic implemented.
- Footer Section: The footer section provides information about the application, including its version and its status as a recognized startup in India.
Audit :