This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIT License | |
// | |
// Copyright (c) 2022 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
26/06/2022
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:provider/provider.dart'; | |
extension ProviderStoreBuildContextX on BuildContext { | |
/// Read the store once, doesn't subscribe a BuildContext to update. | |
AppStore readStore() => read<AppStore>(); | |
/// Watch the store by subscribing to a BuildContext. | |
AppStore watchStore() => watch<AppStore>(); | |
/// Select a piece of the store, subscribing a BuildContext to update only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void setState(fn) { | |
super.setState(fn); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'method.dart'; | |
import 'getterSetter.dart'; | |
import 'widget.dart'; | |
// stateless ini akan menjadi widget model. Widget model ini akan berisi List TextField dinamis // | |
// List TextFielld akan menyesuaikan dengan banyak panjang list String atau Function(String). // | |
// panjang LIst<String> dan List<Function(String)> harus sama// | |
class WidgetEditGist extends StatelessWidget { |
-
buat model
-
buat function
-
buat widget
-
buat home
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- provider: ^3.0.0+1 | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_grocery_shopping/application_color.dart'; | |
import 'package:geolocator/geolocator.dart'; | |
import 'package:provider/provider.dart'; | |
class ProvdersApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
-
initialValue dan controller akan menghasilkan error jika ada di TextFormField yang sama
-
ketika mentimpan menggunakan onSaved TextFormField, jangan lupa menggunakan validator dan mengecek validasi dari TextFOrmFIedl dengan Syntax "formKey.currentstate.validated" dan janga "formKey.currentState.saved" di Buttom
-
Ketika ingin memisahkan widget di kelas / file yang berbeda. Pastikan pada variable VoidCallback tidak perlu menggunakan lambda. contoh: onPressed: callback jangan onPressed: ()=> callback
-
Refresh indicator hanya bisa melakukan refresh di ListView
NewerOlder