This file contains hidden or 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
return SliverAppBar( | |
backgroundColor: Colors.white, | |
pinned: false, | |
bottom: PreferredSize( | |
preferredSize: Size.fromHeight(15), | |
child: Container( | |
padding: | |
const EdgeInsets.only(top: 2, left: 12, right: 12, bottom: 10), | |
child: Stack( | |
alignment: Alignment.center, |
This file contains hidden or 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
class BaseManager(models.Manager): | |
"""Sobrescrevendo o Manager padrão. Nesse Manager | |
os registros não são apagados do banco de dados | |
apenas desativados, atribuindo ao campo deleted = True e | |
enabled = True | |
""" | |
def get_queryset(self): | |
"""Sobrescrevendo a queryset para filtrar os | |
registros que foram marcados como deleted |
This file contains hidden or 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
class Atrativo { | |
int id; | |
String nome; | |
String endereco; | |
double latitude; | |
double longitude; | |
String pontuacao; | |
int curtidas; | |
List<String> imagens; |
This file contains hidden or 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
class AtrativoBloc extends BlocBase { | |
final _controller = BehaviorSubject<List<Atrativo>>(); | |
get stream => _controller.stream; | |
getAtrativos() async { | |
try { | |
var _cidade = await CidadeBloc.getCidadeEscolhida(); | |
if (_cidade.id != null){ | |
List<Atrativo> _atrativos = await Atrativo.getAtrativos(_cidade.id); | |
_controller.sink.add(_atrativos); |
This file contains hidden or 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
void login() async { | |
try { | |
if (_formKey.currentState.validate()) { | |
showLoadingModal(show: true); | |
bool _result = await _usuarioController.login(_formLogin.text, _formPassword.text); | |
if (_result == true) { | |
showLoadingModal(); | |
if (UsuarioModel.userLocalValid(_usuarioController.model) == false) { | |
_showSnackBar( | |
AppLocalizations.of(context).translate("login_mensagem_erro"), |
This file contains hidden or 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
[√] Flutter (Channel stable, v1.17.4, on Microsoft Windows [versão 10.0.18363.900], locale pt-BR) | |
• Flutter version 1.17.4 at C:\flutter | |
• Framework revision 1ad9baa8b9 (4 days ago), 2020-06-17 14:41:16 -0700 | |
• Engine revision ee76268252 | |
• Dart version 2.8.4 | |
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3) | |
• Android SDK at C:\Users\guilh\AppData\Local\Android\sdk | |
• Platform android-29, build-tools 29.0.3 |
This file contains hidden or 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
@action | |
fetchFriends(int idGrupo, String token) async { | |
try { | |
this.friends.clear(); | |
this.processingFriends = true; | |
this.friends = ObservableList<UsuarioModel>.of( | |
await _service.fetchFriendsGroup(idGrupo, token)); | |
this._setOperationResult(""); | |
this.processingFriends = false; | |
} catch (e) { |
This file contains hidden or 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
_buildFriendsList() { | |
return Observer( | |
builder: (_) { | |
if (_grupoController.processingFriends == true) { | |
return Center( | |
child: Container( | |
child: CircularProgressIndicator(), | |
)); | |
} else if (_grupoController.errorMessage.isNotEmpty) { | |
return Center( |
This file contains hidden or 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
final ScrollController _scrollControllerEvents = ScrollController(); | |
... | |
_scrollControllerEvents.addListener(() { | |
if (_scrollControllerEvents.position.pixels == | |
_scrollControllerEvents.position.maxScrollExtent) { | |
_getMoreData(); | |
} | |
}); | |
... |
This file contains hidden or 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
Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: <Widget>[ | |
botaoAmigos(), | |
botaoReservas(), | |
botaoEventos(), | |
botaoConquistas(), | |
], | |
) |