Skip to content

Commit

Permalink
Merge pull request #367 from wanbing/dev_wanbing
Browse files Browse the repository at this point in the history
3.4.0 publish
  • Loading branch information
wanbing authored Nov 15, 2023
2 parents 4aac629 + a249f8c commit 4efe957
Show file tree
Hide file tree
Showing 23 changed files with 222 additions and 228 deletions.
5 changes: 5 additions & 0 deletions compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.9.0]
* Support TypeArgumentList.
* Support negative value.
* Fix js isNotEmpty bug.

## [1.8.0]
* Compiler log optimized.

Expand Down
6 changes: 3 additions & 3 deletions compiler/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fair_compiler
description: A complier which can generate Fair bundle for widget with annotation.
version: 1.8.0
version: 1.9.0
homepage: https://fair.58.com/

environment:
Expand Down Expand Up @@ -28,11 +28,11 @@ dependencies:
# fair_annotation:
# path: ../annotation

fair_dart2dsl: ^1.4.0
fair_dart2dsl: ^1.5.0
# fair_dart2dsl:
# path: ../dart2dsl

fair_dart2js: ^1.4.0
fair_dart2js: ^1.5.0
# fair_dart2js:
# path: ../dart2js

Expand Down
5 changes: 5 additions & 0 deletions dart2dsl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.5.0

- Support TypeArgumentList.
- Support Negative Value.

## 1.4.0

- Log optimized.
Expand Down
2 changes: 1 addition & 1 deletion dart2dsl/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fair_dart2dsl
description: Companion compiler for fair_compiler for converting Dart to DSL.
version: 1.4.0
version: 1.5.0
homepage: https://fair.58.com/

environment:
Expand Down
3 changes: 3 additions & 0 deletions dart2js/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.5.0
- fix js isNotEmpty bug.

## 1.4.0

- 升级 analyzer 版本为 5.5.0;
Expand Down
2 changes: 1 addition & 1 deletion dart2js/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fair_dart2js
description: Convert individual dart file to js.
version: 1.4.0
version: 1.5.0
homepage: https://fair.58.com/

environment:
Expand Down
5 changes: 5 additions & 0 deletions fair/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [3.4.0]
* Publish Fair Provider;
* Adaptation to Flutter 3.13;
* Fixed some known issues.

## [3.3.0]
* Runtime log optimization, covering Dart/JS logs;
* Compiler log optimization, removal of redundant/error logs, and enhanced log output;
Expand Down
4 changes: 2 additions & 2 deletions fair/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://fair.58.com/logo.png">
</p>
<p align="center">
<a href="https://pub.dev/packages/fair"><img src="https://img.shields.io/badge/pub-3.3.0-orange" alt="pub"></a>
<a href="https://pub.dev/packages/fair"><img src="https://img.shields.io/badge/pub-3.4.0-orange" alt="pub"></a>
<a href="https://github.com/wuba/fair"><img src="https://img.shields.io/badge/platform-flutter-blue.svg" alt="github"></a>
<a href="https://fair.58.com/"><img src="https://img.shields.io/badge/doc-fair.58.com-green.svg" alt="doc"></a>
<a href="https://github.com/wuba/fair/LICENSE"><img src="https://img.shields.io/badge/license-BSD-green.svg" alt="license"></a>
Expand All @@ -19,7 +19,7 @@ We create Fair so we can dispatch UI changes to users as bundle(s), the way simi
Use Flutter Fair require few steps. Add dependency inside `pubspec.yaml`.
```yaml
dependencies:
fair: ^3.3.0
fair: ^3.4.0
```
Wrap your app with FairApp Widget.
Expand Down
4 changes: 2 additions & 2 deletions fair/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: fair
description: Flutter Fair is a package used to update widget dynamically.
version: 3.3.0
version: 3.4.0
homepage: https://fair.58.com/

environment:
Expand All @@ -16,7 +16,7 @@ dependencies:
# fair_annotation:
# path: ../annotation

fair_version: ^3.0.0
fair_version: ^3.13.0
# fair_version:
# path: ../flutter_version/flutter_2_5_0
flat_buffers: ^2.0.5
Expand Down
2 changes: 2 additions & 0 deletions fair_provider/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## [0.0.1+1]
* Support Provider.
25 changes: 25 additions & 0 deletions fair_provider/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (C) 2005-present, 58.com. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of 58.com nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
139 changes: 41 additions & 98 deletions fair_provider/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void main() {
}

