Copy and Paste  -   An Application to Copy/Paste Text  

 
S.No 5972 Name C33 Date/Time 02-Jul-2024 02:32:40 PM

Copy text from below
/*
Question C33:
We have following record of students:
RegNo Name  Marks
1 Ali 80
2 Noman 60
3 Faisal  40
4 Javed 55

You need to show the above record map function flutter’s ListView widget. Display a 4th column in the output that displays ‘pass’ if marks are greater than 50 and fail otherwise.
For example:
RegNo Name  Marks Status
1 Ali 80  Pass
2 Noman 60  Pass
3 Faisal  40  Fail
4 Javed 55  Pass
*/

import 'package:flutter/material.dart';

class Student {
  final int regno;
  final String name;
  final double marks;

  Student(this.regno, this.name, this.marks);
}

void main() {
  runApp(MaterialApp(title: 'Flutter Demo', home: MyApp()));
}

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

  final List<Student> students = [
    Student(35, "Ali", 33),
    Student(15, "Nasir", 63),
    Student(20, "Javed", 20),
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Container(
            padding: const EdgeInsets.all(20),
            child: ListView.builder(
                itemCount: students.length,
                itemBuilder: (context, index) {
                  final item = students[index];

                  return ListTile(
                      subtitle: Row(children: [
                    Expanded(child: Text("${item.regno}")),
                    Expanded(child: Text(item.name)),
                    Expanded(child: Text("${item.marks}")),
                    Expanded(
                        child: Text("${item.marks >= 50 ? "Pass" : "Fail"}")),
                  ]));
                })));
  }
}




comments powered by Disqus
NEW ENTRIES
S.No Name Entry Time/Date
5698 . 18-May-2023 09:48:52 PM
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

[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