Skip to content
Snippets Groups Projects
Select Git revision
  • 583a3ff06a2b2fcdc7c7c9f1c7894d75c3f08b1b
  • master default protected
  • dev
  • translation
  • short_pk_with_checksum
  • dev-old
  • 1.0
  • 0.10.1
  • 0.10
  • 0.9.0
10 results

build.py

Blame
  • Forked from matograine / vignette
    Source project has a limited visibility.
    common_elements.dart 5.33 KiB
    import 'package:easy_localization/easy_localization.dart';
    import 'package:flutter/material.dart';
    import 'package:gecko/globals.dart';
    import 'package:gecko/models/scale_functions.dart';
    import 'package:gecko/models/widgets_keys.dart';
    
    Future<bool?> confirmPopup(BuildContext context, String title) async {
      return showDialog<bool>(
        context: context,
        barrierDismissible: true,
        builder: (BuildContext context) {
          return AlertDialog(
            backgroundColor: backgroundColor,
            content: Text(
              title,
              textAlign: TextAlign.center,
              style: scaledTextStyle(fontSize: 18, fontWeight: FontWeight.w500),
            ),
            actions: <Widget>[
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  TextButton(
                    key: keyConfirm,
                    child: Text(
                      "yes".tr(),
                      style: scaledTextStyle(
                        fontSize: 18,
                        color: const Color(0xffD80000),
                      ),
                    ),
                    onPressed: () {
                      Navigator.pop(context, true);
                    },
                  ),
                  ScaledSizedBox(width: 20),
                  TextButton(
                    child: Text(
                      "no".tr(),
                      style:
                          scaledTextStyle(fontSize: 18, color: Colors.blueAccent),
                    ),
                    onPressed: () {
                      Navigator.pop(context, false);
                    },
                  ),
                  ScaledSizedBox(height: 70)
                ],
              )
            ],
          );
        },
      );
    }
    
    Future<bool?> confirmPopupCertification(BuildContext context, String question1,
        String username, String question2, String address) async {
      return showDialog<bool>(
        context: context,
        barrierDismissible: true,
        builder: (BuildContext context) {
          return AlertDialog(
            backgroundColor: backgroundColor,
            content: ScaledSizedBox(
              height: 220,
              child: Column(
                children: [
                  ScaledSizedBox(height: 10),
                  Text(
                    question1,