Copy and Paste  -   An Application to Copy/Paste Text  

 
S.No 5942 Name mad Date/Time 03-Jun-2024 01:59:22 PM

Copy text from below

import 'package:flutter/material.dart';

 

void main() => runApp(const MyApp());

 

class MyApp extends StatelessWidget {

  const MyApp({super.key});

 

  @override

  Widget build(BuildContext context) {

    const String appTitle = 'Flutter layout demo';

    return MaterialApp(

      title: appTitle,

      home: Scaffold(

        appBar: AppBar(

          centerTitle:  const Text(appTitle),

        ),

        body: const Center(

          child: SingleChildScrollView(

            child: Column(

              children: [ 

                ImageSection(

                  image: 'D:\Haseebprj\haseebtask\lib\images\lake.jpg', // Corrected image path

                ),

                TitleSection(

                  name: 'Oeschinen Lake Campground',

                  location: 'Kandersteg, Switzerland',

                ),

                ButtonSection(),

                TextSection(

                  description:

                      'Lake Oeschinen lies at the foot of the Blüemlisalp in the '

                      'Bernese Alps. Situated 1,578 meters above sea level, it '

                      'is one of the larger Alpine Lakes. A gondola ride from '

                      'Kandersteg, followed by a half-hour walk through pastures '

                      'and pine forest, leads you to the lake, which warms to 20 '

                      'degrees Celsius in the summer. Activities enjoyed here '

                      'include rowing, and riding the summer toboggan run.',

                ),

              ],

            ),

          ),

        ),

      ),

    );

  }

}

 

class TitleSection extends StatelessWidget {

  const TitleSection({

    super.key,

    required this.name,

    required this.location,

  });

 

  final String name;

  final String location;

 

  @override

  Widget build(BuildContext context) {

    return Padding(

      padding: const EdgeInsets.all(32),

      child: Row(

        children: [

          Expanded(

            child: Column(

              crossAxisAlignment: CrossAxisAlignment.start,

              children: [

                Padding(

                  padding: const EdgeInsets.only(bottom: 8),

                  child: Text(

                    name,

                    style: const TextStyle(

                      fontWeight: FontWeight.bold,

                    ),

                  ),

                ),

                Text(

                  location,

                  style: TextStyle(

                    color: Colors.grey[500],

                  ),

                ),

              ],

            ),

          ),

          Icon(

            Icons.star,

            color: Colors.red[500],

          ),

          const Text('41'),

        ],

      ),

    );

  }

}

 

class ButtonSection extends StatelessWidget {

  const ButtonSection({super.key});

 

  @override

  Widget build(BuildContext context) {

    final Color color = Theme.of(context).primaryColor;

    return SizedBox(

      child: Row(

        mainAxisAlignment: MainAxisAlignment.spaceEvenly,

        children: [

          ButtonWithText(

            color: color,

            icon: Icons.call,

            label: 'CALL',

          ),

          ButtonWithText(

            color: color,

            icon: Icons.near_me,

            label: 'ROUTE',

          ),

          ButtonWithText(

            color: color,

            icon: Icons.share,

            label: 'SHARE',

          ),

        ],

      ),

    );

  }

}

 

class ButtonWithText extends StatelessWidget {

  const ButtonWithText({

    super.key,

    required this.color,

    required this.icon,

    required this.label,

  });

 

  final Color color;

  final IconData icon;

  final String label;

 

  @override

  Widget build(BuildContext context) {

    return Column(

      mainAxisSize: MainAxisSize.min, // Added this

      children: [

        Icon(icon, color: color),

        Text(label),

      ],

    );

  }

}

 

class TextSection extends StatelessWidget {

  const TextSection({

    super.key,

    required this.description,

  });

 

  final String description;

 

  @override

  Widget build(BuildContext context) {

    return Padding(

      padding: const EdgeInsets.all(32),

      child: Text(

        description,

        softWrap: true,

      ),

    );

  }

}

 

class ImageSection extends StatelessWidget {

  const ImageSection({super.key, required this.image});

 

  final String image;

  

  @override

  Widget build(BuildContext context) {

    return Image.asset(

      image,

      width: 600,

      height: 240,

      fit: BoxFit.cover,

    );

  }

}





comments powered by Disqus
NEW ENTRIES
S.No Name Entry Time/Date
5843 ab 29-Oct-2023 08:51:02 PM
5842 a 29-Oct-2023 08:44:33 PM
5841 c++ program 29-Oct-2023 08:42:28 PM
5840 Child Vids 26-Oct-2023 07:07:04 AM
5839 23-Oct-2023 08:11:25 PM
5838 22-Oct-2023 06:29:37 PM
5837 Organic Loom 17-Oct-2023 07:02:03 PM
5836 Test 1 17-Oct-2023 11:16:30 AM
5835 PAF-IAST MET 17-Oct-2023 11:15:49 AM
5834 for jazz 16-Oct-2023 09:26:26 PM
5833 New Kid 16-Oct-2023 07:08:13 AM
5832 test 12-Oct-2023 10:38:09 AM
5831 a 12-Oct-2023 10:28:26 AM
5830 75 Videos 12-Oct-2023 09:32:23 AM
5829 11-Oct-2023 05:45:55 PM
5828 q44 10-Oct-2023 05:47:12 PM
5827 q4 10-Oct-2023 05:40:56 PM
5826 jflex q3 10-Oct-2023 05:37:43 PM
5825 q3 10-Oct-2023 05:33:13 PM
5824 q2 10-Oct-2023 05:32:15 PM
5823 jflex 10-Oct-2023 05:30:32 PM
5822 dddd 10-Oct-2023 04:41:21 PM
5821 nn 09-Oct-2023 11:55:27 AM
5820 Jarvo 09-Oct-2023 11:44:19 AM
5819 NEW CHILD 07-Oct-2023 11:16:57 AM
5818 05-Oct-2023 06:32:33 PM
5817 LandscapeLay 05-Oct-2023 11:42:00 AM
5813 responsive 02-Oct-2023 11:44:41 AM
5806 lab task 26-Sep-2023 05:28:21 PM
5805 q 4 26-Sep-2023 05:19:19 PM

[First] [Prev] 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 [Next] [Last]
 
web counter
web counter


To report any error messages or bugs, or other issues, please send email at: info@pakproject.com