Git Product home page Git Product logo

frideosapps / frideos_flutter Goto Github PK

View Code? Open in Web Editor NEW
189.0 189.0 22.0 987 KB

An all-in-one Fllutter package for state management, reactive objects, animations, effects, timed widgets etc.

Home Page: https://pub.dev/packages/frideos

License: BSD 2-Clause "Simplified" License

Java 0.82% Objective-C 0.55% Dart 98.18% Shell 0.45%
bloc bloc-pattern dart dart-library dart2 flutter flutter-apps flutter-examples flutter-library flutter-package flutter-widget frideos library reactive-programming rxdart sharedpreferences sharedpreferences-helper state-management streams widgets-timing

frideos_flutter's Issues

Black screen before opening the first screen

Hello,
I am trying to build the app with custom theme using ValueBuilder and AppStateProvider.

Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.6 18G103, locale en-VN)
• Flutter version 1.12.13+hotfix.5 at /Users/thanhla/flutter
• Framework revision 27321ebbad (6 weeks ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0

But my app appear black screen before opening the first screen.

    final theme = AppStateProvider.of<AppState>(context).currentTheme;

    return ValueBuilder<MyTheme>(
      streamed: theme,
      builder: (context, snapshot) => MaterialApp(
        title: 'Flutter Demo',
        theme: _buildThemeData(snapshot.data),
        onGenerateRoute: generateRoute,
        debugShowCheckedModeBanner: false,
        navigatorKey: navigatorKey,
        initialRoute: Routes.home,
      ),
    );

Please check my demo code, thank you!
quiz.zip

Seem to be not supported web

Hello frideos team,

I try to build web application, but it stuck with error:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following UnsupportedError was thrown building _InheritedState:
Unsupported operation: Platform._operatingSystem

The relevant error-causing widget was:
  _InheritedState
  file:///Users/macbook/flutter/.pub-cache/hosted/pub.dartlang.org/frideos-1.0.0+1/lib/src/app_state_provider.dart:51:7

Please help me check it again, thank you!

[Question] Migration from 0.1.3 to 0.4.1

Hi Frideos,

I've been using the 0.1.3 for some time now. I started looking at the 0.4.1 but faced an issue you can maybe help me with. to demonstrate this I have reimplemented the default flutter app with a BLOC that looks like this:

class HomePageBloc {
  final StreamedValue<int> _counter;

  HomePageBloc() : _counter = StreamedValue<int>(initialData: 0);

  Stream<int> get counter => _counter.outStream;

  void incrementCounter() {
    _counter.value++;
  }
}

Unforunatelly the counter 0 never show on the widget. the initial Data is always null. Is this expected?

            StreamedWidget(
              stream: _bloc.counter,
              builder: (context, snapshot) {
                if (snapshot.data == null) return Container();
                return Text(
                  '${snapshot.data}',
                  style: Theme.of(context).textTheme.display1,
                );
              },
            ),

the initial data is not available on the stream. Any sugestion?

Regards,

Alex.

Feature parity with audio players like methods (pause, onComplete, onDuration / onCurrentPosition, seek,...)

Hi @frideosapps thank's for this wonderful library, this is exactly what I was looking for. My use case is that I would like to sync audio and text (mostly), save the progress of the user, etc ... I think I can achieve that with the callbacks (onStart => play song, onPause => pause song, ... )

First, if I understand the docs correctly, I can only do play (startStages),rewind (resetStages), and skip next stage (getNextStage). It would be nice to have on the low level widget StagedObject a method like getPreviousStage and on an upper level have StagedWidget, have the corresponding utility methods and callbacks .

Second, for the features like (pause, onComplete, onDuration / onCurrentPosition, seek) I guess it will have some repercussions on StreamedObject and ValueBuilder to have more control over the stream.

What do you think ? I'm playing around your code right now to make a PR but for some reason I can't reset the player.

Here is my raw code

import 'package:frideos/frideos.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  var reset = "reset";
  Stage stage;
  @override
  void initState() {
    staged
      ..setStagesMap(stagesMap)
      ..startStages();
    stage = staged.getStage(0);
    super.initState();
  }

  @override
  void dispose() {
    staged.dispose();
    super.dispose();
  }

  var staged = StagedObject();
  var stagesMap = <int, Stage>{
    0: Stage(
        widget: Container(
          key: const Key('0'),
          child: const Text('Stage 0'),
        ),
        time: 2000,
        onShow: () {
          //tester.pump();
        }),
    1: Stage(
        widget: Container(
          key: const Key('1'),
          child: const Text(
            'Stage 1',
            // style: TextStyle(fontSize: 50),
          ),
        ),
        time: 2000,
        onShow: () {}),
    2: Stage(
        widget: Container(
          key: const Key('2'),
          child: const Text(
            'Stage 2',
            // style: TextStyle(fontSize: 50),
          ),
        ),
        time: 2000,
        onShow: () {}),
  };

// var stagesMap = ;
  @override
  Widget build(BuildContext context) {
    assert(stage != null);
    return Scaffold(
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.refresh),
        onPressed: () {
         
              staged
            //  ..setStagesMap(stagesMap)
            ..resetStages();
          setState(() {
            reset = "reset";
            staged = staged;
          });
          print(reset);
      

          // print(reset);
        },
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Center(
            child: ValueBuilder(
                streamed: staged,
                builder: (context, snapshot) => snapshot.data),
          ),
        ],
      ),
    );
  }
}

Examples with this library

If you would like to contribute with examples built with this library it would be really appreciated.

Logging on close

Hello, Is there a way to prevent the dispose to log at every call such as:

flutter: ---------- Closing Stream ------ type: int
flutter: ---------- Closing Stream ------ type: String
flutter: ---------- Closing Stream ------ type: Error
flutter: ---------- Closing Stream ------ type: bool
flutter: ---------- Closing Stream ------ type: String
flutter: ---------- Closing Stream ------ type: Error
flutter: ---------- Closing Stream ------ type: String
flutter: ---------- Closing Stream ------ type: bool
flutter: ---------- Closing Stream ------ type: String
flutter: ---------- Closing Stream ------ type: PhoneInfo
flutter: ---------- Closing Stream ------ type: PhoneInfo
flutter: ---------- Closing Stream ------ type: String
flutter: ---------- Closing Stream ------ type: bool

Thanks,

Alex.

not able to run app on iOS

I did add flutter_flavorizr after creating the project, nonetheless, the project is quite new, max one month old. When trying to run it in an iOS simulator I get this error:

Launching lib/main-dev.dart on iPhone SE (2nd generation) in debug mode...

Running Xcode build...

Xcode build done. 3.7s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **

Xcode's output:

diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in
target 'Runner' from project 'Runner')

Could not build the application for the simulator.
Error launching application on iPhone SE (2nd generation).

[Question] Dependencies on shared_preferences

Hi Frideos,

Why the dependency to shared_preference? This dependency will create problems as there are pods and Android packages behind this (unless mistaken).... I would strongly encourage you to split the implementation that depends on it to another package... frideos is something that could make send to other framework (dart web, backend... ) That might not support shared preferences... What do you think?

Alex.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.