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
For network requests
For data flow
Used for pull-down refresh and pull-up loading
For video playback
Using the redux
data series when the data transfer needs to receive updated page data each need, but flutter
itself does not have such a function, redux
also does not provide something of the base class, or not easy to use, not a tube which Therefore the use of this item mixins
to 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~~
Author: maichonglyd
Source Code: https://github.com/maichonglyd/flutter-zuicuoduanzi
Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web
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.
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.
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.
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