Untitled

mail@pastecode.io avatar
unknown
dart
a year ago
855 B
3
Indexable
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

class TimeFormate extends StatelessWidget {
  const TimeFormate({super.key});

  @override
  Widget build(BuildContext context) {

    var time = DateTime.now();
    return Scaffold(

      body: Center(
        child: Container(
          height: 100,
          width: 100,

          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('Current time : ${DateFormat('jms').format(time)}'),
              ElevatedButton(
                  onPressed: (){
                    setState((){

                    });
                  },
                  child: Text("Update Tiem"))
            ],
          ),
        ),
      )

    );
  }
}