You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.8 KiB
Dart

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:flutter/material.dart';
import '../../custom_icons/icons_data.dart';
import '../../custom_icons/icons_name.dart';
class DetailsPage extends StatelessWidget {
final String arguments; //id of icon
DetailsPage({Key key, this.arguments = 'text'}) : super(key: key);
@override
Widget build(BuildContext context) {
String s = '图标ID $arguments' + '\n图标名称:' + iconNameList[int.parse(arguments)];
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
print('返回上一页');
Navigator.pop(context);
},
),
title: Text('联系人详情页'),
),
body: FutureBuilder(
future: null,
builder: (context, snapshot) {
if (snapshot.hasData) {
return Stack(
children: <Widget>[
ListView(
children: <Widget>[
Text(arguments),
],
),
Positioned(
bottom: 0,
left: 0,
child: null,
)
],
);
} else {
//return Text('加载中........');
return Container(
alignment: Alignment(0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
iconList[int.parse(arguments)],
size: 200,
color: Colors.black,
),
SizedBox(height: 10,),
Text(s),
],
),
);
}
},
),
);
}
}