mirror of
https://github.com/rjNemo/bmi_calculator_app
synced 2026-06-06 02:16:41 +00:00
format date
This commit is contained in:
parent
8c90fdc85e
commit
ab6ea575d7
3 changed files with 12 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import 'profile.dart';
|
||||
|
|
@ -30,7 +31,9 @@ class _CalculatorPageState extends State<CalculatorPage> {
|
|||
(1.2 * bodyMassIndex() + .23 * _age - 10.8 * _gender - 5.4).round();
|
||||
|
||||
Future<void> _saveResults() async {
|
||||
var now = DateTime.now().toString();
|
||||
var dateFormatter = DateFormat("dd/MM/yyyy");
|
||||
var now = dateFormatter.format(DateTime.now());
|
||||
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.setStringList(
|
||||
now,
|
||||
|
|
|
|||
|
|
@ -86,6 +86,13 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.17.0"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ dependencies:
|
|||
sdk: flutter
|
||||
|
||||
shared_preferences: 2.0.6
|
||||
intl: ^0.17.0
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
|
|
|||
Loading…
Reference in a new issue