Skip to content

Commit

Permalink
Merge pull request #346 from wanbing/dev_wanbing
Browse files Browse the repository at this point in the history
fair-online update
  • Loading branch information
wanbing authored Sep 18, 2023
2 parents 083178b + edb6508 commit cbf2393
Show file tree
Hide file tree
Showing 79 changed files with 302 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -45,7 +45,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.empty_project"
minSdkVersion 20
targetSdkVersion 31
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.8.10'
repositories {
google()
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@
}
}
}
},
"functionParameters": {
"pa": [
"item"
]
}
}
}
Expand All @@ -388,5 +393,6 @@
}
}
},
"methodMap": {}
"methodMap": {},
"digest": "3b90f4c1dbc6ea9c863a2774299d93f2"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by Fair on 2022-12-02 14:16:24.620246.
# Generated by Fair on 2023-09-18 15:47:53.940271.

source: empty_project|lib/page/hotel_listview/hotel_listview_template.dart
md5: 5d4c50d5061d6964a481368fa30273d7
md5: 4028170fdfe87caf31512bae868d8528
json: empty_project|build/fair/lib_page_hotel_listview_hotel_listview_template.fair.json
date: 2022-12-02 14:16:24.620472
date: 2023-09-18 15:47:53.940525
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ let callBackId = 0;

let FairNet = function () {
return {
request: function (resp) {
requestData: function (resp) {
let respMap = {};
respMap = mapOrSetToObject(resp);
let id = 'FairNet$' + (++callBackId);
let requestParameter = {};
requestParameter['className'] = "FairNet#request";
requestParameter['className'] = "FairNet#requestData";
callBack[id] = [respMap['complete'], respMap['error'], respMap['success']];
respMap['callId'] = id;
requestParameter['funcName'] = 'invokePlugin';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _HotelListViewState extends State<HotelListView> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -74,17 +74,17 @@ class _HotelListViewState extends State<HotelListView> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('ListView.builder模版'),
title: const Text('ListView.builder模版'),
),
backgroundColor: Color(0xFFFEFEFE),
backgroundColor: const Color(0xFFFEFEFE),
body: Sugar.ifEqualBool(isDataEmpty(),
trueValue: Center(
trueValue: () => const Center(
child: Text(
'加载中...',
),
),
falseValue: Container(
color: Color(0xFFFFFFFF),
falseValue: () => Container(
color: const Color(0xFFFFFFFF),
child: ListView(
children: Sugar.map(_listData, builder: (HotelModel item) {
return Padding(
Expand All @@ -104,7 +104,7 @@ class _HotelListViewState extends State<HotelListView> {
fit: BoxFit.cover),
),
Container(
color: Color(0xFFFFFFFF),
color: const Color(0xFFFFFFFF),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FairNet extends IFairPlugin {
return _fairNet;
}

Future<dynamic> request(dynamic map) async {
Future<dynamic> requestData(dynamic map) async {
if (map == null) {
return;
}
Expand Down Expand Up @@ -98,7 +98,7 @@ class FairNet extends IFairPlugin {
@override
Map<String, Function> getRegisterMethods() {
var functions = <String, Function>{};
functions.putIfAbsent('request', () => request);
functions.putIfAbsent('requestData', () => requestData);
return functions;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ dev_dependencies:
flutter_lints: ^1.0.0
fair_compiler:
path: ../../../fair/compiler
build_runner: ^2.0.0
build_runner: ^2.1.2

dependency_overrides:
fair_version:
path: ../../../fair/flutter_version/flutter_3_3_0
collection: 1.17.0
permission_handler: ^10.2.0
analyzer: 5.6.0
dart_style: 2.2.5
dio: 4.0.6


# For information on the generic Dart part of this file, see the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class _@@PageName@@State extends State<@@PageName@@> {
void onUnload() {}

void requestData() {
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -69,12 +69,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
child: Icon(Icons.add),
),
body: Sugar.ifEqualBool(isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: GridView.count(
falseValue: () => GridView.count(
crossAxisCount: 2,
mainAxisSpacing: 10,
crossAxisSpacing: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -78,12 +78,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
),
backgroundColor: Color(0xFFFEFEFE),
body: Sugar.ifEqualBool(isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: Container(
falseValue: () => Container(
color: Color(0xFFFFFFFF),
child: ListView(
children: Sugar.map(_listData, builder: (HotelModel item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -150,12 +150,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
color: Colors.white,
child: Sugar.ifEqualBool(
isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: Sugar.listBuilder(
falseValue: () => Sugar.listBuilder(
itemCount: dataLength(),
itemBuilder: (context, index) {
return Container(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -127,12 +127,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
body: Container(
color: Colors.white,
child: Sugar.ifEqualBool(isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: Sugar.listBuilder(
falseValue: () => Sugar.listBuilder(
itemCount: dataLength(),
itemBuilder: (context, index) {
return SizedBox(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -75,12 +75,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
title: Text('PageView模版'),
),
body: Sugar.ifEqualBool(isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: PageView.custom(
falseValue: () => PageView.custom(
childrenDelegate: Sugar.sliverChildBuilderDelegate(
builder: (context, index) {
return Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -69,12 +69,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
return Scaffold(
body: Sugar.ifEqualBool(
isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: CustomScrollView(
falseValue: () => CustomScrollView(
slivers: <Widget>[
SliverAppBar(
title: Text('CustomScrollView模版'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -71,12 +71,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
),
body: Sugar.ifEqualBool(
isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: StaggeredGrid.count(
falseValue: () => StaggeredGrid.count(
crossAxisCount: 2,
mainAxisSpacing: 10,
crossAxisSpacing: 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class _@@PageName@@State extends State<@@PageName@@> {

void requestData() {
_page++;
FairNet().request({
FairNet().requestData({
'pageName': '#FairKey#',
'method': 'GET',
'url':
Expand Down Expand Up @@ -100,12 +100,12 @@ class _@@PageName@@State extends State<@@PageName@@> {
),
),
body: Sugar.ifEqualBool(isDataEmpty(),
trueValue: Center(
trueValue: () => Center(
child: Text(
'加载中...',
),
),
falseValue: TabBarView(
falseValue: () => TabBarView(
children: <Widget>[
_allTabList(),
_getList(),
Expand Down
Loading

0 comments on commit cbf2393

Please sign in to comment.