generic_package 0.0.1
generic_package: ^0.0.1 copied to clipboard
A generic package which shows three types of list : Recipe list, books list and Request list with different UI.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:generic_package/recipelist.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
static List<dynamic> data = [];
static List<dynamic> booksData = [];
static List<dynamic> aidRequestData = [];
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
String category = 'R';
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: HomeScreen(
list: category == 'A'
? aidRequestData
: category == 'B'
? booksData
: data,
category: category,
),
);
}
}