1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-16 18:28:51 +01:00
git-touch-android-ios-app/lib/ios/user.dart
2018-04-22 01:07:22 +08:00

40 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../utils.dart';
class IosUserPage extends StatelessWidget {
String login;
String avatar;
IosUserPage(this.login, this.avatar);
@override
build(context) {
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(
leading: new CupertinoButton(
child: const Text('Cancel'),
padding: EdgeInsets.zero,
onPressed: () {
Navigator.of(context).pop(false);
},
),
middle: new Text(login),
),
child: new FutureBuilder(
future: fetchUser(login),
builder: (context, snapshot) {
Widget widget;
if (snapshot.hasData) {
User user = snapshot.data;
return new Text('');
} else if (snapshot.hasError) {
widget = new Text("${snapshot.error}");
} else {
widget = new CupertinoActivityIndicator();
}
return widget;
},
));
}
}