flutterando / asuka Goto Github PK
View Code? Open in Web Editor NEWShow Snackbars, dialogs, ModalSheets in a single provider. Simple and Clean.
Home Page: https://pub.dev/packages/asuka
License: MIT License
Show Snackbars, dialogs, ModalSheets in a single provider. Simple and Clean.
Home Page: https://pub.dev/packages/asuka
License: MIT License
I often use asuka to display error messages and these are related to exceptions most of the time.
I feel like it'd be useful to have a handler function called in these situations. For instance, I'd like to have these exceptions logged in my backend application with the stack trace and other details. It'd allow me to be address the error with all the details involved at the exact moment it'd happen.
Ao apertar o botão de voltar do android, em vez de fechar o popup como esperado, ele realiza o canPop na rota em baixo, saindo da tela atual e mantendo o popup sob a nova tela.
Possivelmente relacionado com #7
Hello!
Congrats for the great job!
What license do you intend to use with asuka?
Please, specify the licence for this package, so we can legally use it.
Thanks!
PS.: MIT License would be great.
Ao colocar no MaterialApp builder: asuka.builder e ir para uma pagina onde utiliza Scaffold com resizeToAvoidBottomInset: false dá overflowed ao abrir o teclado para digitar em um TextFormField.
Ao configurar o asuka
em um projeto e chamar o showDatePicker
para selecionar datas, o backbutton
do Android
não consegue fazer o pop()
do dialog
.
O problema pode ser facilmente reproduzido criando um projeto, adicionando o asuka
nele e configurando 2 telas onde na segunda tela tenha um botão que chama o DatePicker
. Ao abrir o DatePicker
e pressionar o backButton
do dispositivo o app mantém o DatePicker
sendo exibido mas volta para a primeira tela do app.
Currently it's not possible to hide existing snackbar so it adds new ones to the queue.
Please add possibility to remove or hide existing snackbars, thanks.
References:
https://api.flutter.dev/flutter/material/ScaffoldMessengerState/hideCurrentSnackBar.html
https://docs.flutter.dev/release/breaking-changes/scaffold-messenger
When using Asuka.showSnackBar(...), if the keyboard is open, the snackbar opens behind it, making it impossible to see the message.
Current workaround: always hide keyboard on action that can fire the snackbar.
@override
Widget build(BuildContext context) {
return Container(
child: PageView(
controller: controller,
scrollDirection: Axis.horizontal,
physics: NeverScrollableScrollPhysics(),
children: [
ConfirmPasswordPage(
next: () {
var entry = OverlayEntry(
builder: (context) {
return Center(
child: CircularProgressIndicator(),
);
},
);
asuka.addOverlay(entry);
},
),
The default Material's showDialog's barrierColor is Colors.black54, but Asuka's isn't.
Try both showDialogs and pass no barrierColor to them.
../../../../.pub-cache/hosted/pub.dev/asuka-2.2.0/lib/src/asuka_singleton_deprecated.dart:104:10: Error: Expected 0 type arguments.
material.PersistentBottomSheetController<T> showBottomSheet<T>(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dev/asuka-2.2.0/lib/src/asuka_singleton.dart:186:12: Error: Expected 0 type arguments.
material.PersistentBottomSheetController<T> showBottomSheet<T>(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Estou tentando utilizar no Flutter 2.2.3 e está dando este erro:
.pub-cache/hosted/pub.dartlang.org/asuka-2.0.0+1/lib/src/asuka_singleton.dart:202:5: Error: No named parameter with the name 'constraints'.
[ ] [ ] constraints: constraints,
[ ] [ ] ^^^^^^^^^^^
[ ] [ ] /home/####/fvm/versions/2.2.3/packages/flutter/lib/src/material/bottom_sheet.dart:649:12: Context: Found this candidate, but the arguments don't match.
[ ] [ ] Future<T?> showModalBottomSheet<T>({
[ ] [ ] ^^^^^^^^^^^^^^^^^^^^
Alguém sabe se tem como resolver ou tenho que mudar a versão do Flutter?
pubspec.yaml
`version: 1.0.0+1
environment:
sdk: '>=2.18.5 <3.0.0'
dependencies:
flutter:
sdk: flutter
asuka: ^2.0.1+3
cupertino_icons: ^1.0.2
flutter_modular: ^5.0.3
mobx: ^2.1.3
flutter_mobx: ^2.0.6+5
google_fonts: ^3.0.1
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
mobx_codegen: ^2.1.1
modular_test:
build_runner: ^2.3.2`
Utilizo atualmente a versão 1.17.4 do Flutter e ao tentar compilar o projeto recebo um erro informando que os parâmetros barrierColor
e useSafeArea
não existem.
Clonei o asuka
e o flutter
para entender o que estava acontecendo e vi que na versão 1.17.4 esses 2 parâmetros não existem ainda. Eles foram implementados neste commit que é uma versão posterior até onde entendi.
Para reproduzir o problema basta abrir o projeto do asuka
com o flutter 1.17.4 que a classe asuka_singleton
será sinalizada com erro nesses parâmetros.
../../.pub-cache/hosted/pub.dev/asuka-2.0.2/lib/src/asuka_singleton.dart:345:29: Error: The argument type 'bool?' can't be assigned to the parameter type 'bool' because 'bool?' is nullable and 'bool' isn't.
semanticsDismissible: semanticsDismissible,
^
Target kernel_snapshot failed: Exception
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Because the library builds on the MaterialApp it removes the possibility of using Hero Animation.
Sample code:
import 'package:flutter/material.dart';
import 'package:asuka/asuka.dart' as asuka;
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
builder: asuka.builder,
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("First Page"),
),
body: Column(
children: [
Spacer(),
Hero(
child: Container(
height: 50,
width: 50,
color: Colors.blue,
),
tag: 'hero',
),
Spacer(),
FlatButton(
child: Text('text'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondPage()),
);
},
),
],
),
);
}
}
class SecondPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Second Page'),
),
body: Column(
children: [
Spacer(),
FlatButton(
child: Text('text'),
onPressed: () {},
),
Spacer(),
Hero(
child: Container(
height: 50,
width: 50,
color: Colors.blue,
),
tag: 'hero',
),
Spacer(),
],
),
);
}
}
O modular.to.showDialog funcionava com o Modular.to.pop()
agora temos o asuka.showDialog() sem cotexto mas não temos um asuka.pop()
Eu tentei o asuka.showDialog() com o Modular.to.pop() mas não funciona.
Se eu estiver em um metodo que não tem contexto seria bom um asuka.pop() se não eu teria que passar por parametro o contexto do dialog em varios metodos.
Currently getting an error on Asuka dependency when I try to run one of my projects with the new Flutter 3.19.0 version.
Error (Xcode): ../../../../.pub-cache/hosted/pub.dev/asuka-2.2.0/lib/src/asuka_singleton_deprecated.dart:104:10: Error: Expected 0 type arguments.
asuka/lib/src/asuka_singleton.dart
Line 390 in 8ed8a56
Apparently, this line is causing TextField to be hidden by keyboard, overriding expected behavior of resizing when keyboard is visible.
Might be related to #32
Any thoughts on how to overcome this?
Thanks!
Currently there's only one test which only checks for assertions. There's no tests that check if the behavior and implementations of the package even work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.