I am trying to generate a list of pages numbers after every 300 words but can't. please does anybody know how I can implement this?.
class Try extends StatelessWidget {
const Try({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final String text4 = lorem(paragraphs: 8, words: 2000);
return Scaffold(
body: SingleChildScrollView(
child: SafeArea(
child: Padding(
padding: const EdgeInsets.all(9),
child: Column(
children: [
Text(text4),
],
),
),
),
),
);
}
}
I tried adding the below code to it but...
for (int i = 0; i < text4.length;300 * i++)
//if (text4.length == 300)
Padding(
padding: const EdgeInsets.all(14),
child: Column(
children: [
const Text('page ${a += 1}'),
Divider(
color: Theme.of(context).primaryColor,
)
],
),
),
Text(text4),
