Skip to content

Commit

Permalink
🥞 add toast
Browse files Browse the repository at this point in the history
  • Loading branch information
persilee committed Jun 27, 2020
1 parent 1200bf4 commit 64a0985
Show file tree
Hide file tree
Showing 12 changed files with 176 additions and 70 deletions.
8 changes: 8 additions & 0 deletions .idea/libraries/Dart_Packages.xml

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

26 changes: 22 additions & 4 deletions .idea/workspace.xml

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

1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
64 changes: 64 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
947C51273F193BEAE9739C29 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 292B7BC865034E2FA7DA1DE5 /* libPods-Runner.a */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
Expand Down Expand Up @@ -38,6 +39,9 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
292B7BC865034E2FA7DA1DE5 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2C5D4C160980FE758F3F7867 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3A2E7D8F80DBD0D483802AC2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
56726BE4218E844A000A44ED /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
Expand All @@ -62,12 +66,31 @@
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
947C51273F193BEAE9739C29 /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
20576FF0FBFFE5817EDF9DFC /* Frameworks */ = {
isa = PBXGroup;
children = (
292B7BC865034E2FA7DA1DE5 /* libPods-Runner.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
55523A2C476EEE4C5819EDEA /* Pods */ = {
isa = PBXGroup;
children = (
3A2E7D8F80DBD0D483802AC2 /* Pods-Runner.debug.xcconfig */,
2C5D4C160980FE758F3F7867 /* Pods-Runner.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
Expand All @@ -87,6 +110,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
55523A2C476EEE4C5819EDEA /* Pods */,
20576FF0FBFFE5817EDF9DFC /* Frameworks */,
);
sourceTree = "<group>";
usesTabs = 0;
Expand Down Expand Up @@ -131,12 +156,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
19EEB90539546809826CC709 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
10D7365C722A44D254BF3E30 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -201,6 +228,43 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
10D7365C722A44D254BF3E30 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
19EEB90539546809826CC709 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
3 changes: 3 additions & 0 deletions ios/Runner.xcworkspace/contents.xcworkspacedata

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

45 changes: 19 additions & 26 deletions lib/demo/base_widget_demo/components_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'ButtonDemo',
page: ButtonDemo(),
Expand All @@ -41,7 +40,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'PopupMenuButtonDemo',
page: PopupMenuButtonDemo(),
Expand All @@ -50,7 +48,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'SimpleDialogDemo',
page: SimpleDialogDemo(),
Expand All @@ -59,7 +56,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'AlertDialogDemo',
page: AlertDialogDemo(),
Expand All @@ -68,7 +64,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'BottomSheetDemo',
page: BottomSheetDemo(),
Expand All @@ -77,7 +72,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'SnackBarDemo',
page: SnackBarDemo(),
Expand All @@ -86,7 +80,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'ExpansionPanelDemo',
page: ExpansionPanelDemo(),
Expand All @@ -95,7 +88,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'ChipDemo',
page: ChipDemo(),
Expand All @@ -104,7 +96,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'DataTableDemo',
page: DataTableDemo(),
Expand All @@ -113,7 +104,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'PaginatedDataTableDemo',
page: PaginatedDataTableDemo(),
Expand All @@ -122,7 +112,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
ListItem(
title: 'StepperDemo',
page: StepperDemo(),
Expand All @@ -131,7 +120,6 @@ class ComponentsDome extends StatelessWidget {
color: Colors.black54,
),
),
Divider(),
],
),
);
Expand All @@ -151,20 +139,25 @@ class ListItem extends StatelessWidget {

@override
Widget build(BuildContext context) {
return ListTile(
title: Text(title),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => page),
);
},
leading: icon,
contentPadding: EdgeInsets.only(left: 16.0, right: 6.0),
trailing: Icon(
Icons.keyboard_arrow_right,
color: Colors.black45,
size: 22.0,
),
return Column(
children: <Widget>[
ListTile(
title: Text(title),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => page),
);
},
leading: icon,
contentPadding: EdgeInsets.only(left: 16.0, right: 6.0),
trailing: Icon(
Icons.keyboard_arrow_right,
color: Colors.black45,
size: 22.0,
),
),
Divider(),
],
);
}
}
16 changes: 12 additions & 4 deletions lib/demo/provider_demo/goods_list_demo.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'package:flutter/material.dart';
import 'package:pro_flutter/model/goods_list_model.dart';
import 'package:provider/provider.dart';
import 'package:provider/provider.dart' as prefix0;
import 'package:toast/toast.dart';

class GoodsListDemo extends StatelessWidget {

String title;

GoodsListDemo({this.title});
Expand Down Expand Up @@ -32,11 +31,20 @@ class GoodsListDemo extends StatelessWidget {
return Selector<GoodsListModel, Goods>(
selector: (context, provider) => provider.goodsList[index],
builder: (context, data, child) {
print('No.${index + 1} rebulid');
print('No.${index + 1} rebuild');

return ListTile(
title: Text(data.goodsNo),
trailing: GestureDetector(
onTap: () => provider.collect(index),
onTap: () {
provider.collect(index);
Toast.show(
'No.${index + 1} rebuild',
context,
backgroundColor: Colors.yellow,
textColor: Colors.black87,
);
},
child: Icon(
data.isCollection ? Icons.star : Icons.star_border,
),
Expand Down
Loading

0 comments on commit 64a0985

Please sign in to comment.