Giter Site home page Giter Site logo

nsm722 / expense_tracker Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 330 KB

A mobile flutter application

License: MIT License

Kotlin 0.19% Swift 2.49% Objective-C 0.05% Dart 32.65% CMake 27.04% C++ 32.84% C 2.05% HTML 2.67%
flutter-widgets form-validation texteditingcontroller widget-tree alert-dialogs bottom-sheet-behavior bottom-sheet-modal snackbar-notification mobile-application-development orientation-lock

expense_tracker's Introduction

Expense Tracker

Run flutter run on the terminal to view the application in web mode or connect to a Mobile device and click Run within your IDE

This app tracks day to day expenses and displays the output on a bar chart Expense_tracker

expense_tracker_modal

Features

  • Home screen that displays all the expenses as a scrollable list
  • A bar chart to track and show which categories have the highest or lowest expenses
  • The expenses on the home screen are dismissable when slid to either the right or left side
  • Snackbar displayed at the bottom of the screen to confirm an expense has been deleted, the same Snackbar offers the option to undo this action
  • Action Button on top right of the the app bar to add a new expense
  • A Bottom sheet modal that contains a form to fill out all the new expense details
  • An alert dialog to communicate any invalid inputs to the user before submitting the form
  • User is navigated to the home screen upon submitting the form or cancelling action

Packages

Installation

flutter pub add uuid
import 'package:uuid/uuid.dart';

const uuid = Uuid();

class Expense {
  // constructor function with named parameters
  Expense({required this.title, required this.amount, required this.date})
      : id = uuid.v4(); // initializer list generating unique ids
  final String id;
  final String title;
  final double amount;
  final DateTime date;
}
flutter pub add intl

Refactoring of the modal bottom sheet

The following class shows a simple example of a TextField Widget

To add a visible label, one needs to add the decoration parameter which has the InputDecoration() widget that gives way to the label attribute

import 'package:flutter/material.dart';

class NewExpense extends StatefulWidget {
  const NewExpense({super.key});

  @override
  State<NewExpense> createState() => _NewExpenseState();
}

class _NewExpenseState extends State<NewExpense> {
  @override
  Widget build(BuildContext context) {
    return const Padding(
      padding: EdgeInsets.all(16),
      child: Column(
        children: [
          TextField(
            maxLength: 60, // max length of characters to type
            decoration: InputDecoration(
              label: Text('Expense Title'),
            ),
          ),
        ],
      ),
    );
  }
}

Flutter Trees

Widget Tree - Combination of widgets

Element Tree - In-memory representation of widgets, used for determining necessary UI updates

Render Tree - The visible UI building blocks

flutter_trees

Testing

Type the following command to run all integration tests

flutter test integration_test

To test on a real iOS / Android device, first, connect the device and run the following command from the root of the project

flutter test integration_test/app_test.dart

expense_tracker's People

Contributors

nsm722 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.