From 76cad96dd9cb90ea00aa6c53e7e7d295f09b1336 Mon Sep 17 00:00:00 2001 From: lamnhan066 Date: Mon, 8 Jan 2024 21:35:24 +0700 Subject: [PATCH] Improved example --- example/lib/main.dart | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 54bf4db..4f7f9de 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -103,14 +103,9 @@ class _MyAppState extends State { } } -class OtherPage extends StatefulWidget { +class OtherPage extends StatelessWidget { const OtherPage({Key? key}) : super(key: key); - @override - State createState() => _OtherPageState(); -} - -class _OtherPageState extends State { @override Widget build(BuildContext context) { return Scaffold( @@ -121,11 +116,7 @@ class _OtherPageState extends State { ), body: Column( children: [ - Tr( - (context) { - return Text('Text will be changed'.tr); - }, - ), + Tr((_) => Text('Text will be changed'.tr)), Text('Text will be not changed'.tr), ElevatedButton( onPressed: () {