Copy and Paste  -   An Application to Copy/Paste Text  

 
S.No 5969 Name new Date/Time 01-Jul-2024 12:48:17 PM

Copy text from below
/*
Question C15:
Show a list of students, such that :
ID Name CGPA
1 Javed 3.0
2 Noman 2.7
3 Ali 3.7
4 Faisal 3.3
5 Shahid 4.0
6 Kamal 3.1
7 Zahid 2.3
The students whose CGPA are in the range between 2 and less than 3 should be shown in bold and
red font.
The students whose CGPA are in the range between 3 and less than 3.7 should be shown in blue font
without bold
The students whose CGPA are greater than and equal to 3.7 should be shown in italic, bold, and
green font

*/

import 'package:flutter/material.dart';

class Student {
  final int id;
  final String name;
  final double gpa;

  Student(this.id, this.name, this.gpa);
}

void main() {
  runApp(MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: MyApp()));
}

class MyApp extends StatelessWidget {
  MyApp({super.key});

  final List<Student> students = [
    Student(1, "Javed", 3.0),
    Student(2, "Noman", 2.7),
    Student(3, "Ali", 3.7),
    Student(4, "Faisal", 3.3),
    Student(5, "Shahid", 4.0),
    Student(6, "Kamal", 3.1),
    Student(7, "Zahid", 2.3)
  ];

  TextStyle? _getTextStyle(double gpa) {
    FontWeight fw = FontWeight.normal;
    FontStyle fs = FontStyle.normal;
    Color color = Colors.black;

    if (gpa >= 2 && gpa < 3) {
      color = Colors.red;
      fw = FontWeight.bold;
      fs = FontStyle.normal;
    } else if (gpa >= 3 && gpa < 3.7) {
      color = Colors.blue;
      fw = FontWeight.normal;
      fs = FontStyle.normal;
    } else if (gpa >= 3.7) {
      color = Colors.green;
      fw = FontWeight.normal;
      fs = FontStyle.italic;
    }
    return TextStyle(
      fontWeight: fw,
      fontStyle: fs,
      color: color,
    );
  }

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: ListView.builder(
// Let the ListView know how many items it needs to build.
            itemCount: students.length,
// Provide a builder function. This is where the magic happens.
// Convert each item into a widget based on the type of item it is.
            itemBuilder: (context, index) {
              final item = students[index];
              return ListTile(
                title: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
 




comments powered by Disqus
NEW ENTRIES
S.No Name Entry Time/Date
5856 Jarvo 17-Nov-2023 08:28:14 AM
5855 K1Ds Vids 17-Nov-2023 06:55:00 AM
5854 best 16-Nov-2023 07:07:10 PM
5853 matchsummary 16-Nov-2023 06:38:13 PM
5852 findindex 16-Nov-2023 06:30:48 PM
5851 loops 16-Nov-2023 05:44:20 PM
5850 sorting 16-Nov-2023 05:36:34 PM
5849 test 16-Nov-2023 05:06:51 PM
5848 New Sexy 16-Nov-2023 07:13:16 AM
5847 455555555 13-Nov-2023 02:52:30 PM
5846 CSG Med 05-Nov-2023 04:08:52 PM
5845 New Kids 04-Nov-2023 06:45:51 AM
5844 BMP 31-Oct-2023 06:41:06 PM
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

[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