A funny joke practice software with poor resources and low interface with flutter

A funny joke practice software with poor resources and low interface with flutter

A funny joke practice software with poor resources and low interface, including text, pictures, animation display, video playback, data loading, pull-down refresh

A funny joke practice software with poor resources and low interface, including text, pictures, animation display, video playback, data loading, pull-down refresh

Library used

gave: ^ 3.0.8

For network requests

flutter_redux: ^0.6.0 redux:

For data flow

flutter_easyrefresh: ^2.1.5

Used for pull-down refresh and pull-up loading

fijkplayer: ^0.8.7

For video playback

Main test function

Using the reduxdata series when the data transfer needs to receive updated page data each need, but flutteritself does not have such a function, reduxalso does not provide something of the base class, or not easy to use, not a tube which Therefore the use of this item mixinsto the data required for the respective components of additional features:

import 'dart:async';
import 'package:zuicuo/App.dart';
import 'package:zuicuo/redux/redux.dart';
import 'package:flutter/material.dart';

mixin  ReduxMixin < T  extends  StatefulWidget >  on  State < T > {
   /// stream is because redux uses Stream to notify data changes 
  /// If you want to cancel the monitoring when the page is destroyed, you need to get a stream object while monitoring
  @protected
  StreamSubscription stream;

  @mustCallSuper 
  void  initState () {
     super . initState ();
     /// Monitor the redux data changes when the page is initialized, and trigger it first 
    /// so that you can get the data once you enter the page
    stream = app.store.onChange.listen(connect);
    this.connect(app.store.state);
  }

  /// Rewrite this method in the page to get the entire data
  void connect(AppState state) {}

  @mustCallSuper 
  void  dispose () {
     /// Cancel monitoring when the page is destroyed
    if (stream != null) {
      stream.cancel();
    }
    great . dispose ();
  }
}

It is also very simple to write components, and there is no difference from normal writing. Just use mixins and rewrite the connect method after inheriting the State class:

/// There is nothing special about this paragraph, the same as normal writing
class TextPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _TextPage();
  }
}
/// With ReduxMixin added here is to use this mixin, nothing else changes
class  _TextPage  extends  State < TextPage >  with  ReduxMixin {
   /// Define a variable to store the data in redux
  RecordPaginate<Joke> jokeList;

  /// Rewrite the connect method every time you enter the page or there is a data change 
  /// This method will be triggered to get the latest data
  @override
  void connect(AppState state) {
    var list = state.textJokeList;
    if (list == null || (!list.fetching && !list.loaded)) {
      /// 请求新数据
      dispatch(TextJokeListRequestAction());
    }
    if (list ? .request ==  JokeType .text) {
       /// Refresh the page when the data needed in this component changes
      setState(() {
        jokeList = list;
      });
    }
  }

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

Finished with flowers~~

Download Details:

Author: maichonglyd

Source Code: https://github.com/maichonglyd/flutter-zuicuoduanzi

flutter dart mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

Top 25 Flutter Mobile App Templates in 2020

Flutter has been booming worldwide from the past few years. While there are many popular mobile app development technologies out there, Flutter has managed to leave its mark in the mobile application development world. In this article, we’ve curated the best Flutter app templates available on the market as of July 2020.

Flutter App Development Trends 2020

As the new decade dawns upon us, a slew of technologies has been making a lot of noise to grab the developers’ attention. While native app development is going strong, the trade winds are now blowing towards going cross-platform.

How To Succeed In Mobile App Wireframe Design?

This article covers everything about mobile app wireframe design: what to do and what not, tools used in designing a mobile or web app wireframe, and more.

Top 10 Mobile App Development Companies in India

The mobile application scenario has been continually changing over the years. In recent years India has become a center for mobile app development companies. The increase of smartphones has instantly increased the requirements for these apps. Every year new technological trends occur due to contin