JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

Untitled Page | JustPaste.app
25 days ago3 views
👨‍💻Programming
import 'package:flutter/material.dart';
void main(){
  runApp(const MyApp());
}
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "fluter Demo",
      
      home: Material(),
    );
  }
}
class Mainscreen extends StatefulWidget {
  const Mainscreen({super.key});

  @override
  State<Mainscreen> createState() => _MainscreenState();
}

class _MainscreenState extends State<Mainscreen> {

   DateTime _date = DateTime.now();
   TimeOfDay _time =TimeOfDay.now();

   void _showDateDiloge() async{
    final  DateTime? select = await showDatePicker(context: context,
    initialDate: _date,
     firstDate: DateTime(2000),
      lastDate:DateTime(2027),
      helpText: "select Date ",
      cancelText: "cancel",
      confirmText: "Select",
      );
      if(select!=null && select != _date){
        setState(() {
          _date =select;
        });
      }
   }

   void _showAlertDialog() {
    showDialog(context: context, builder: (_) => AlertDialog(
      title: Text("logout"),
      content: Text("are you sure to logout drom this acc?"),
      actions: [
        TextButton(onPressed: (){
          Navigator.pop(context);
        }, 
        child:Text('cancel'),)
      ],
     ),
    );

   }
   
   void _showTime() async{
    final TimeOfDay? select= await showTimePicker(
      context: context,
     initialTime: _time,
     );
     if(select != null && select!= _time){
      setState(() {
        _time= select;
      });
     }
   }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('sitting'),
      ),
      body: Column(
        children: [
          ListTile(
            leading: Icon(Icons.calendar_today),
            title: Text('Berthday'),
            trailing: Text(""),
          ),
          ListTile(
          leading: Icon(Icons.alarm),
          title: Text('Alarm'),   
          trailing: Text(""),
                 ),
                 ListTile(
                   leading: Icon(Icons.logout),
                   title: Text('Alert Dialog'),   
                      trailing: Text(""),

                 )
        ],
      ),
    );
  }
}
← Back to timeline