jit_flutter_app_helper 0.0.14 copy "jit_flutter_app_helper: ^0.0.14" to clipboard
jit_flutter_app_helper: ^0.0.14 copied to clipboard

Converts `DateTime` to all possible String formats

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:jit_flutter_app_helper/jit_flutter_app_helper.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _jitFlutterAppHelperPlugin = JitFlutterAppHelper();
  String formattedDate = '';
  String formattedTime = '';
  String formattedTime2 = '';



  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {

    // you can pass DateTime and String also as a argument
    String date = _jitFlutterAppHelperPlugin.formatDayMMDDYYYYWithSlashes("2094-03-04");


    String time = _jitFlutterAppHelperPlugin.fullTime12Hour(TimeOfDay.now());
    String time2 = _jitFlutterAppHelperPlugin.fullTime24Hour(TimeOfDay.now());

    if (!mounted) return;

    setState(() {
      formattedDate = date;
      // formattedDate=time;
      formattedTime2 = time2;

    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              Text(formattedDate),
              Text(formattedTime2),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
120
points
48
downloads

Publisher

unverified uploader

Weekly Downloads

Converts `DateTime` to all possible String formats

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_web_plugins, intl, plugin_platform_interface, web

More

Packages that depend on jit_flutter_app_helper