return new Scaffold(
appBar: new AppBar(
title: new Text("Listviews"),
),
body: Container(
padding: EdgeInsets.all(16.0),
child: new ListView.builder(
itemCount: data == null ? 0 : data["data"].length,
itemBuilder: (BuildContext context, int index) {
return new GestureDetector(
child: new Card(
child: new Text(data["data"][index]["title"]),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => StandardsControlPage()),
);
},
);
},
),
));
Я думаю, что это сработает.
Вы можете решить проблему, добавив слой:
template <typename T>
struct Foo{
Foo(T elem);
T elem_;
T get(){
return do_get<T>();
}
private:
template <typename U = T>
auto do_get() -> std::enable_if_t<std::is_same<U, int>::value, U>;
template <typename U = T>
auto do_get() -> std::enable_if_t<std::is_same<U, bool>::value, U>;
};
//If definitions for the do_get functions are provided before these
//explicit template instantiation definitions, the compiler will certainly
//inline those definitions.
template class Foo<int>;
template class Foo<bool>;