class MyApp extends StatelessWidget {
const MyApp({super.key});
const MyApp({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
Expand All @@ -31,51 +31,46 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.blue,
),
home:
// MyHomePage(title: "dasdasdsa",),
Scaffold(
appBar: AppBar(
title: const Text('Flutter Lab'),
),
body: Builder(
builder: (context) => ListView(
children: [
addItem("计数器示例", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FairWidget(
name: "lib_ui_counter_page",
path:
"assets/fair/lib_ui_counter_page.fair.json",
),
));
}),
addItem("基本使用示例", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FairWidget(
name: "lib_ui_example_page",
path:
"assets/fair/lib_ui_example_page.fair.json",
),
));
}),
addItem("跨页面共享状态", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FairWidget(
name: "lib_ui_example_page2",
path:
"assets/fair/lib_ui_example_page2.fair.json",
),
));
}),
],
),
)));
home: Scaffold(
appBar: AppBar(
title: const Text('Flutter Lab'),
),
body: Builder(
builder: (context) => ListView(
children: [
addItem("计数器示例", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FairWidget(
name: "lib_ui_counter_page",
path: "assets/fair/lib_ui_counter_page.fair.json",
),
));
}),
addItem("基本使用示例", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FairWidget(
name: "lib_ui_example_page",
path: "assets/fair/lib_ui_example_page.fair.json",
),
));
}),
addItem("跨页面共享状态", () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FairWidget(
name: "lib_ui_example_page2",
path: "assets/fair/lib_ui_example_page2.fair.json",
),
));
}),
],
),
)));
}
}

Expand All @@ -102,55 +97,3 @@ Widget addItem(String itemName, dynamic onPress) {
textAlign: TextAlign.left,
)));
}

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});

final String title;

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;

void _incrementCounter() {
setState(() {
_counter++;
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
test(),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}

Widget test() {
return Container();
}
}
2 changes: 1 addition & 1 deletion fair_provider/example/lib/ui/counter_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:flutter/material.dart';

@FairPatch()
class CounterPage extends StatefulWidget {
const CounterPage({super.key});
const CounterPage({Key? key}) : super(key: key);

@override
State<CounterPage> createState() => _CounterPageState();
Expand Down
4 changes: 1 addition & 3 deletions fair_provider/example/lib/ui/example_page.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'dart:math';

import 'package:example/entity/example_model.dart';
import 'package:fair/fair.dart';
import 'package:fair_provider/fair_provider.dart';
import 'package:flutter/material.dart';

@FairPatch()
class ExamplePage extends StatefulWidget {
const ExamplePage({super.key});
const ExamplePage({Key? key}) : super(key: key);

@override
State<ExamplePage> createState() => _ExamplePageState();
Expand Down
23 changes: 10 additions & 13 deletions fair_provider/example/lib/ui/example_page2.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import 'package:example/entity/counter_model.dart';
import 'package:example/entity/top_model.dart';
import 'package:fair/fair.dart';
import 'package:fair_provider/fair_provider.dart';
import 'package:flutter/material.dart';

@FairPatch()
class ExamplePage2 extends StatefulWidget {
const ExamplePage2({super.key});
const ExamplePage2({Key? key}) : super(key: key);

@override
State<ExamplePage2> createState() => _ExamplePage2State();
Expand Down Expand Up @@ -39,22 +38,20 @@ class _ExamplePage2State extends State<ExamplePage2> {
'监听TopModel中的intFiled:',
),
FairConsumer<TopModel>(
builder: SugarProvider.consumerBuilder(
(context, value, child) =>
Text(SugarProvider.readAsString(value, 'intField'))),
builder: SugarProvider.consumerBuilder((context, value, child) =>
Text(SugarProvider.readAsString(value, 'intField'))),
),
],
),
),
floatingActionButton: FairContextBuilder(
builder:
SugarProvider.widgetBuilder((context) => FloatingActionButton(
onPressed: () {
_incrementCounter(context);
},
tooltip: 'Increment',
child: const Icon(Icons.add),
)),
builder: SugarProvider.widgetBuilder((context) => FloatingActionButton(
onPressed: () {
_incrementCounter(context);
},
tooltip: 'Increment',
child: const Icon(Icons.add),
)),
),
);
}
Expand Down
Loading

0 comments on commit 4efe957

Please sign in to comment.