[go: up one dir, main page]

0% found this document useful (0 votes)
2 views15 pages

Everionce

DigitalLife Toolbox is a mobile application that enhances productivity through various tools including a standard calculator, GST calculator, todo list, notes feature, and scientific calculator. The app is designed with a user-friendly interface to streamline daily tasks and promote organization. It serves as an all-in-one solution for users looking to digitize their everyday routines.

Uploaded by

Yuvraj Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views15 pages

Everionce

DigitalLife Toolbox is a mobile application that enhances productivity through various tools including a standard calculator, GST calculator, todo list, notes feature, and scientific calculator. The app is designed with a user-friendly interface to streamline daily tasks and promote organization. It serves as an all-in-one solution for users looking to digitize their everyday routines.

Uploaded by

Yuvraj Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Description:

DigitalLife Toolbox is a versatile mobile application developed using Flutter and


Dart that promotes digitalization in everyday life. It offers a range of useful
tools designed to enhance productivity and convenience. With its sleek and
intuitive interface, DigitalLife Toolbox aims to streamline daily tasks and provide
essential utilities for users. The app incorporates the following features:

1. Calculator: A standard calculator that allows users to perform basic arithmetic


operations, such as addition, subtraction, multiplication, and division. It
provides a simple and efficient way to perform calculations on the go.

2. GST Calculator: A specialized calculator designed to calculate Goods and


Services Tax (GST) for various countries. Users can input the pre-GST amount and
select the applicable GST rate to obtain the final amount, including the tax.

3. Todo List: An interactive task management tool that helps users stay organized
and focused. Users can create, edit, and prioritize tasks, set due dates, and mark
completed tasks. The Todo List feature ensures that users can manage their daily
activities effectively.

4. Notes: A digital note-taking feature that allows users to jot down important
information and ideas. It provides a simple yet powerful writing platform where
users can create, edit, and organize their notes effortlessly. The app supports
rich text formatting and enables users to attach images for enhanced productivity.

5. Scientific Calculator: A comprehensive scientific calculator that includes


advanced mathematical functions, such as trigonometric, logarithmic, and
exponential calculations. It is designed to cater to the needs of students,
professionals, and enthusiasts who require complex mathematical calculations.

DigitalLife Toolbox serves as an all-in-one solution for users seeking to digitize


their daily routines. By offering a collection of essential tools within a single
application, it aims to simplify tasks, improve efficiency, and promote a more
organized and productive lifestyle.

Code:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:math_expressions/math_expressions.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:timezone/timezone.dart' as tz;
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';

void main() {
runApp(CalculatorApp());
}

class NotesApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Notes App',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}

class CalculatorApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Calculator App',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}

class HomePage extends StatefulWidget {


@override
_HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin {


late AnimationController _animationController;
late Animation<double> _opacityAnimation;
late Animation<double> _scaleAnimation;

@override
void initState() {
super.initState();
_animationController = AnimationController(
vsync: this,
duration: Duration(seconds: 2),
);

_opacityAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(


CurvedAnimation(parent: _animationController, curve: Curves.easeInOut),
);

_scaleAnimation = Tween<double>(begin: 0.5, end: 1.0).animate(


CurvedAnimation(parent: _animationController, curve: Curves.easeInOut),
);

_animationController.forward();
}

@override
void dispose() {
_animationController.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Home'),
),
body: SingleChildScrollView(
child: Column(
children: [
AnimatedBuilder(
animation: _animationController,
builder: (context, child) {
return Container(
color: Colors.cyan[300],
child: Center(
child: Opacity(
opacity: _opacityAnimation.value,
child: Transform.scale(
scale: _scaleAnimation.value,
child: Text(
'Welcome to EVERIONCE',
style: TextStyle(
fontSize: 45,
color: Colors.white,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
),
),
),
);
},
),
_buildFeatureCard(
'Calculator',
'Perform basic and scientific calculations',
() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CalculatorScreen(),
),
);
},
),
_buildFeatureCard(
'GST Calculator',
'Calculate GST for your transactions',
() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GstCalculator(),
),
);
},
),
_buildFeatureCard(
'Scientific Calculator',
'Perform advanced scientific calculations',
() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ScientificCalculator(),
),
);
},
),
_buildFeatureCard(
'To-Do List',
'Keep track of your tasks and schedule',
() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TodoListScreen(),
),
);
},
),
_buildFeatureCard(
'Notes',
'Take and manage your notes easily',
() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NotesScreen(),
),
);
},
),
],
),
),
drawer: _buildDrawer(),
);
}

Widget _buildFeatureCard(String title, String description, VoidCallback onTap) {


return Card(
margin: EdgeInsets.all(16),
child: ListTile(
title: Text(title),
subtitle: Text(description),
onTap: onTap,
),
);
}

Widget _buildDrawer() {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
DrawerHeader(
decoration: BoxDecoration(
color: Colors.blue,
),
child: Text(
'Menu',
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
),
_buildDrawerItem('Home', () {
Navigator.pop(context);
}),
_buildDrawerItem('Calculator', () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CalculatorScreen(),
),
);
}),
_buildDrawerItem('GST Calculator', () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GstCalculator(),
),
);
}),
_buildDrawerItem('Scientific Calculator', () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ScientificCalculator(),
),
);
}),
_buildDrawerItem('To-Do List', () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TodoListScreen(),
),
);
}),
_buildDrawerItem('Notes', () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NotesScreen(),
),
);
}),
],
),
);
}

Widget _buildDrawerItem(String title, VoidCallback onTap) {


return ListTile(
title: Text(title),
onTap: onTap,
);
}
}

class TodoListScreen extends StatefulWidget {


@override
_TodoListScreenState createState() => _TodoListScreenState();
}

class _TodoListScreenState extends State<TodoListScreen> {


List<Task> tasks = [];
DateTime? selectedDateTime;

void _showAddTaskDialog() {
showDialog(
context: context,
builder: (context) {
TextEditingController taskController = TextEditingController();

return AlertDialog(
title: Text('Add Task'),
content: Column(
children: [
TextField(
controller: taskController,
decoration: InputDecoration(hintText: 'Enter task'),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
DateTime? selectedDate = await _selectDate(context);
if (selectedDate != null) {
TimeOfDay? selectedTime = await _selectTime(context);
if (selectedTime != null) {
selectedDateTime = DateTime(
selectedDate.year,
selectedDate.month,
selectedDate.day,
selectedTime.hour,
selectedTime.minute,
);
}
}
},
child: Text('Select Date and Time'),
),
],
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text('Cancel'),
),
TextButton(
onPressed: () {
setState(() {
tasks.add(Task(
taskName: taskController.text,
creationDate: DateTime.now(),
selectedDateTime: selectedDateTime,
));
});
Navigator.pop(context);
},
child: Text('Add'),
),
],
);
},
);
}

Future<DateTime?> _selectDate(BuildContext context) async {


return showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime.now(),
lastDate: DateTime.now().add(Duration(days: 365)),
);
}

Future<TimeOfDay?> _selectTime(BuildContext context) async {


return showTimePicker(
context: context,
initialTime: TimeOfDay.now(),
);
}
void _deleteTask(int index) {
setState(() {
tasks.removeAt(index);
});
}

void _markComplete(int index) {


setState(() {
tasks[index].isComplete = true;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Todo List'),
),
body: Container(
decoration: BoxDecoration(
color: Colors.blueGrey[50], // Light blue-grey background color
),
child: ListView.builder(
itemCount: tasks.length,
itemBuilder: (context, index) {
final task = tasks[index];
return Dismissible(
key: Key(task.creationDate.toString()),
onDismissed: (direction) {
_deleteTask(index);
},
background: Container(
color: Colors.red,
child: Icon(Icons.delete, color: Colors.white),
),
secondaryBackground: Container(
color: Colors.green,
child: Icon(Icons.check, color: Colors.white),
),
child: ListTile(
title: Text(
task.taskName,
style: TextStyle(
decoration: task.isComplete
? TextDecoration.lineThrough
: TextDecoration.none,
),
),
subtitle: task.selectedDateTime != null
? Text(
'Scheduled: $
{DateFormat.yMd().add_jm().format(task.selectedDateTime!)}')
: null,
trailing: task.isComplete
? Icon(
Icons.check,
color: Colors.green,
)
: null,
onTap: () {
_markComplete(index);
},
),
);
},
),
),
floatingActionButton: FloatingActionButton(
onPressed: _showAddTaskDialog,
child: Icon(Icons.add),
),
);
}
}

class Task {
final String taskName;
bool isComplete;
DateTime creationDate;
DateTime? selectedDateTime;

Task({
required this.taskName,
this.isComplete = false,
required this.creationDate,
this.selectedDateTime,
});
}

class CalculatorScreen extends StatefulWidget {


@override
_CalculatorScreenState createState() => _CalculatorScreenState();
}

class _CalculatorScreenState extends State<CalculatorScreen> {


String _expression = '';
String _result = '';

final List<String> _buttonTexts = [


'7',
'8',
'9',
'/',
'4',
'5',
'6',
'*',
'1',
'2',
'3',
'-',
'C',
'0',
'=',
'+',
];

void _calculateResult() {
try {
Parser p = Parser();
Expression exp = p.parse(_expression);
ContextModel cm = ContextModel();
double eval = exp.evaluate(EvaluationType.REAL, cm);
setState(() {
_result = eval.toString();
});
} catch (e) {
setState(() {
_result = 'Error';
});
}
}

void _clearInput() {
setState(() {
_expression = '';
_result = '';
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Calculator'),
),
body: Container(
padding: EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
border: Border.all(),
),
child: SingleChildScrollView(
child: Text(
_expression,
style: TextStyle(fontSize: 24),
),
),
),
),
SizedBox(height: 16),
Text(
_result,
style: TextStyle(fontSize: 36, fontWeight: FontWeight.bold),
),
SizedBox(height: 16),
GridView.builder(
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
crossAxisSpacing: 8,
mainAxisSpacing: 8,
),
itemCount: _buttonTexts.length,
itemBuilder: (context, index) {
return TextButton(
onPressed: () {
if (_buttonTexts[index] == '=') {
_calculateResult();
} else if (_buttonTexts[index] == 'C') {
_clearInput();
} else {
setState(() {
_expression += _buttonTexts[index];
});
}
},
child: Text(
_buttonTexts[index],
style: TextStyle(fontSize: 20),
),
);
},
),
],
),
),
);
}
}

class GstCalculator extends StatelessWidget {


TextEditingController _amountController = TextEditingController();

TextEditingController _gstRateController = TextEditingController();

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('GST Calculator'),
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextField(
controller: _amountController,
keyboardType: TextInputType.number,
decoration: InputDecoration(labelText: 'Amount'),
),
SizedBox(height: 16),
TextField(
controller: _gstRateController,
keyboardType: TextInputType.number,
decoration: InputDecoration(labelText: 'GST Rate (%)'),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () {
double amount = double.tryParse(_amountController.text) ?? 0.0;
double gstRate = double.tryParse(_gstRateController.text) ?? 0.0;
double gstAmount = (amount * gstRate) / 100;
double totalAmount = amount + gstAmount;

showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text('GST Calculation Result'),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text('Original Amount: $amount'),
Text('GST Amount: $gstAmount'),
Text('Total Amount: $totalAmount'),
],
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text('OK'),
),
],
);
},
);
},
child: Text('Calculate GST'),
),
],
),
),
);
}
}

class ScientificCalculator extends StatefulWidget {


@override
_ScientificCalculatorState createState() => _ScientificCalculatorState();
}

class _ScientificCalculatorState extends State<ScientificCalculator> {


String _input = '';

void _onButtonPressed(String value) {


setState(() {
if (value == '=') {
_calculateResult();
} else if (value == 'C') {
_clearInput();
} else {
_input += value;
}
});
}

void _calculateResult() {
double result = eval(_input);
setState(() {
_input = result.toString();
});
}

void _clearInput() {
setState(() {
_input = '';
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Scientific Calculator'),
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
),
body: Column(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(16.0),
alignment: Alignment.bottomRight,
child: Text(
_input,
style: TextStyle(
fontSize: 32.0,
fontWeight: FontWeight.bold,
),
),
),
),
Divider(),
Expanded(
flex: 2,
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 5,
),
itemBuilder: (context, index) {
final buttonText = _buttonTexts[index];
return TextButton(
onPressed: () => _onButtonPressed(buttonText),
child: Text(
buttonText,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
);
},
itemCount: _buttonTexts.length,
),
),
],
),
);
}

final List<String> _buttonTexts = [


'7',
'8',
'9',
'/',
'C',
'4',
'5',
'6',
'*',
'sqrt',
'1',
'2',
'3',
'-',
'log',
'0',
'=',
'+',
'sin',
'cos',
'tan',
];

double eval(String expression) {


try {
Parser p = Parser();
ContextModel cm = ContextModel();
Expression exp = p.parse(expression);
return exp.evaluate(EvaluationType.REAL, cm);
} catch (e) {
print(e);
return 0.0;
}
}
}
class NotesScreen extends StatefulWidget {
@override
_NotesScreenState createState() => _NotesScreenState();
}

class _NotesScreenState extends State<NotesScreen> {


List<String> notes = [];

void _addNote() {
showDialog(
context: context,
builder: (context) {
TextEditingController noteController = TextEditingController();

return AlertDialog(
title: Text('Add Note'),
content: TextField(
controller: noteController,
decoration: InputDecoration(hintText: 'Enter note'),
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text('Cancel'),
),
TextButton(
onPressed: () {
setState(() {
notes.add(noteController.text);
});
Navigator.pop(context);
},
child: Text('Add'),
),
],
);
},
);
}

void _deleteNote(int index) {


setState(() {
notes.removeAt(index);
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Notes'),
),
body: ListView.builder(
itemCount: notes.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(notes[index]),
trailing: IconButton(
icon: Icon(Icons.delete),
onPressed: () {
_deleteNote(index);
},
),
);
},
),
floatingActionButton: FloatingActionButton(
onPressed: _addNote,
child: Icon(Icons.add),
),
);
}
}

You might also like