modify:toast and andrid apk label

This commit is contained in:
xiaojia22326@163.com
2019-01-25 20:54:12 +08:00
parent a77af3728a
commit baecc158a9
5 changed files with 39 additions and 78 deletions

View File

@ -16,7 +16,7 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="菜鸟手册"
android:label="flutter go"
android:icon="@drawable/logo">
<activity
android:name=".MainActivity"

View File

@ -10,7 +10,6 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
333E5DAE7FC10AC69FEC26C0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDA792F029EDD7A11295D192 /* libPods-Runner.a */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
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, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
@ -41,7 +40,6 @@
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>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@ -92,7 +90,6 @@
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
@ -209,7 +206,6 @@
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);

View File

@ -26,27 +26,18 @@ class _CheckedPopupMenuItemDemoState extends State<CheckedPopupMenuItemDemo> {
_checkedValues = <String>[_checkedValue3];
}
void showInSnackBar(String value){
Fluttertoast.instance.showToast(
msg: value,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIos: 1,
backgroundColor: Colors.grey,
textColor: Colors.white
);
}
bool isChecked(String value) => _checkedValues.contains(value);
void showCheckedMenuSelections(String value){
if(_checkedValues.contains(value)){
_checkedValues.remove(value);
}else{
_checkedValues.add(value);
}
showInSnackBar('Checked $_checkedValues');
Scaffold.of(context).showSnackBar(new SnackBar(
content: new Text('Checked $_checkedValues')));
}
@override

View File

@ -5,7 +5,6 @@
* @Last Modified time: 2018-12-27 15:39:35
*/
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
class PopupMenuButtonDemo extends StatefulWidget {
_PopupMenuButtonDemoState createState() => _PopupMenuButtonDemoState();
@ -20,18 +19,11 @@ class _PopupMenuButtonDemoState extends State<PopupMenuButtonDemo> {
void showMenuSelection(String value) {
if (<String>[_simpleValue1, _simpleValue2, _simpleValue3].contains(value))
_simpleValue = value;
showInSnackBar('You selected: $value');
Scaffold.of(context).showSnackBar(new SnackBar(
content: new Text('You selected: $value')));
}
void showInSnackBar(String value) {
Fluttertoast.instance.showToast(
msg: value,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIos: 1,
backgroundColor: Colors.grey,
textColor: Colors.white);
}
@override
void initState() {

View File

@ -5,28 +5,21 @@
* @Last Modified time: 2018-12-27 15:45:26
*/
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
class PopupMenuDividerDemo extends StatelessWidget {
class PopupMenuDividerDemo extends StatefulWidget {
_PopupMenuDividerDemoState createState() => _PopupMenuDividerDemoState();
}
class _PopupMenuDividerDemoState extends State<PopupMenuDividerDemo> {
void showInSnackBar(String value) {
Fluttertoast.instance.showToast(
msg: value,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIos: 1,
backgroundColor: Colors.grey,
textColor: Colors.white);
Scaffold.of(context)
.showSnackBar(new SnackBar(content: new Text('You selected: $value')));
}
@override
Widget build(BuildContext context) {
return Container(
child:ListTile(
child: ListTile(
title: const Text('An item with a sectioned menu'),
trailing: PopupMenuButton<String>(
padding: EdgeInsets.zero,
@ -36,34 +29,23 @@ class PopupMenuDividerDemo extends StatelessWidget {
value: 'Preview',
child: ListTile(
leading: Icon(Icons.visibility),
title: Text('Preview')
)
),
title: Text('Preview'))),
const PopupMenuItem<String>(
value: 'Share',
child: ListTile(
leading: Icon(Icons.person_add),
title: Text('Share')
)
),
title: Text('Share'))),
const PopupMenuItem<String>(
value: 'Get Link',
child: ListTile(
leading: Icon(Icons.link),
title: Text('Get link')
)
),
title: Text('Get link'))),
const PopupMenuDivider(),
const PopupMenuItem<String>(
value: 'Remove',
child: ListTile(
leading: Icon(Icons.delete),
title: Text('Remove')
)
)
]
)
),
leading: Icon(Icons.delete), title: Text('Remove')))
])),
);
}
}