Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Eduardo Florence
2020-11-25 18:21:41 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e51e6450d058bff60e9a49ed5ca303862a86a53b
e51e6450
1 parent
a27d206d
Adjustment in the sample code in the readme of all languages
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
32 deletions
README-es.md
README.ko-kr.md
README.md
README.pl.md
README.pt-br.md
README.ru.md
README.zh-cn.md
README-es.md
View file @
e51e645
...
...
@@ -125,11 +125,13 @@ class Controller extends GetxController {
```
dart
class
Home
extends
StatelessWidget
{
// Cree una instancia de su clase usando Get.put() para que esté disponible para todas las rutas "secundarias" allí.
final
Controller
c
=
Get
.
put
(
Controller
());
@override
Widget
build
(
context
)
=>
Scaffold
(
Widget
build
(
context
)
{
// Cree una instancia de su clase usando Get.put() para que esté disponible para todas las rutas "secundarias" allí.
final
Controller
c
=
Get
.
put
(
Controller
());
return
Scaffold
(
// Utilice Obx(()=> para actualizar Text() siempre que se cambie el recuento.
appBar:
AppBar
(
title:
Obx
(()
=>
Text
(
"Clicks: "
+
c
.
count
.
string
))),
...
...
@@ -138,6 +140,7 @@ class Home extends StatelessWidget {
child:
Text
(
"Go to Other"
),
onPressed:
()
=>
Get
.
to
(
Other
()))),
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
onPressed:
c
.
increment
));
}
}
class
Other
extends
StatelessWidget
{
...
...
README.ko-kr.md
View file @
e51e645
...
...
@@ -123,11 +123,13 @@ class Controller extends GetxController{
```
dart
class
Home
extends
StatelessWidget
{
// Get.put()을 사용하여 클래스를 인스턴스화하여 모든 "child'에서 사용가능하게 합니다.
final
Controller
c
=
Get
.
put
(
Controller
());
@override
Widget
build
(
context
)
=>
Scaffold
(
Widget
build
(
context
)
{
// Get.put()을 사용하여 클래스를 인스턴스화하여 모든 "child'에서 사용가능하게 합니다.
final
Controller
c
=
Get
.
put
(
Controller
());
return
Scaffold
(
// count가 변경 될 때마다 Obx(()=> 를 사용하여 Text()에 업데이트합니다.
appBar:
AppBar
(
title:
Obx
(()
=>
Text
(
"Clicks:
${c.count}
"
))),
...
...
@@ -136,6 +138,7 @@ class Home extends StatelessWidget {
child:
Text
(
"Go to Other"
),
onPressed:
()
=>
Get
.
to
(
Other
()))),
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
onPressed:
c
.
increment
));
}
}
class
Other
extends
StatelessWidget
{
...
...
README.md
View file @
e51e645
...
...
@@ -123,11 +123,13 @@ class Controller extends GetxController{
```
dart
class
Home
extends
StatelessWidget
{
// Instantiate your class using Get.put() to make it available for all "child" routes there.
final
Controller
c
=
Get
.
put
(
Controller
());
@override
Widget
build
(
context
)
=>
Scaffold
(
Widget
build
(
context
)
{
// Instantiate your class using Get.put() to make it available for all "child" routes there.
final
Controller
c
=
Get
.
put
(
Controller
());
return
Scaffold
(
// Use Obx(()=> to update Text() whenever count is changed.
appBar:
AppBar
(
title:
Obx
(()
=>
Text
(
"Clicks:
${c.count}
"
))),
...
...
@@ -136,6 +138,7 @@ class Home extends StatelessWidget {
child:
Text
(
"Go to Other"
),
onPressed:
()
=>
Get
.
to
(
Other
()))),
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
onPressed:
c
.
increment
));
}
}
class
Other
extends
StatelessWidget
{
...
...
README.pl.md
View file @
e51e645
...
...
@@ -102,11 +102,13 @@ Tworzymy View. Użyj StatelessWidget oszczędzajac przy tym RAM. Z Get nie będz
```
dart
class Home extends StatelessWidget {
// Instantiate your class using Get.put() to make it available for all "child" routes there.
final Controller c = Get.put(Controller());
@override
Widget build(context) => Scaffold(
Widget build(context) {
// Instantiate your class using Get.put() to make it available for all "child" routes there.
final Controller c = Get.put(Controller());
return Scaffold(
// Use Obx(()=> to update Text() whenever count is changed.
appBar: AppBar(title: Obx(() => Text("Clicks: " + c.count.string))),
...
...
@@ -115,6 +117,7 @@ class Home extends StatelessWidget {
child: Text("Go to Other"), onPressed: () => Get.to(Other()))),
floatingActionButton:
FloatingActionButton(child: Icon(Icons.add), onPressed: c.increment));
}
}
class Other extends StatelessWidget {
...
...
README.pt-br.md
View file @
e51e645
...
...
@@ -124,16 +124,23 @@ Crie sua View usando StatelessWidget, já que, usando Get, você não precisa ma
```
dart
class
Home
extends
StatelessWidget
{
// Instancie sua classe usando Get.put() para torná-la disponível para todas as rotas subsequentes
final
Controller
c
=
Get
.
put
(
Controller
());
@override
Widget
build
(
context
)
=>
Scaffold
(
appBar:
AppBar
(
title:
Obx
(()
=>
Text
(
"Total de cliques:
${c.count}
"
))),
Widget
build
(
context
)
{
// Instancie sua classe usando Get.put() para torná-la disponível para todas as rotas subsequentes
final
Controller
c
=
Get
.
put
(
Controller
());
return
Scaffold
(
// Use Obx(()=> para atualizar Text() sempre que a contagem é alterada.
appBar:
AppBar
(
title:
Obx
(()
=>
Text
(
"Total de cliques:
${c.count}
"
))),
// Troque o Navigator.push de 8 linhas por um simples Get.to(). Você não precisa do 'context'
body:
Center
(
child:
RaisedButton
(
child:
Text
(
"Ir pra Outra tela"
),
onPressed:
()
=>
Get
.
to
(
Outra
()))),
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
onPressed:
c
.
increment
));
body:
Center
(
child:
RaisedButton
(
child:
Text
(
"Ir pra Outra tela"
),
onPressed:
()
=>
Get
.
to
(
Outra
()))),
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
onPressed:
c
.
increment
));
}
}
class
Outra
extends
StatelessWidget
{
...
...
README.ru.md
View file @
e51e645
...
...
@@ -118,11 +118,13 @@ class Controller extends GetxController{
```
dart
class
Home
extends
StatelessWidget
{
// Instantiate your class using Get.put() to make it available for all "child" routes there.
final
Controller
c
=
Get
.
put
(
Controller
());
@override
Widget
build
(
context
)
=>
Scaffold
(
Widget
build
(
context
)
{
// Instantiate your class using Get.put() to make it available for all "child" routes there.
final
Controller
c
=
Get
.
put
(
Controller
());
return
Scaffold
(
// Use Obx(()=> to update Text() whenever count is changed.
appBar:
AppBar
(
title:
Obx
(()
=>
Text
(
"Clicks:
${c.count}
"
))),
...
...
@@ -131,6 +133,7 @@ class Home extends StatelessWidget {
child:
Text
(
"Go to Other"
),
onPressed:
()
=>
Get
.
to
(
Other
()))),
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
onPressed:
c
.
increment
));
}
}
class
Other
extends
StatelessWidget
{
...
...
README.zh-cn.md
View file @
e51e645
...
...
@@ -122,11 +122,13 @@ class Controller extends GetxController{
```
dart
class
Home
extends
StatelessWidget
{
// 使用Get.put()实例化你的类,使其对当下的所有子路由可用。
final
Controller
c
=
Get
.
put
(
Controller
());
@override
Widget
build
(
context
)
=>
Scaffold
(
Widget
build
(
context
)
{
// 使用Get.put()实例化你的类,使其对当下的所有子路由可用。
final
Controller
c
=
Get
.
put
(
Controller
());
return
Scaffold
(
// 使用Obx(()=>每当改变计数时,就更新Text()。
appBar:
AppBar
(
title:
Obx
(()
=>
Text
(
"Clicks:
${c.count}
"
))),
...
...
@@ -135,6 +137,7 @@ class Home extends StatelessWidget {
child:
Text
(
"Go to Other"
),
onPressed:
()
=>
Get
.
to
(
Other
()))),
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
onPressed:
c
.
increment
));
}
}
class
Other
extends
StatelessWidget
{
...
...
Please
register
or
login
to post a comment