backup. before shop update
This commit is contained in:
31
lib/dialog/image_viewer.dart
Normal file
31
lib/dialog/image_viewer.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
|
||||
class ImageViewer extends StatefulWidget {
|
||||
final Key key;
|
||||
final ImageProvider imageProvider;
|
||||
|
||||
ImageViewer(this.imageProvider, {this.key}) :
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() {
|
||||
return ImageViewState();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ImageViewState extends State<ImageViewer> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width - 100.0,
|
||||
height: MediaQuery.of(context).size.height - 120.0,
|
||||
child: PhotoView(
|
||||
imageProvider: widget.imageProvider,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
52
lib/dialog/logout_dialog.dart
Normal file
52
lib/dialog/logout_dialog.dart
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../events/eventbus.dart';
|
||||
import '../events/events.dart';
|
||||
import '../generated/l10n.dart';
|
||||
import '../routes.dart';
|
||||
import '../store/actions.dart';
|
||||
import '../store/store.dart';
|
||||
import '../utils/utils.dart';
|
||||
|
||||
AlertDialog logoutDialog(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(S
|
||||
.of(context)
|
||||
.warning),
|
||||
content: Text(S
|
||||
.of(context)
|
||||
.are_you_sure_to_logout),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
child: Text(S
|
||||
.of(context)
|
||||
.cancel),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
FlatButton(
|
||||
child: Text(S
|
||||
.of(context)
|
||||
.yes_i_am_sure),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
Utils.getBox().then((box) {
|
||||
box.delete(Constants.KEY_USER_ID);
|
||||
box.delete(
|
||||
Constants.KEY_ACCESS_TOKEN);
|
||||
store.dispatch(
|
||||
new UpdateCurrentUser(null));
|
||||
eventBus.fire(
|
||||
new OnCurrentUserUpdated());
|
||||
Routes.router.navigateTo(
|
||||
context, '/', replace: true,
|
||||
clearStack: true);
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user