Database 无法使用Flatter从Firestore获取数据

Database 无法使用Flatter从Firestore获取数据,database,flutter,google-cloud-firestore,flutter-futurebuilder,Database,Flutter,Google Cloud Firestore,Flutter Futurebuilder,我正在尝试使用flatter从CloudFireStore检索一些数据。我使用circularprogress指示器显示它仍在获取数据,但它继续运行,好像没有接收任何数据一样。我是一个新手,所以我不知道为什么会发生这种情况,我已经尝试了所有的方法(可能这与设置状态有关,但我不太清楚这个概念) 我没有收到任何错误,但应用程序没有从Firestore数据库获取信息。 共享完整代码 完整代码 import 'package:cloud_firestore/cloud_firestore.dart';

我正在尝试使用flatter从CloudFireStore检索一些数据。我使用circularprogress指示器显示它仍在获取数据,但它继续运行,好像没有接收任何数据一样。我是一个新手,所以我不知道为什么会发生这种情况,我已经尝试了所有的方法(可能这与设置状态有关,但我不太清楚这个概念)

我没有收到任何错误,但应用程序没有从Firestore数据库获取信息。 共享完整代码

完整代码

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';



import 'login_caller.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.

// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    Future getdata() async{
      final firestore =FirebaseFirestore.instance;
      await Firebase.initializeApp();
      QuerySnapshot snapshot =await firestore.collection('CanUSupport').get();
      return await snapshot.docs;
    }
    var document = [];
    var foundations = [
      {
        'Name': 'Sanshil Foundation for Welfare',
        'Requirements': ['Chairs (6)', 'Tables (234)'],
      },
      {
        'Name': 'Ram Kala Sadan Trust',
        'Requirements': ['Chairs (5)', 'Tables (7)', 'Pencils (7899)'],
      },
    ];
    var call = [
      {
        'Name': 'Sanshil Foundation for Welfare',
        'Number': '098733 29733',
      },
      {
        'Name': 'Ram Kala Sadan Trust',
        'Number': "072918 25705",
      },
    ];

    var location = [
      'https://www.google.com/maps/place/Sanshil+foundation/@28.4251672,77.0588316,17z/data=!4m8!1m2!2m1!1ssanshil+foundation+project+bagiya!3m4!1s0x390d188208cdac35:0xba90a7675ebc860d!8m2!3d28.4253544!4d77.0630471',
      'https://www.google.co.in/maps/place/Smile+Foundation/@28.5578955,77.1731021,13z/data=!4m8!1m2!2m1!1sSmile+foundation!3m4!1s0x390ce270271eadef:0xb8e42773f9d463ab!8m2!3d28.5578955!4d77.208121',
    ];
    var images = [
      'assets/logos/Sanshil-Logo.png',
      'assets/logos/bagiya logo.jpg',
    ];

    var site = [
      {
        'Name': 'Sanshil Foundation for Welfare',
        'site': 'https://sanshil.com/',
      },
      {
        'Name': 'Ram Kala Sadan Trust',
        'site': 'https://www.ramkalasadan.org/',
      }
    ];
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
    return new MaterialApp(
      color: Colors.yellow,
      home: DefaultTabController(
        length: 3,
        child: new Scaffold(
          appBar: AppBar(
            title: Text(
              'CanUSupport',
              style: TextStyle(
                  fontSize: 30,
                  color: Color.fromRGBO(1, 1, 1, 1),
                  fontFamily: 'Pt_Mono'),
            ),
            backgroundColor: Color(0xffDB9D12),
          ),
          body: TabBarView(
            children: [
              new Scaffold(
                backgroundColor: Color(0xffDB9D12),
                body: FutureBuilder(
                  future: getdata(),


                  builder: (context,snapshot){
                    if(!snapshot.hasData) {
                      return Center(child : CircularProgressIndicator());
                    }
                    else {



                      return ListView.builder(
                          itemCount: snapshot.data.length,
                          itemBuilder: (context, index) {
                            return Container(
                              margin: EdgeInsets.all(16),
                              child: Stack(
                                children: <Widget>[
                                  Card(
                                    elevation: 12,
                                    shape: RoundedRectangleBorder(
                                      borderRadius: BorderRadius.circular(30),
                                    ),
                                    color: Colors.white,
                                    child: Container(
                                      padding: const EdgeInsets.symmetric(
                                          horizontal: 24.0, vertical: 18),
                                      decoration: BoxDecoration(
                                        borderRadius: BorderRadius.circular(30),
                                        gradient: LinearGradient(colors: [
                                          Color.fromRGBO(204, 204, 204, 1),
                                          Color.fromRGBO(179, 179, 179, 1),
                                          Color.fromRGBO(140, 140, 140, 1),
                                        ]),
                                      ),
                                      child: Row(
                                        mainAxisAlignment:
                                        MainAxisAlignment.spaceBetween,
                                        children: <Widget>[
                                          Container(
                                            padding:
                                            EdgeInsets.fromLTRB(0, 0, 10, 0),
                                            child: CircleAvatar(
                                                radius: 45,
                                                backgroundImage:
                                                AssetImage(images[index])),
                                          ),
                                          Expanded(
                                            child: Column(
                                              crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                              mainAxisSize: MainAxisSize.min,
                                              children: <Widget>[
                                                Text(
                                                  snapshot.data[index].data['Name'],
                                                  style: Theme.of(context)
                                                      .textTheme
                                                      .headline5
                                                      .copyWith(
                                                      color: Colors.white),
                                                ),
                                                Column(
                                                  children: <Widget>[
                                                    for (var item
                                                    in foundations[index]
                                                    ['Requirements'])
                                                      Text('• ' + item)
                                                  ],
                                                )
                                              ],
                                            ),
                                          ),
                                          Column(children: [
                                            ClipOval(
                                              child: Material(
                                                color: Colors.white, // button color
                                                child: InkWell(
                                                  splashColor: Color(
                                                      0xFFbc8510), // inkwell color
                                                  child: SizedBox(
                                                      width: 56,
                                                      height: 56,
                                                      child: Icon(Icons.call)),
                                                  onTap: () {
                                                    _launchUrlcall(
                                                        call[index]['Number']);
                                                  },
                                                ),
                                              ),
                                            ),
                                            Padding(
                                              padding: EdgeInsets.all(5.0),
                                            ),
                                            ClipOval(
                                              child: Material(
                                                color: Colors.white, // button color
                                                child: InkWell(
                                                  splashColor: Color(
                                                      0xFFbc8510), // inkwell color
                                                  child: SizedBox(
                                                      width: 56,
                                                      height: 56,
                                                      child: Icon(Icons.map)),
                                                  onTap: () {
                                                    _launchMapsUrl(
                                                      location[index],
                                                    );
                                                  },
                                                ),
                                              ),
                                            ),
                                            Padding(
                                              padding: EdgeInsets.all(5.0),
                                            ),
                                            ClipOval(
                                              child: Material(
                                                color: Colors.white, // button color
                                                child: InkWell(
                                                  splashColor: Color(
                                                      0xFFbc8510), // inkwell color
                                                  child: SizedBox(
                                                      width: 56,
                                                      height: 56,
                                                      child: Icon(Icons.web_sharp)),
                                                  onTap: () {
                                                    _launchUrlweb(
                                                        site[index]['site']);
                                                  },
                                                ),
                                              ),
                                            ),
                                          ]),
                                        ],
                                      ),
                                    ),
                                  ),
                                ],
                              ),
                            );
                          });
                    }

                  }
                  ,

                ),
              ),
              new Container(
                child: login_caller(),
              ),
              new Container(
                padding: EdgeInsets.symmetric(
                  horizontal: 10.0,
                  vertical: 100.0,
                ),
                height: double.infinity,
                decoration: BoxDecoration(
                  gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors: [
                      Color(0xFFf7dca1),
                      Color(0xFFf1c15b),
                      Color(0xFFeba714),
                      Color(0xFFbc8510),
                    ],
                    stops: [0.1, 0.4, 0.7, 0.9],
                  ),
                ),
                child: SingleChildScrollView(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Text(
                        'About us',
                        style: TextStyle(
                            color: Colors.white,
                            fontFamily: 'OpenSans',
                            fontSize: 30,
                            fontWeight: FontWeight.bold),
                      ),
                      Padding(padding: EdgeInsets.symmetric(vertical: 10.0)),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        children: <Widget>[
                          GestureDetector(
                            onTap: () {
                              _launchURLsite();
                            },
                            child: Container(
                              height: 60.0,
                              width: 60.0,
                              child: InkWell(
                                splashColor: Color(0xFFbc8510),
                              ),
                              decoration: BoxDecoration(
                                shape: BoxShape.circle,
                                color: Colors.white,
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.black26,
                                    offset: Offset(0, 2),
                                    blurRadius: 6.0,
                                  ),
                                ],
                                image: DecorationImage(
                                  image: NetworkImage(
                                      'https://www.googlewatchblog.de/wp-content/uploads/google-logo-perfekt.jpg'),
                                ),
                              ),
                            ),
                          ),
                          GestureDetector(
                            onTap: () {
                              _launchURLface();
                            },
                            child: Container(
                              height: 60.0,
                              width: 60.0,
                              child: InkWell(
                                splashColor: Color(0xFFbc8510),
                              ),
                              decoration: BoxDecoration(
                                shape: BoxShape.circle,
                                color: Colors.white,
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.black26,
                                    offset: Offset(0, 2),
                                    blurRadius: 6.0,
                                  ),
                                ],
                                image: DecorationImage(
                                  image: NetworkImage(
                                      'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTWHNqSKP0g_42wo-gQv1azrnztIYv1RbZKnQ&usqp=CAU'),
                                ),
                              ),
                            ),
                          ),
                          GestureDetector(
                            onTap: () {
                              _launchURLinsta();
                            },
                            child: Container(
                              height: 60.0,
                              width: 60.0,
                              child: InkWell(
                                splashColor: Color(0xFFbc8510),
                              ),
                              decoration: BoxDecoration(
                                shape: BoxShape.circle,
                                color: Colors.white,
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.black26,
                                    offset: Offset(0, 2),
                                    blurRadius: 6.0,
                                  ),
                                ],
                                image: DecorationImage(
                                  image: NetworkImage(
                                      'https://www.pollutionprobe.org/wp-content/uploads/insta-logo-300x300.png'),
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                      Padding(padding: EdgeInsets.symmetric(vertical: 10.0)),
                      Text(
                        'Divij Dhiraaj',
                        style: TextStyle(
                            color: Colors.white,
                            fontFamily: 'OpenSans',
                            fontSize: 30,
                            fontWeight: FontWeight.bold),
                        textAlign: TextAlign.left,
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(
                          horizontal: 20.0,
                          vertical: 15.0,
                        ),
                        child: Text(
                          'Hi! My name is Divij Dhiraaj and I\'m the co-founder of CanUsupport. I’m a Seventeen year old student studying the The Shri Ram School , Aravali. \n \n When Aryan first approached me with the idea of building a platform to connect the less- known NGOs who are in dire need of funds, I resonated with his though process for that is same stumbling block me and my family encounter when trying to donate. Most potential donors are only aware of the well established NGOs , not knowing that there might just be a smaller NGO in their area ,working towards community well-fare, lacking funds and donations. \n \n While creating this site , that was our goal: to connect the less-established NGOs with donors so that the effect of their donations is maximised.',
                          style: TextStyle(
                              color: Colors.white,
                              fontFamily: 'OpenSans',
                              fontSize: 16,
                              fontWeight: FontWeight.bold),
                          textAlign: TextAlign.left,
                        ),
                      ),
                      Text(
                        'Aryan Jalota',
                        style: TextStyle(
                            color: Colors.white,
                            fontFamily: 'OpenSans',
                            fontSize: 30,
                            fontWeight: FontWeight.bold),
                        textAlign: TextAlign.left,
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(
                          horizontal: 20.0,
                          vertical: 15.0,
                        ),
                        child: Text(
                          'Hi! I\’m Aryan Jalota and I’m the founder of CanUSupport. I\’m a seventeen year old student currently studying in the Shri Ram School, Aravali. \n \n My family and I have been active contributors to many NGOs, but there was one challenge we faced the most when it came to donating – what should we donate? For instance, the first thing which comes to our mind will be stationary and notebooks for NGOs and learning centres; however, NGOs receive these donations in bulk from various people, and the societal impact that donors want to make is minimised. \n \n Therefore, I decided to create a platform over the summer which can directly connect various NGOs and learning centres to the local community. This way, donors can directly donate according to the requirements of the NGOs, ultimately maximising the impact on the society.',
                          style: TextStyle(
                              color: Colors.white,
                              fontFamily: 'OpenSans',
                              fontSize: 16,
                              fontWeight: FontWeight.bold),
                          textAlign: TextAlign.left,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ],
          ),
          bottomNavigationBar: new TabBar(
            tabs: [
              Tab(
                icon: new Icon(Icons.home),
              ),
              Tab(
                icon: new Icon(Icons.perm_identity),
              ),
              Tab(
                icon: new Icon(Icons.settings),
              )
            ],
            labelColor: Colors.yellow,
            unselectedLabelColor: Colors.black,
            indicatorSize: TabBarIndicatorSize.label,
            indicatorPadding: EdgeInsets.all(5.0),
            indicatorColor: Colors.red,
          ),
          backgroundColor: Color(0xff707070),
        ),
      ),
    );
  }

  _launchURLsite() async {
    const url = 'https://canusupport.com/';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchURLinsta() async {
    const url = 'https://www.instagram.com/canusupport/';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchUrlcall(String url) async {
    if (await canLaunch(url)) {
      launch(url);
    } else {
      throw "Could not launch $url";
    }
  }

  _launchMapsUrl(String loca) async {
    final url = loca;
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchUrlmail(String url) async {
    if (await canLaunch(url)) {
      launch(url);
    } else {
      throw "Could not launch $url";
    }
  }

  _launchURLface() async {
    const url = 'https://www.facebook.com/canusupport/';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchUrlweb(String url) async {
    if (await canLaunch(url)) {
      launch(url);
    } else {
      throw "Could not launch $url";
    }
  }
}

import'包:cloud_firestore/cloud_firestore.dart';
导入“包:firebase_core/firebase_core.dart”;
进口“包装:颤振/材料.省道”;
导入“package:url_launcher/url_launcher.dart”;
导入“login_caller.dart”;
void main(){
runApp(MyApp());
}
类MyApp扩展了无状态小部件{
//此小部件是应用程序的根。
@凌驾
小部件构建(构建上下文){
返回材料PP(
主页:MyHomePage(),
);
}
}
类MyHomePage扩展StatefulWidget{
//此小部件是应用程序的主页。它是有状态的,表示
//它有一个状态对象(定义如下),其中包含影响
//看起来怎么样。
//此类是状态的配置。它保存值(在此
//案例名称)由家长(在本例中为应用程序小部件)提供,以及
//由State的build方法使用。小部件子类中的字段包括
//始终标记为“最终”。
@凌驾
_MyHomePageState createState()=>\u MyHomePageState();
}
类_MyHomePageState扩展状态{
@凌驾
小部件构建(构建上下文){
Future getdata()异步{
final firestore=FirebaseFirestore.instance;
等待Firebase.initializeApp();
QuerySnapshot snapshot=wait firestore.collection('CanUSupport').get();
返回wait snapshot.docs;
}
var文件=[];
var基础=[
{
“姓名”:“三喜福利基金会”
“要求”:[“椅子(6)”,“桌子(234)”,
},
{
“姓名”:“拉姆·卡拉·萨丹信托公司”,
‘要求’:[‘椅子(5)’,‘桌子(7)’,‘铅笔(7899)’,
},
];
变量调用=[
{
“姓名”:“三喜福利基金会”
‘编号’:‘098733 29733’,
},
{
“姓名”:“拉姆·卡拉·萨丹信托公司”,
‘编号’:‘07291825705’,
},
];
变量位置=[
'https://www.google.com/maps/place/Sanshil+基金会/@28.4251672,77.0588316,17z/数据=!4m8!1m2!2m1!1ssanshil+基金会+项目+巴吉亚!3m4!1s0x390d188208cdac35:0xba90a7675ebc860d!8m2!3d28.4253544!4d77.0630471',
'https://www.google.co.in/maps/place/Smile+Foundation/@28.5578955,77.1731021,13z/data=!4m8!1m2!2m1!1smile+Foundation!3m4!1s0x390ce270271eadef:0xb8e42773f9d463ab!8m2!3d28.5578955!4d77.208121',
];
变量图像=[
“assets/logos/Sanshil Logo.png”,
“资产/标识/bagiya logo.jpg”,
];
变量站点=[
{
“姓名”:“三喜福利基金会”
“站点”:https://sanshil.com/',
},
{
“姓名”:“拉姆·卡拉·萨丹信托公司”,
“站点”:https://www.ramkalasadan.org/',
}
];
//每次调用setState时都会重新运行此方法,例如,按done
//通过上面的_incrementCounter方法。
//
//对颤振框架进行了优化,以制定重新运行的构建方法
//快速,这样你就可以重建任何需要更新的东西
//而不是必须单独更改小部件的实例。
返回新材料PP(
颜色:颜色,黄色,
主页:DefaultTabController(
长度:3,
儿童:新脚手架(
appBar:appBar(
标题:正文(
“CanUSupport”,
样式:TextStyle(
尺寸:30,
颜色:color.fromRGBO(1,1,1,1),
fontFamily:“Pt_Mono”),
),
背景颜色:颜色(0xffDB9D12),
),
正文:选项卡视图(
儿童:[
新脚手架(
背景颜色:颜色(0xffDB9D12),
正文:未来建设者(
future:getdata(),
生成器:(上下文,快照){
如果(!snapshot.hasData){
返回中心(子项:CircularProgressIndicator());
}
否则{
返回ListView.builder(
itemCount:snapshot.data.length,
itemBuilder:(上下文,索引){
返回容器(
保证金:所有(16),
子:堆栈(
儿童:[
卡片(
标高:12,
形状:圆形矩形边框(
边界半径:边界半径。圆形(30),
),
颜色:颜色,白色,
子:容器(
填充:const EdgeInsets.symmetric(
水平:24.0,垂直:18),
装饰:盒子装饰(
边界半径:边界半径。圆形(30),
渐变:线性渐变(颜色:[
颜色。来自RGBO(204,204,204,1),
颜色。来自RGBO(1791791791),
颜色。来自RGBO(140,140,140,1),
]),
),
孩子:排(
主轴对准:
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.

// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    CollectionReference canUSupport = FirebaseFirestore.instance.collection('CanUSupport');
    var foundations = [
      {
        'Name': 'Sanshil Foundation for Welfare',
        'Requirements': ['Chairs (6)', 'Tables (234)'],
      },
      {
        'Name': 'Ram Kala Sadan Trust',
        'Requirements': ['Chairs (5)', 'Tables (7)', 'Pencils (7899)'],
      },
    ];
    var call = [
      {
        'Name': 'Sanshil Foundation for Welfare',
        'Number': '098733 29733',
      },
      {
        'Name': 'Ram Kala Sadan Trust',
        'Number': "072918 25705",
      },
    ];

    var location = [
      'https://www.google.com/maps/place/Sanshil+foundation/@28.4251672,77.0588316,17z/data=!4m8!1m2!2m1!1ssanshil+foundation+project+bagiya!3m4!1s0x390d188208cdac35:0xba90a7675ebc860d!8m2!3d28.4253544!4d77.0630471',
      'https://www.google.co.in/maps/place/Smile+Foundation/@28.5578955,77.1731021,13z/data=!4m8!1m2!2m1!1sSmile+foundation!3m4!1s0x390ce270271eadef:0xb8e42773f9d463ab!8m2!3d28.5578955!4d77.208121',
    ];
    var images = [
      'assets/logos/Sanshil-Logo.png',
      'assets/logos/bagiya logo.jpg',
    ];

    var site = [
      {
        'Name': 'Sanshil Foundation for Welfare',
        'site': 'https://sanshil.com/',
      },
      {
        'Name': 'Ram Kala Sadan Trust',
        'site': 'https://www.ramkalasadan.org/',
      }
    ];
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
    return new MaterialApp(
      color: Colors.yellow,
      home: DefaultTabController(
        length: 3,
        child: new Scaffold(
          appBar: AppBar(
            title: Text(
              'CanUSupport',
              style: TextStyle(
                  fontSize: 30, color: Color.fromRGBO(1, 1, 1, 1), fontFamily: 'Pt_Mono'),
            ),
            backgroundColor: Color(0xffDB9D12),
          ),
          body: TabBarView(
            children: [
              new Scaffold(
                backgroundColor: Color(0xffDB9D12),
                body: StreamBuilder<QuerySnapshot>(
                  stream: canUSupport.snapshots(),
                  builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
                    if (snapshot.hasError) {
                      return Text('Something went wrong');
                    }

                    if (snapshot.connectionState == ConnectionState.waiting) {
                      return Center(child: CircularProgressIndicator());
                    }

                    return ListView.builder(
                        itemCount: snapshot.data.size,
                        itemBuilder: (context, index) {
                          return Container(
                            margin: EdgeInsets.all(16),
                            child: Stack(
                              children: <Widget>[
                                Card(
                                  elevation: 12,
                                  shape: RoundedRectangleBorder(
                                    borderRadius: BorderRadius.circular(30),
                                  ),
                                  color: Colors.white,
                                  child: Container(
                                    padding: const EdgeInsets.symmetric(
                                        horizontal: 24.0, vertical: 18),
                                    decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(30),
                                      gradient: LinearGradient(colors: [
                                        Color.fromRGBO(204, 204, 204, 1),
                                        Color.fromRGBO(179, 179, 179, 1),
                                        Color.fromRGBO(140, 140, 140, 1),
                                      ]),
                                    ),
                                    child: Row(
                                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                      children: <Widget>[
                                        Container(
                                          padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
                                          child: CircleAvatar(
                                              radius: 45,
                                              backgroundImage: AssetImage(images[index])),
                                        ),
                                        Expanded(
                                          child: Column(
                                            crossAxisAlignment: CrossAxisAlignment.start,
                                            mainAxisSize: MainAxisSize.min,
                                            children: <Widget>[
                                              Text(
                                                snapshot.data.docs[index].data()['Name'],
                                                style: Theme.of(context)
                                                    .textTheme
                                                    .headline5
                                                    .copyWith(color: Colors.white),
                                              ),
                                              Column(
                                                children: <Widget>[
                                                  for (var item in foundations[index]
                                                  ['Requirements'])
                                                    Text('• ' + item)
                                                ],
                                              )
                                            ],
                                          ),
                                        ),
                                        Column(children: [
                                          ClipOval(
                                            child: Material(
                                              color: Colors.white, // button color
                                              child: InkWell(
                                                splashColor:
                                                Color(0xFFbc8510), // inkwell color
                                                child: SizedBox(
                                                    width: 56,
                                                    height: 56,
                                                    child: Icon(Icons.call)),
                                                onTap: () {
                                                  _launchUrlcall(call[index]['Number']);
                                                },
                                              ),
                                            ),
                                          ),
                                          Padding(
                                            padding: EdgeInsets.all(5.0),
                                          ),
                                          ClipOval(
                                            child: Material(
                                              color: Colors.white, // button color
                                              child: InkWell(
                                                splashColor:
                                                Color(0xFFbc8510), // inkwell color
                                                child: SizedBox(
                                                    width: 56,
                                                    height: 56,
                                                    child: Icon(Icons.map)),
                                                onTap: () {
                                                  _launchMapsUrl(
                                                    location[index],
                                                  );
                                                },
                                              ),
                                            ),
                                          ),
                                          Padding(
                                            padding: EdgeInsets.all(5.0),
                                          ),
                                          ClipOval(
                                            child: Material(
                                              color: Colors.white, // button color
                                              child: InkWell(
                                                splashColor:
                                                Color(0xFFbc8510), // inkwell color
                                                child: SizedBox(
                                                    width: 56,
                                                    height: 56,
                                                    child: Icon(Icons.web_sharp)),
                                                onTap: () {
                                                  _launchUrlweb(site[index]['site']);
                                                },
                                              ),
                                            ),
                                          ),
                                        ]),
                                      ],
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          );
                        });
                  },
                ),
              ),
              new Container(
                child: login_caller(),
              ),
              new Container(
                padding: EdgeInsets.symmetric(
                  horizontal: 10.0,
                  vertical: 100.0,
                ),
                height: double.infinity,
                decoration: BoxDecoration(
                  gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors: [
                      Color(0xFFf7dca1),
                      Color(0xFFf1c15b),
                      Color(0xFFeba714),
                      Color(0xFFbc8510),
                    ],
                    stops: [0.1, 0.4, 0.7, 0.9],
                  ),
                ),
                child: SingleChildScrollView(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Text(
                        'About us',
                        style: TextStyle(
                            color: Colors.white,
                            fontFamily: 'OpenSans',
                            fontSize: 30,
                            fontWeight: FontWeight.bold),
                      ),
                      Padding(padding: EdgeInsets.symmetric(vertical: 10.0)),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        children: <Widget>[
                          GestureDetector(
                            onTap: () {
                              _launchURLsite();
                            },
                            child: Container(
                              height: 60.0,
                              width: 60.0,
                              child: InkWell(
                                splashColor: Color(0xFFbc8510),
                              ),
                              decoration: BoxDecoration(
                                shape: BoxShape.circle,
                                color: Colors.white,
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.black26,
                                    offset: Offset(0, 2),
                                    blurRadius: 6.0,
                                  ),
                                ],
                                image: DecorationImage(
                                  image: NetworkImage(
                                      'https://www.googlewatchblog.de/wp-content/uploads/google-logo-perfekt.jpg'),
                                ),
                              ),
                            ),
                          ),
                          GestureDetector(
                            onTap: () {
                              _launchURLface();
                            },
                            child: Container(
                              height: 60.0,
                              width: 60.0,
                              child: InkWell(
                                splashColor: Color(0xFFbc8510),
                              ),
                              decoration: BoxDecoration(
                                shape: BoxShape.circle,
                                color: Colors.white,
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.black26,
                                    offset: Offset(0, 2),
                                    blurRadius: 6.0,
                                  ),
                                ],
                                image: DecorationImage(
                                  image: NetworkImage(
                                      'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTWHNqSKP0g_42wo-gQv1azrnztIYv1RbZKnQ&usqp=CAU'),
                                ),
                              ),
                            ),
                          ),
                          GestureDetector(
                            onTap: () {
                              _launchURLinsta();
                            },
                            child: Container(
                              height: 60.0,
                              width: 60.0,
                              child: InkWell(
                                splashColor: Color(0xFFbc8510),
                              ),
                              decoration: BoxDecoration(
                                shape: BoxShape.circle,
                                color: Colors.white,
                                boxShadow: [
                                  BoxShadow(
                                    color: Colors.black26,
                                    offset: Offset(0, 2),
                                    blurRadius: 6.0,
                                  ),
                                ],
                                image: DecorationImage(
                                  image: NetworkImage(
                                      'https://www.pollutionprobe.org/wp-content/uploads/insta-logo-300x300.png'),
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                      Padding(padding: EdgeInsets.symmetric(vertical: 10.0)),
                      Text(
                        'Divij Dhiraaj',
                        style: TextStyle(
                            color: Colors.white,
                            fontFamily: 'OpenSans',
                            fontSize: 30,
                            fontWeight: FontWeight.bold),
                        textAlign: TextAlign.left,
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(
                          horizontal: 20.0,
                          vertical: 15.0,
                        ),
                        child: Text(
                          'Hi! My name is Divij Dhiraaj and I\'m the co-founder of CanUsupport. I’m a Seventeen year old student studying the The Shri Ram School , Aravali. \n \n When Aryan first approached me with the idea of building a platform to connect the less- known NGOs who are in dire need of funds, I resonated with his though process for that is same stumbling block me and my family encounter when trying to donate. Most potential donors are only aware of the well established NGOs , not knowing that there might just be a smaller NGO in their area ,working towards community well-fare, lacking funds and donations. \n \n While creating this site , that was our goal: to connect the less-established NGOs with donors so that the effect of their donations is maximised.',
                          style: TextStyle(
                              color: Colors.white,
                              fontFamily: 'OpenSans',
                              fontSize: 16,
                              fontWeight: FontWeight.bold),
                          textAlign: TextAlign.left,
                        ),
                      ),
                      Text(
                        'Aryan Jalota',
                        style: TextStyle(
                            color: Colors.white,
                            fontFamily: 'OpenSans',
                            fontSize: 30,
                            fontWeight: FontWeight.bold),
                        textAlign: TextAlign.left,
                      ),
                      Container(
                        padding: EdgeInsets.symmetric(
                          horizontal: 20.0,
                          vertical: 15.0,
                        ),
                        child: Text(
                          'Hi! I\’m Aryan Jalota and I’m the founder of CanUSupport. I\’m a seventeen year old student currently studying in the Shri Ram School, Aravali. \n \n My family and I have been active contributors to many NGOs, but there was one challenge we faced the most when it came to donating – what should we donate? For instance, the first thing which comes to our mind will be stationary and notebooks for NGOs and learning centres; however, NGOs receive these donations in bulk from various people, and the societal impact that donors want to make is minimised. \n \n Therefore, I decided to create a platform over the summer which can directly connect various NGOs and learning centres to the local community. This way, donors can directly donate according to the requirements of the NGOs, ultimately maximising the impact on the society.',
                          style: TextStyle(
                              color: Colors.white,
                              fontFamily: 'OpenSans',
                              fontSize: 16,
                              fontWeight: FontWeight.bold),
                          textAlign: TextAlign.left,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ],
          ),
          bottomNavigationBar: new TabBar(
            tabs: [
              Tab(
                icon: new Icon(Icons.home),
              ),
              Tab(
                icon: new Icon(Icons.perm_identity),
              ),
              Tab(
                icon: new Icon(Icons.settings),
              )
            ],
            labelColor: Colors.yellow,
            unselectedLabelColor: Colors.black,
            indicatorSize: TabBarIndicatorSize.label,
            indicatorPadding: EdgeInsets.all(5.0),
            indicatorColor: Colors.red,
          ),
          backgroundColor: Color(0xff707070),
        ),
      ),
    );
  }

  _launchURLsite() async {
    const url = 'https://canusupport.com/';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchURLinsta() async {
    const url = 'https://www.instagram.com/canusupport/';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchUrlcall(String url) async {
    if (await canLaunch(url)) {
      launch(url);
    } else {
      throw "Could not launch $url";
    }
  }

  _launchMapsUrl(String loca) async {
    final url = loca;
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchUrlmail(String url) async {
    if (await canLaunch(url)) {
      launch(url);
    } else {
      throw "Could not launch $url";
    }
  }

  _launchURLface() async {
    const url = 'https://www.facebook.com/canusupport/';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  _launchUrlweb(String url) async {
    if (await canLaunch(url)) {
      launch(url);
    } else {
      throw "Could not launch $url";
    }
  }
}