Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- body: ListView.builder(
- itemCount: userData == null ? 0 : userData.length,
- itemBuilder: (BuildContext context, int index) {
- return InkWell(
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Row(
- children: <Widget>[
- Container(
- margin: EdgeInsets.only(top: 16.0),
- child: Material(
- elevation: 14.0,
- borderRadius: BorderRadius.circular(12.0),
- shadowColor: globals.isDarkTheme
- ? Colors.grey[700]
- : Color(0x802196F3),
- color:
- globals.isDarkTheme ? Colors.grey[850] : Colors.white,
- child: InkWell(
- onTap: () {
- var route = new MaterialPageRoute(
- builder: (BuildContext context) =>
- new ActionServerPage(
- server: User(
- id:
- userData[index]["attributes"]
- ["identifier"],
- name: userData[index]["attributes"]
- ["name"])),
- );
- Navigator.of(context).push(route);
- },
- child: Padding(
- padding: EdgeInsets.all(30.0),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- /// Title and rating
- Column(
- mainAxisAlignment: MainAxisAlignment.center,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- '${userData[index]["attributes"]["description"]}',
- style:
- TextStyle(color: Colors.blueAccent)),
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment:
- CrossAxisAlignment.center,
- children: <Widget>[
- Text(
- '${userData[index]["attributes"]["name"]}',
- style: TextStyle(
- color: globals.isDarkTheme
- ? Colors.white
- : Colors.black,
- fontWeight: FontWeight.w700,
- fontSize: 18.0)),
- ],
- ),
- ],
- ),
- /// Infos
- Row(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: <Widget>[
- Text(
- DemoLocalizations.of(context)
- .trans('total_ram'),
- style: TextStyle(
- color: globals.isDarkTheme
- ? Colors.white
- : Colors.black,
- )),
- Padding(
- padding:
- EdgeInsets.symmetric(horizontal: 4.0),
- child: Material(
- borderRadius: BorderRadius.circular(8.0),
- color: Colors.green,
- child: Padding(
- padding: EdgeInsets.all(4.0),
- child: Text(
- '${userData[index]["attributes"]["limits"]["memory"]} MB',
- style: TextStyle(
- fontWeight: FontWeight.w700,
- color: Colors.white)),
- ),
- ),
- ),
- Text(
- DemoLocalizations.of(context)
- .trans('total_disk'),
- style: TextStyle(
- color: globals.isDarkTheme
- ? Colors.white
- : Colors.black,
- )),
- Padding(
- padding:
- EdgeInsets.symmetric(horizontal: 4.0),
- child: Material(
- borderRadius: BorderRadius.circular(8.0),
- color: Colors.green,
- child: Padding(
- padding: EdgeInsets.all(4.0),
- child: Text(
- '${userData[index]["attributes"]["limits"]["disk"]} MB',
- style: TextStyle(
- fontWeight: FontWeight.w700,
- color: Colors.white)),
- ),
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- ),
- ),
- ),
- Spacer(),
- ],
- ),
- ),
- );
- },
- ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement