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
5697 . 18-May-2023 04:03:47 PM
5696 Child Video2 11-May-2023 08:00:11 AM
5695 Child Videos 05-May-2023 07:58:35 AM
5694 MET May 3 03-May-2023 11:15:13 AM
5693 Asfand Leaks 02-May-2023 09:18:28 AM
5692 bikmangiya 02-May-2023 09:17:04 AM
5691 kk 30-Apr-2023 12:11:31 AM
5690 Yasir 29-Apr-2023 01:32:17 AM
5689 lll 27-Apr-2023 08:39:14 PM
5688 Gg 27-Apr-2023 08:31:28 PM
5687 More 4 You 27-Apr-2023 12:55:44 PM
5686 Elif Yener 26-Apr-2023 03:51:34 PM
5685 cycling 26-Apr-2023 01:26:18 PM
5684 Muslim matri 23-Apr-2023 11:13:13 AM
5683 xxxxx 18-Apr-2023 08:57:31 AM
5682 Aa 16-Apr-2023 10:23:04 PM
5681 Apr 12 MET 12-Apr-2023 09:56:35 AM
5680 MET 12 Apr 12-Apr-2023 09:43:37 AM
5679 online 11-Apr-2023 01:16:47 PM
5678 MS Test 11-Apr-2023 12:59:16 PM
5677 asdf 11-Apr-2023 12:58:53 PM
5676 asdf 11-Apr-2023 12:58:38 PM
5675 asdf 11-Apr-2023 12:58:33 PM
5674 asdf 11-Apr-2023 12:58:27 PM
5673 asdf 11-Apr-2023 12:58:20 PM
5672 asdf 11-Apr-2023 12:58:14 PM
5671 asdf 11-Apr-2023 12:58:07 PM
5670 asdf 11-Apr-2023 12:57:59 PM
5669 asdf 11-Apr-2023 12:57:53 PM
5668 asdf 11-Apr-2023 12:57:45 PM

[First] [Prev] 11 | 12 [Next] [Last]
 
web counter
web counter


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