Commit a1979212 authored by 林生雨's avatar 林生雨

add router

parent ae02e980
......@@ -2,7 +2,6 @@ package io.flutter.plugins;
import io.flutter.plugin.common.PluginRegistry;
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin;
import flutter.transer.wanmeizhensuo.com.native_flutter_transfer_plugin.NativeFlutterTransferPlugin;
import fleamarket.taobao.com.xservicekit.XserviceKitPlugin;
/**
......@@ -14,7 +13,6 @@ public final class GeneratedPluginRegistrant {
return;
}
FlutterBoostPlugin.registerWith(registry.registrarFor("com.taobao.idlefish.flutterboost.FlutterBoostPlugin"));
NativeFlutterTransferPlugin.registerWith(registry.registrarFor("flutter.transer.wanmeizhensuo.com.native_flutter_transfer_plugin.NativeFlutterTransferPlugin"));
XserviceKitPlugin.registerWith(registry.registrarFor("fleamarket.taobao.com.xservicekit.XserviceKitPlugin"));
}
......
......@@ -35,9 +35,9 @@ buildDir = new File(rootProject.projectDir, "../build/host")
dependencies {
implementation project(':flutter')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:design:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.12'
......
sdk.dir=/Users/mac/Library/Android/sdk
flutter.sdk=/Users/mac/development/flutter
\ No newline at end of file
sdk.dir=/Users/apple/Library/Android/sdk
flutter.sdk=/Users/apple/Downloads/flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
\ No newline at end of file
......@@ -4,14 +4,12 @@
#import "GeneratedPluginRegistrant.h"
#import <flutter_boost/FlutterBoostPlugin.h>
#import <native_flutter_transfer_plugin/NativeFlutterTransferPlugin.h>
#import <xservice_kit/XserviceKitPlugin.h>
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[FlutterBoostPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterBoostPlugin"]];
[NativeFlutterTransferPlugin registerWithRegistrar:[registry registrarForPlugin:@"NativeFlutterTransferPlugin"]];
[XserviceKitPlugin registerWithRegistrar:[registry registrarForPlugin:@"XserviceKitPlugin"]];
}
......
......@@ -18,6 +18,5 @@ Depends on all your plugins, and provides a function to register them.
s.public_header_files = './Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'flutter_boost'
s.dependency 'native_flutter_transfer_plugin'
s.dependency 'xservice_kit'
end
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/mac/development/flutter
FLUTTER_APPLICATION_PATH=/Users/mac/code/GMAlpha/gmalpha_flutter
FLUTTER_TARGET=/Users/mac/code/GMAlpha/gmalpha_flutter/lib/main.dart
FLUTTER_ROOT=/Users/apple/Downloads/flutter
FLUTTER_APPLICATION_PATH=/Users/apple/lsy/gmalpha_flutter
FLUTTER_TARGET=/Users/apple/lsy/gmalpha_flutter/lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
TRACK_WIDGET_CREATION=true
platform :ios, '8.0'
#open source
source 'https://github.com/CocoaPods/Specs.git'
#our company
source 'git@git.wanmeizhensuo.com:gengmeiios/GMSpecs.git'
target 'Runner' do
flutter_application_path = '../'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
......
This diff is collapsed.
flutter packages pub run build_runner clean
flutter packages pub run build_runner build
\ No newline at end of file
targets:
$default:
builders:
code_gen_demo|mark_builder:
enabled: true
builders:
Router:
import: "package:gmalpha_flutter/Router/RouterBuilder.dart"
builder_factories: ["routerBuilder"]
build_extensions: {'.dart': ['.rout.dart'] }
auto_apply: root_package
runs_before: ['routerCenter']
build_to: source
routerCenter:
import: "package:gmalpha_flutter/Router/RouterBuilder.dart"
builder_factories: ["routerCenterBuilder"]
build_extensions: {'.dart': ['.mark.dart'] }
auto_apply: root_package
build_to: source
/*
* @author lsy
* @date 2019-09-02
**/
import 'package:analyzer/dart/element/element.dart';
import 'package:build/src/builder/build_step.dart';
import 'package:gmalpha_flutter/Router/RouterBaser.dart';
import 'package:gmalpha_flutter/Router/anno/RouterCenter.dart';
import 'package:gmalpha_flutter/Router/RouterCenterRestore.dart';
import 'package:source_gen/source_gen.dart';
class RouterCenterGenerator extends GeneratorForAnnotation<RouterCenter> {
@override
generateForAnnotatedElement(
Element element, ConstantReader annotation, BuildStep buildStep) {
StringBuffer buffer = new StringBuffer();
StringBuffer importBuffer = new StringBuffer();
StringBuffer funBuffer = new StringBuffer();
RouterCenterRestore().buildMap.forEach((f, s) {
buffer.write("map.putIfAbsent(\"${f}\", ()=>${s.second}());\n");
importBuffer.write("${s.first}${s.second}.dart\";\n");
importBuffer.write("${s.first}${s.third}.dart\";\n");
funBuffer.write("""
${s.third} find${s.third}(){
if(map[\"${f}\"]==null){
return null;
}
return map[\"${f}\"] as ${s.third};
}
""");
});
var pathSegments = buildStep.inputId.pathSegments;
StringBuffer pathBuffer = new StringBuffer();
for (int i = 0; i < pathSegments.length; i++) {
if (pathSegments[i] != "lib" && i != pathSegments.length - 1) {
pathBuffer.write(pathSegments[i] + "/");
}
}
String sufPath = pathBuffer.toString();
return """
${importBuffer.toString()}
import "${"package:${buildStep.inputId.package}/${sufPath}RouterCenterRestore.dart"}";
import "${"package:${buildStep.inputId.package}/${sufPath}RouterBaser.dart"}";
class RouterCenterImpl {
Map<String,RouterBaser> map;
factory RouterCenterImpl() => _sharedInstance();
static RouterCenterImpl _instance;
RouterCenterImpl._() {
if (map == null) {
map = new Map();
init();
} else {
throw Exception("too many RouterCenter instance!!! fix it ");
}
}
static RouterCenterImpl _sharedInstance(){
if (_instance == null) {
_instance = RouterCenterImpl._();
}
return _instance;
}
void init(){
${buffer.toString()}
}
RouterBaser getModel(String modelName){
return map[modelName];
}
${funBuffer.toString()}
}
""";
}
}
/*
* @author lsy
* @date 2019-09-02
**/
import 'dart:math';
import 'package:analyzer/dart/element/element.dart';
import 'package:build/src/builder/build_step.dart';
import 'package:gmalpha_flutter/Router/base/RouterBuildItem.dart';
import 'package:gmalpha_flutter/Router/anno/Router.dart';
import 'package:gmalpha_flutter/Router/anno/RouterCenter.dart';
import 'package:gmalpha_flutter/Router/RouterCenterRestore.dart';
import 'package:source_gen/source_gen.dart';
class RouterGenerator extends GeneratorForAnnotation<Router> {
@override
generateForAnnotatedElement(
Element element, ConstantReader annotation, BuildStep buildStep) {
var modelName = annotation.peek("modelName").stringValue;
var typeValue = annotation.peek("impl").typeValue;
var pathSegments = buildStep.inputId.pathSegments;
StringBuffer buffer = new StringBuffer();
String interfaceName;
for (int i = 0; i < pathSegments.length; i++) {
if (pathSegments[i] != "lib" && i != pathSegments.length - 1) {
buffer.write(pathSegments[i] + "/");
} else if (i == pathSegments.length - 1) {
// buffer.write("${typeValue.name}.dart");
interfaceName = pathSegments[i].replaceAll(".dart", "");
}
}
String first =
"import \"package:${buildStep.inputId.package}/${buffer.toString()}";
String second = typeValue.name;
String third = interfaceName;
RouterBuildItem item = new RouterBuildItem(first, second, third);
if (RouterCenterRestore().buildMap[modelName] != null) {
throw Exception("router error have same model name !!! change it name ");
}
RouterCenterRestore().buildMap.putIfAbsent(modelName, () => item);
// return """
//// import ${"package:${buildStep.inputId.package}/${buildStep.inputId.path.replaceFirst('lib/', '')}"}
// class APT {
// Map<String,RouterBaser> map={};
// }
// """;
return null;
}
}
/*
* @author lsy
* @date 2019-09-02
**/
abstract class RouterBaser{
}
import 'package:gmalpha_flutter/Router/Generator/RouterGenerator.dart';
import 'package:gmalpha_flutter/Router/Generator/RouterCenterGenerator.dart';
import 'package:source_gen/source_gen.dart';
import 'package:build/src/builder/builder.dart';
Builder routerBuilder(BuilderOptions options) =>
LibraryBuilder(RouterGenerator(), generatedExtension: ".rout.dart");
Builder routerCenterBuilder(BuilderOptions options) =>
LibraryBuilder(RouterCenterGenerator(), generatedExtension: ".mark.dart");
/*
* @author lsy
* @date 2019-09-02
**/
import 'package:gmalpha_flutter/Router/base/RouterBuildItem.dart';
import 'package:gmalpha_flutter/Router/RouterBaser.dart';
import 'package:gmalpha_flutter/Router/anno/RouterCenter.dart';
@RouterCenter()
class RouterCenterRestore {
Map<String, RouterBuildItem> buildMap;
factory RouterCenterRestore() => _sharedInstance();
static RouterCenterRestore _instance;
RouterCenterRestore._() {
print("INITTT ");
if (buildMap == null) {
buildMap = new Map();
} else {
throw Exception("too many RouterCenter instance!!! fix it ");
}
}
static RouterCenterRestore _sharedInstance() {
if (_instance == null) {
_instance = RouterCenterRestore._();
}
return _instance;
}
}
// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// RouterCenterGenerator
// **************************************************************************
import "package:gmalpha_flutter/messageModel/MessageRouterImpl.dart";
import "package:gmalpha_flutter/messageModel/MessageRouter.dart";
import "package:gmalpha_flutter/Router/RouterCenterRestore.dart";
import "package:gmalpha_flutter/Router/RouterBaser.dart";
class RouterCenterImpl {
Map<String, RouterBaser> map;
factory RouterCenterImpl() => _sharedInstance();
static RouterCenterImpl _instance;
RouterCenterImpl._() {
if (map == null) {
map = new Map();
init();
} else {
throw Exception("too many RouterCenter instance!!! fix it ");
}
}
static RouterCenterImpl _sharedInstance() {
if (_instance == null) {
_instance = RouterCenterImpl._();
}
return _instance;
}
void init() {
map.putIfAbsent("messageModel", () => MessageRouterImpl());
}
RouterBaser getModel(String modelName) {
return map[modelName];
}
MessageRouter findMessageRouter() {
if (map["messageModel"] == null) {
return null;
}
return map["messageModel"] as MessageRouter;
}
}
/*
* @author lsy
* @date 2019-09-02
**/
library Router;
class Router {
final String modelName;
final Type impl;
const Router(this.modelName, this.impl);
}
/*
* @author lsy
* @date 2019-09-02
**/
library RouterCenter;
class RouterCenter {
const RouterCenter();
}
/*
* @author lsy
* @date 2019-09-02
**/
class RouterBuildItem<S, T, Z> {
S first;
T second;
Z third;
RouterBuildItem(this.first, this.second,this.third);
}
\ No newline at end of file
......@@ -9,17 +9,18 @@
import 'package:dio/dio.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter/material.dart';
import 'macros/ALColors.dart';
import 'macros/ALDevice.dart';
import 'netWork/DioUtil.dart';
import 'toast/toast.dart';
import 'package:native_flutter_transfer_plugin/native_flutter_transfer_plugin.dart';
import 'commonModel/ui/ALColors.dart';
import 'commonModel/ui/ALDevice.dart';
import 'commonModel/net/DioUtil.dart';
import 'commonModel/toast/toast.dart';
//import 'package:native_flutter_transfer_plugin/native_flutter_transfer_plugin.dart';
class CommentSuggest extends StatelessWidget {
final Map params;
CommentSuggest(this.params);
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: '意见与建议',
......@@ -164,7 +165,7 @@ class _CommentSuggestPageState extends State<CommentSuggestPage> {
}
void confirmClick() {
NativeFlutterTransferPlugin.track('click_comment_suggest', {'comment_id': '10086'});
// NativeFlutterTransferPlugin.track('click_comment_suggest', {'comment_id': '10086'});
confimSuggestInfo();
}
......
applicationInit() async {
}
import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:gmalpha_flutter/macros/ALColors.dart';
import 'pages/message/home/message_home.dart';
import 'package:gmalpha_flutter/netWork/DioUtil.dart';
import 'package:gmalpha_flutter/Router/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/app_module.dart';
import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
import 'package:dio/dio.dart';
import 'package:gmalpha_flutter/messageModel/home/message_home.dart';
import 'comment_suggest.dart';
void main() {
void main() async {
await applicationInit();
runApp(MyApp());
}
......@@ -24,7 +27,6 @@ class _MyAppState extends State<MyApp> {
FlutterBoost.singleton.registerPageBuilders({
'comment_suggest': (pageName, params, _) => CommentSuggest(params),
'message_home': (pageName, params, _) => MessageHomePage(params),
});
FlutterBoost.handleOnStartPage();
......@@ -32,22 +34,34 @@ class _MyAppState extends State<MyApp> {
void _init() {
BaseOptions options = DioUtil.getDefOptions();
Map<String, dynamic> cookie = {'cookie': '_gm_token=1987651565078867; _gtid=7b19ca1cb4d511e9bf97525400e82fab4241; sessionid=d45sucgkl5frearp8qoezpjio65z8svh;'};
HttpConfig config = new HttpConfig(options: options, nativeCookie:cookie);
Map<String, dynamic> cookie = {
'cookie':
'_gm_token=1987651565078867; _gtid=7b19ca1cb4d511e9bf97525400e82fab4241; sessionid=d45sucgkl5frearp8qoezpjio65z8svh;'
};
HttpConfig config = new HttpConfig(options: options, nativeCookie: cookie);
DioUtil().setConfig(config);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Boost example',
debugShowCheckedModeBanner: false,
initialRoute: '/test',//调试的时候可以打开
routes: {
// '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}),
'/': (context) => MessageHomePage({}) ,
},//调试的时候可以打开
builder: FlutterBoost.init(postPush: _onRoutePushed),
theme: new ThemeData(
title: 'Flutter Boost example',
debugShowCheckedModeBanner: false,
initialRoute: '/test',
//调试的时候可以打开
routes: {
// '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}),
'/': (context) {
var findMessageRouter = RouterCenterImpl().findMessageRouter();
if (findMessageRouter == null) {
return null;
}
return findMessageRouter.getMessagePage({});
},
},
//调试的时候可以打开
builder: FlutterBoost.init(postPush: _onRoutePushed),
theme: new ThemeData(
primaryColor: Colors.white,
backgroundColor: Color(0xFFEFEFEF),
accentColor: Color(0xFF888888),
......@@ -64,6 +78,5 @@ class _MyAppState extends State<MyApp> {
}
void _onRoutePushed(
String pageName, String uniqueId, Map params, Route route, Future _) {
}
String pageName, String uniqueId, Map params, Route route, Future _) {}
}
/*
* @author lsy
* @date 2019-09-03
**/
import 'package:flutter/cupertino.dart';
import 'package:gmalpha_flutter/Router/RouterBaser.dart';
import 'package:gmalpha_flutter/Router/anno/Router.dart';
import 'package:gmalpha_flutter/messageModel/MessageRouterImpl.dart';
@Router("messageModel",MessageRouterImpl)
abstract class MessageRouter implements RouterBaser{
void openMessagePage(Map map,BuildContext context);
Widget getMessagePage(Map map);
}
\ No newline at end of file
/*
* @author lsy
* @date 2019-09-03
**/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/messageModel/MessageRouter.dart';
import 'package:gmalpha_flutter/messageModel/home/message_home.dart';
class MessageRouterImpl implements MessageRouter {
@override
void openMessagePage(Map map, BuildContext context) {
Navigator.pushReplacement(context,
new MaterialPageRoute(builder: (context) => MessageHomePage(map)));
}
@override
Widget getMessagePage(Map map) {
return MessageHomePage(map);
}
}
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/base/list_item.dart';
import 'package:gmalpha_flutter/netWork/DioUtil.dart';
import 'package:gmalpha_flutter/commonModel/list_item.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class AttentionList extends StatefulWidget {
......@@ -10,6 +10,11 @@ class AttentionList extends StatefulWidget {
class _AttentionListState extends State<AttentionList> {
@override
Widget build(BuildContext context) {
// TODO: implement build
return null;
}
// @override
// List<ListItem> messageList = List<ListItem>();
// List<ListItem> dataArr = List<ListItem>();
// int pageIndex = 1;
......
import 'package:flutter/material.dart';
import 'package:dio/dio.dart';
import 'package:gmalpha_flutter/messageModel/home/message_notification_item.dart';
import 'package:gmalpha_flutter/messageModel/model/message/message.dart';
// import 'package:gmalpha_flutter/model/message/message.dart' as prefix0;
import 'package:gmalpha_flutter/pages/message/home/message_notification_item.dart';
import 'message_item.dart';
import 'package:gmalpha_flutter/model/message/message.dart';
import 'package:gmalpha_flutter/netWork/DioUtil.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:gmalpha_flutter/base/list_item.dart';
import 'package:gmalpha_flutter/commonModel/list_item.dart';
class MessageHomePage extends StatefulWidget {
......
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/model/message/message.dart';
import 'package:gmalpha_flutter/messageModel/model/message/message.dart';
class MessageItem extends StatelessWidget {
final Message message;
......
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/model/message/message.dart';
import 'package:gmalpha_flutter/macros/ALColors.dart';
import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart';
import 'package:gmalpha_flutter/messageModel/model/message/message.dart';
class MessageNotificationItem extends StatelessWidget {
final NotificationItem notification;
......
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/base/list_item.dart';
import 'package:gmalpha_flutter/model/message/replied_content.dart';
import 'package:gmalpha_flutter/commonModel/list_item.dart';
import 'package:gmalpha_flutter/messageModel/model/message/replied_content.dart';
// The base class for the different types of items the list can contain.
// abstract class ListItem {}
......
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/base/list_item.dart';
import 'package:gmalpha_flutter/commonModel/list_item.dart';
class NotificationModel extends ListItem {
int id;
......
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/netWork/DioUtil.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
import 'package:gmalpha_flutter/messageModel/model/message/message.dart';
import 'package:gmalpha_flutter/messageModel/model/notification_model.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:gmalpha_flutter/base/list_item.dart';
import 'package:gmalpha_flutter/model/notification_model.dart';
import 'package:gmalpha_flutter/commonModel/list_item.dart';
import '../home/message_item.dart';
import '../home/message_notification_item.dart';
class NotificationList extends StatefulWidget {
......
import 'package:flutter/material.dart';
import '../netWork/ALNetWork.dart';
import '../commonModel/net/ALNetWork.dart';
void main() => runApp(MaterialApp(
home: NetWorkTestPage(),
......
......@@ -293,15 +293,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.6+3"
native_flutter_transfer_plugin:
dependency: "direct dev"
description:
path: "."
ref: "0.0.2.4"
resolved-ref: faa3e39513f840c3703c7627f6f5423c18d3d62c
url: "git@git.wanmeizhensuo.com:mobile/native_flutter_transfer_plugin.git"
source: git
version: "0.0.1"
package_config:
dependency: transitive
description:
......@@ -392,7 +383,7 @@ packages:
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
dependency: "direct dev"
description:
name: source_gen
url: "https://pub.flutter-io.cn"
......
......@@ -23,7 +23,6 @@ environment:
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
......@@ -33,9 +32,11 @@ dependencies:
build_runner: ^1.6.1
pull_to_refresh: ^1.5.0
# flutter_easyrefresh: ^1.2.7 # 上拉下拉刷新组件
dev_dependencies:
source_gen: '>=0.8.0'
flutter_test:
sdk: flutter
......@@ -44,10 +45,10 @@ dev_dependencies:
url: 'https://github.com/alibaba/flutter_boost.git'
ref: '0.0.411'
native_flutter_transfer_plugin:
git:
url: 'git@git.wanmeizhensuo.com:mobile/native_flutter_transfer_plugin.git'
ref: '0.0.2.4'
# native_flutter_transfer_plugin:
# git:
# url: 'git@git.wanmeizhensuo.com:mobile/native_flutter_transfer_plugin.git'
# ref: '0.0.2.4'
# For information on the generic Dart part of this file, see the
......
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gmalpha_flutter/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment