mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-08-06 17:48:43 +08:00
modify:toast and andrid apk label
This commit is contained in:
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -5,65 +5,47 @@
|
||||
* @Last Modified time: 2018-12-27 15:45:26
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
class PopupMenuDividerDemo extends StatefulWidget {
|
||||
_PopupMenuDividerDemoState createState() => _PopupMenuDividerDemoState();
|
||||
}
|
||||
|
||||
|
||||
class PopupMenuDividerDemo extends StatelessWidget {
|
||||
|
||||
|
||||
void showInSnackBar(String value) {
|
||||
Fluttertoast.instance.showToast(
|
||||
msg: value,
|
||||
toastLength: Toast.LENGTH_SHORT,
|
||||
gravity: ToastGravity.CENTER,
|
||||
timeInSecForIos: 1,
|
||||
backgroundColor: Colors.grey,
|
||||
textColor: Colors.white);
|
||||
class _PopupMenuDividerDemoState extends State<PopupMenuDividerDemo> {
|
||||
void showInSnackBar(String value) {
|
||||
Scaffold.of(context)
|
||||
.showSnackBar(new SnackBar(content: new Text('You selected: $value')));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child:ListTile(
|
||||
title: const Text('An item with a sectioned menu'),
|
||||
trailing: PopupMenuButton<String>(
|
||||
child: ListTile(
|
||||
title: const Text('An item with a sectioned menu'),
|
||||
trailing: PopupMenuButton<String>(
|
||||
padding: EdgeInsets.zero,
|
||||
onSelected: showInSnackBar,
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Preview',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.visibility),
|
||||
title: Text('Preview')
|
||||
)
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Share',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.person_add),
|
||||
title: Text('Share')
|
||||
)
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Get Link',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.link),
|
||||
title: Text('Get link')
|
||||
)
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Remove',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.delete),
|
||||
title: Text('Remove')
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Preview',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.visibility),
|
||||
title: Text('Preview'))),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Share',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.person_add),
|
||||
title: Text('Share'))),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Get Link',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.link),
|
||||
title: Text('Get link'))),
|
||||
const PopupMenuDivider(),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'Remove',
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.delete), title: Text('Remove')))
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user