Code Monkey home page Code Monkey logo

flutter-steps-tracker's Introduction

Hi there ๐Ÿ‘‹

I'm a software engineer team leader at Mega Trust, Google Developer Expert (GDE) for Flutter & Dart, and Subject-Matter Expert at Variiance.

  • ๐Ÿ”ญ Iโ€™m currently working on improving my skills as a software engineer.

  • ๐ŸŒฑ Iโ€™m currently curious about mobile and backend development.

  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on open source projects.

  • ๐Ÿ’ฌ Ask me about Flutter, Dart, Firebase, C++, Python.

  • ๐Ÿ“ซ How to reach me:

    "Follow me on Twitter" "LinkedIn" "YouTube" "Medium" "My Website" "My Blog"

Some Projects

Github Stats

Tarek's Github Stats

Want to support?

Do you find my work to be of a value for you? You can support me, buy me a Book, or a Coffee.

"Buy Me A Coffee"

flutter-steps-tracker's People

Contributors

tarekalabd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter-steps-tracker's Issues

How to Contribute

Hi.๐Ÿ–๐Ÿฟ
As it is an open source repo, I suggest writing some rules/tips of how to contribute.

Daily steps

Hi @TarekAlabd,

To get the daily steps, I think it is better to get the new steps only, and accumulate them on the steps today, this method allows not to depend on the phone date and leave the date assignment for the back end service. Or use any local storage service to accumulate depending on the device date.

Code snippet from my repo:

class PedometerService {
  PedometerService();

  // pedometer package returns the steps taken since last system boot.
  // so we use this var for get only new steps
  int _lastCount = 0;

  // call it before start listening to newSteps
  Future<void> init() async {
    _lastCount =
        await Pedometer.stepCountStream.first.then((value) => value.steps);
  }

  Stream<int> get newSteps {
    return Pedometer.stepCountStream.map(
      (event) {
        final newSteps = event.steps - _lastCount;
        _lastCount = event.steps;
        return newSteps;
      },
    ).where(
      (e) => e != 0,
    );
  }
}

I hope this helps you.

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.