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
about 1 month ago1 views
👨‍💻Programming
import 'package:flutter/material.dart';

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

  @override
  State<SettingsScreen> createState() => _SettingsScreenState();
}

class _SettingsScreenState extends State<SettingsScreen> {
  String _value = '';
  void _showSimpleDialog() {
    showDialog(
      context: context,
      builder: (contxt) {
        return SimpleDialog(
          title: Text("Select language"),
          children: [
            SimpleDialogOption(
              onPressed: () {
                setState(() {
                  _value = "English";
                });
              },
              child: Text("English"),
            ),

            SimpleDialogOption(
              onPressed: () {
                setState(() {
                  _value = "Kurdish";
                });
              },
              child: Text("Kurdish"),
            ),
          ],
        );
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Settings Screen")),
      body: ListView(
        children: [
          ListTile(
            leading: Icon(Icons.language),
            title: Text("Language"),
            trailing: Text(_value),
            onTap: _showSimpleDialog,
          ),
        ],
      ),
    );
  }
}
← Back to timeline