-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
We should handle this case gracefully
import 'package:flutter/material.dart';
import 'package:rich_text_controller/rich_text_controller.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: RichTextExample(),
);
}
}
class RichTextExample extends StatelessWidget {
RichTextExample({super.key});
final controller = RichTextController(
text: 'Type "highlight" or "Flutter" here!',
targetMatches: [],
onMatch: (matches) {
print('Matched: $matches');
},
);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('RichTextController Example')),
body: Center(
child: TextField(
controller: controller,
),
),
);
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels