These are chat archives for flutter/flutter

2nd
Mar 2019
Brady Trainor
@bradyt
Mar 02 2019 00:09 UTC
seems weird to leave a thing like permissions up to the community, and in a broken state
Green Appers, Inc.
@GreenAppers
Mar 02 2019 03:20 UTC
i had to disable minify for release build. but stuff other than flutter was the bigger problem today
OneOn
@tegab
Mar 02 2019 04:07 UTC
anyone around to help
zeroyjk
@zeroyjk
Mar 02 2019 04:10 UTC
Hello guyz
i have some question
i want to make apps guess words on flutter for my 1 project
where can i find tutorial for that
guess words it's look like more easy for me as a newbie training
John Ravi
@JohnRav64740683_twitter
Mar 02 2019 04:28 UTC
@JohnRav64740683_twitter have you read up on https://flutter.dev/docs/deployment/ios
I am looking for debug build of ios rather so that I can send to client, as they want to app on their side.
With Android I can locate apk in build folder but I cannot trace ios build file, i guess .ipa
John Ravi
@JohnRav64740683_twitter
Mar 02 2019 06:13 UTC
Do we need a physical ios device to generate .ipa or is simulator enough?
Basketball ICO
@BasketballICO_twitter
Mar 02 2019 07:04 UTC
Hello, is a good practice do that? or there is something better?
class TestPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: MyAppBar(),
      body: MyBody(),
    );
  }
}

class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
  @override
  Size get preferredSize => Size.fromHeight(kToolbarHeight); // whatever height you want

  @override
  Widget build(BuildContext context) {
    return AppBar();
  }
}

class MyBody extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Center(
        child: Text('Hello World'),
      ),
    );
  }
}
Serkan Yavuz
@serkantweet_twitter
Mar 02 2019 07:34 UTC
Hi everyone,
I will convert an existing android app to flutter, is there any tutorial or guideline?
Avinath Pulathisi Gunasekara
@avinath1998
Mar 02 2019 08:01 UTC
@BasketballICO_twitter seems fine, but your creating the appbar as a child of another widget, so make sure that you utilize MyAppBar by making it interact with AppBar, you shouldn't just create the AppBar inside MyAppBar just to act only as a wrapper. The body seems fine though.
Brady Trainor
@bradyt
Mar 02 2019 09:10 UTC
let's recreate the mood of npm
Brady Trainor
@bradyt
Mar 02 2019 09:35 UTC
@Mahantbk consider how to format code, as described at https://gitter.zendesk.com/hc/en-us/articles/200176682-Markdown-basics
You can edit your previous message.
Basketball ICO
@BasketballICO_twitter
Mar 02 2019 09:48 UTC
@avinath1998 Thanks :D
Avinath Pulathisi Gunasekara
@avinath1998
Mar 02 2019 14:24 UTC
@BasketballICO_twitter you're welcome :)
ѦՊԻ
@akkk33
Mar 02 2019 15:29 UTC
Can't believe there is no official documentation for firebase_auth !!!
I want to let user register with phone number and password, for the first part a phone number must be activated with SMS code provided by firebase.
I've been searching for an updated method to implement that however couldn't find but outdated methods contains signInWithPhoneNumber functions which is removed!!
Please does anyone know instructions for that?
Mohamed Hassan
@scripter
Mar 02 2019 16:11 UTC
Launching lib/main.dart on Android SDK built for x86 in debug mode...
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/sim_service-0.0.6/android/src/main/java/com/cloudsoft/simservice/SimServicePlugin.java:7: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
                             ^
  symbol:   class ActivityCompat
  location: package android.support.v4.app
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/sim_service-0.0.6/android/src/main/java/com/cloudsoft/simservice/SimServicePlugin.java:8: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
                                 ^
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/sim_service-0.0.6/android/src/main/java/com/cloudsoft/simservice/SimServicePlugin.java:285: error: cannot find symbol
        ActivityCompat.requestPermissions(activity, perm, 0);
        ^
  symbol:   variable ActivityCompat
  location: class SimServicePlugin
/Applications/flutter/.pub-cache/hosted/pub.dartlang.org/sim_service-0.0.6/android/src/main/java/com/cloudsoft/simservice/SimServicePlugin.java:293: error: cannot find symbol
        return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(activity, permission);
                                                    ^
  symbol:   variable ContextCompat
  location: class SimServicePlugin
Note: /Applications/flutter/.pub-cache/hosted/pub.dartlang.org/sim_service-0.0.6/android/src/main/java/com/cloudsoft/simservice/SimServicePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
4 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sim_service:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
guys ,, I am unable to get the apk for my app. I am trying to either downgrade or update all plugins .. but the thing is some of them are not compatible with AndroidX like sim_service
and I don’t know how to solve this
Alexandre
@lemonbuzz
Mar 02 2019 16:22 UTC
Hey guys, im trying to get local epoch time, it seems that DateTime returns it but in UTC
how can i get it with current locale
victor Shukuru Arc
@victorshn
Mar 02 2019 16:24 UTC
hello hire
Sumanth Ratna
@sumanthratna
Mar 02 2019 16:54 UTC
I have a BottomNavigationBar, but I want to allow users to also swipe to navigate (so to go right they would swipe left or click the icon to the right of the current)
how can I implement this?
Avinath Pulathisi Gunasekara
@avinath1998
Mar 02 2019 17:00 UTC
@sumanthratna use a TabBar
Venkat Dinavahi
@venkatd
Mar 02 2019 17:18 UTC
hi all, how does scoping work with dart? suppose I want helper functions and internal classes, would I risk naming conflicts if I came up with common names like Duration or rem ?
Alef Carlos
@alefcarlos
Mar 02 2019 17:34 UTC
@scripter you may use some lib which does not support AndroidX, see this link https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 17:46 UTC
@venkatd any name starting with underscore is local to the library (basically, the file unless you use part/part of).
so you could have class _Duration or sub _rem and it would never conflict with any other declaration.
Jannik C
@masseelch
Mar 02 2019 17:57 UTC
Can anyone recommend a good source to learn about the difference between async, async*, sync and sync*?
@MasseElch
Jannik C
@masseelch
Mar 02 2019 18:42 UTC
Thanks
If I understand correctly: async is for futures and `async* for streams?
Jannik C
@masseelch
Mar 02 2019 18:47 UTC
Async makes await available and async* yield?
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 18:49 UTC
Yeah, that’s probably the short version.
those linked pages will have the details
And the descriptions of the Future and Stream classes.
Jannik C
@masseelch
Mar 02 2019 18:50 UTC
Still don't get the sync keyword.
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 18:51 UTC
there’s no sync keword
There’s “sync*"
Informs Dart that you’ll be using yield
Jannik C
@masseelch
Mar 02 2019 18:52 UTC
Perfect link. Thanks!
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 18:53 UTC
I’m just good with the googles :)
I have aliases for “dl” (search dartlang.org), “ad” (search web.dartlang.org) and “fl” (search flutter.io, which I’ll have to update to flutter.dev)
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 18:59 UTC
ok, flutter.io gone. Now using flutter.dev
Abuzar Mushtaq
@abuzarmushtaq
Mar 02 2019 20:12 UTC
Hi, I’m new :)
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 20:45 UTC
Hello “new” :)
Abuzar Mushtaq
@abuzarmushtaq
Mar 02 2019 20:46 UTC
@RandalSchwartz haha Thanks
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 20:47 UTC
I think most of us are “new” in some ways to Flutter.
so don’t be concerned about your questions. Just ask.
Abuzar Mushtaq
@abuzarmushtaq
Mar 02 2019 20:48 UTC
@RandalSchwartz Exactly, but I’m sticked with flutter 1 year ago.
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 20:49 UTC
This is a good place to ask, but it’s drinking from the firehose. StackOverflow is a better place to ask questions or look for answers.
Abuzar Mushtaq
@abuzarmushtaq
Mar 02 2019 20:51 UTC
Sugar, i’m not asking questions. Cheers!
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 20:52 UTC
“Sugar”?
Abuzar Mushtaq
@abuzarmushtaq
Mar 02 2019 20:55 UTC
You :p
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 20:56 UTC
Yeah, not sure I get the reference. If anything, you’d know I’m pretty much anti-sugar (and carbs).
Abuzar Mushtaq
@abuzarmushtaq
Mar 02 2019 20:56 UTC
Ohh. Salt lover right?
Just kidding bro. never mind
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 20:57 UTC
I consume salt without limit, yes. But I also get most of my operating calories from Fat.
Most of the complaints about salt have actually had people consuming too little salt. It’s sad.
Abuzar Mushtaq
@abuzarmushtaq
Mar 02 2019 21:01 UTC
Always consume within the limit. Overlimit not good for the flutter devs.
Randal L. Schwartz
@RandalSchwartz
Mar 02 2019 21:07 UTC
Yeah, you get overflow exceptions. :)
Rob Halff
@rhalff
Mar 02 2019 22:23 UTC
Anyone using bloc andflutter_bloc it confuses me slightly, the examples seem to switch between different state (classes), quite different from redux. The examples do not show how to merge existing state with new partial state updates.
Should I just switch to redux or is the same possible with blocs?
The examples are more like a state machine, where only one state is active at a time.
Venkat Dinavahi
@venkatd
Mar 02 2019 22:37 UTC
@RandalSchwartz got it thanks!
Alef Carlos
@alefcarlos
Mar 02 2019 22:51 UTC
@rhalff I'm using BLoC with flutter_bloc, have U seen the infinity_list example ? https://github.com/felangel/bloc/blob/master/examples/flutter_infinite_list/lib/bloc/post_bloc.dart
Gian Marco Di Francesco
@giandifra
Mar 02 2019 23:06 UTC
hi, how can use bottom navigation bar in a bloc pattern with a bloc provider? when i change page the bloc provider is disposed and rebuild ... i need of retain the state of bloc provider when change page
Alef Carlos
@alefcarlos
Mar 02 2019 23:11 UTC
@giandifra I got the same problem, you should not create bloc instance int the TabBarView widget, you must register it in the previous widget or in the main file.

In the main file:

......
  @override
  void initState() {
    tagsBloc = TagsBloc(widget.tagsService);
    collectionsBloc = CollectionsBloc(widget.collectionsService);
    createCollectionBloc = CreateCollectionBloc(widget.collectionsService);
    collectionBloc = CollectionBloc(widget.collectionService);
    collectionFavItemsBloc = CollectionFavItemsBloc(widget.collectionService);
    collectionRepeatedItemsBloc =
        CollectionRepeatedItemsBloc(widget.collectionService);
        createCollectionItemBloc = CreateCollectionItemBloc(widget.collectionsService, widget.collectionService);
    super.initState();
  }

  @override
  void dispose() {
    tagsBloc.dispose();
    collectionsBloc.dispose();
    createCollectionBloc.dispose();
    collectionBloc.dispose();
    collectionFavItemsBloc.dispose();
    collectionRepeatedItemsBloc.dispose();
    createCollectionItemBloc.dispose();
    super.dispose();
  }

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return BlocProviderTree(
      blocProviders: [
        BlocProvider<TagsBloc>(bloc: tagsBloc),
        BlocProvider<CollectionsBloc>(bloc: collectionsBloc),
        BlocProvider<CreateCollectionBloc>(bloc: createCollectionBloc),
        BlocProvider<CollectionBloc>(bloc: collectionBloc),
        BlocProvider<CollectionFavItemsBloc>(bloc: collectionFavItemsBloc),
        BlocProvider<CollectionRepeatedItemsBloc>(bloc: collectionRepeatedItemsBloc),
        BlocProvider<CreateCollectionItemBloc>(bloc: createCollectionItemBloc),
      ],
      child: MaterialApp(
        title: 'Coleção de Bolso',
        theme: ThemeData(
....

in the widget:

class CollectionPage extends StatelessWidget {
  final int collectionId;
  final String collectionName;
  CollectionPage(this.collectionId, this.collectionName);

  @override
  Widget build(BuildContext context) {
    var bloc = CollectionBloc.of(context);
    var repeatedBloc = CollectionRepeatedItemsBloc.of(context);
    var favBloc = CollectionFavItemsBloc.of(context);

    return Container(
      child: DefaultTabController(
        length: 3,
        child: Scaffold(
          appBar: AppBar(
            title: Text(collectionName),
            bottom: TabBar(
              tabs: <Widget>[
                Tab(
                  icon: Icon(Icons.view_list,
                      color: Theme.of(context).primaryIconTheme.color),
                  text: 'Itens',
                ),
                Tab(
                  icon: Icon(Icons.playlist_add_check,
                      color: Theme.of(context).primaryIconTheme.color),
                  text: 'Repetidos',
                ),
                Tab(
                  icon: Icon(Icons.favorite_border, color: Colors.red),
                  text: 'Favoritos',
                )
              ],
            ),
          ),
          body: TabBarView(
            children: <Widget>[
              CollectionListItemsView(collectionId, bloc),
              CollectionRepeatedItemsPage(collectionId, repeatedBloc),
              CollectionFavItemsPage(collectionId, favBloc),
            ],
          ),

In my bloc class i'm used to create a static method called of, so i can retrieve the instance from Context.

  static CreateCollectionItemBloc of(BuildContext context) =>
      BlocProvider.of<CreateCollectionItemBloc>(context);

Just remember to add bloc in provider !

Gian Marco Di Francesco
@giandifra
Mar 02 2019 23:21 UTC
@alefcarlos Thank you carlos, for bloc provider tree you use a package?
Alef Carlos
@alefcarlos
Mar 02 2019 23:23 UTC
@giandifra you're welcome! In the last update, the package includes this new feature !
Gian Marco Di Francesco
@giandifra
Mar 02 2019 23:25 UTC
@alefcarlos https://pub.dartlang.org/packages/bloc_provider this? i didn't use packafe until now, but if it is better i migrate to this solution

"BlocProviderTree is a Flutter widget that merges multiple BlocProvider widgets into one. BlocProviderTree improves the readability and eliminates the need to nest multiple BlocProviders. By using BlocProviderTree we can go from:

BlocProvider<BlocA>(
   bloc: BlocA(),
   child: BlocProvider<BlocB>(
     bloc: BlocB(),
     child: BlocProvider<BlocC>(
       value: BlocC(),
       child: ChildA(),
     )
   )
 )

to:

BlocProviderTree(
  blocProviders: [
    BlocProvider<BlocA>(bloc: BlocA()),
    BlocProvider<BlocB>(bloc: BlocB()),
    BlocProvider<BlocC>(bloc: BlocC()),
  ],
  child: ChildA(),
)

"

Gian Marco Di Francesco
@giandifra
Mar 02 2019 23:28 UTC
thank you very much, i start to migrate to this solution
Alef Carlos
@alefcarlos
Mar 02 2019 23:28 UTC
;)
Gian Marco Di Francesco
@giandifra
Mar 02 2019 23:29 UTC
if you know, the scroll list status is saved or return to the start of list? (when change and return back to the page )
Alef Carlos
@alefcarlos
Mar 02 2019 23:35 UTC
you should handle this by your own, using ScrollController
Gian Marco Di Francesco
@giandifra
Mar 02 2019 23:40 UTC
@alefcarlos ah ok, i will can save status on bloc , thanks
Rob Halff
@rhalff
Mar 02 2019 23:51 UTC
@alefcarlos, thanks I get the concept now I think, using thecopyWith and Equatable.