nested_choice_list 0.0.4
nested_choice_list: ^0.0.4 copied to clipboard
A flutter package for handling nested list item selection without limitation for the depth of the nested list.
example/lib/main.dart
import 'package:examples/multi_selection_example.dart';
import 'package:examples/single_selection_example.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const HomePage(),
);
}
}
// Home page
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('NestedChoiceList'),
),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => const SingleSelectionExample(),
),
);
},
child: const Text('Example one (SingleSelection)'),
),
const SizedBox(
height: 40,
),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => const MultiSelectionExample(),
),
);
},
child: const Text('Example two (MultiSelection)'),
),
],
),
),
);
}
}