Skip to content
Snippets Groups Projects
Select Git revision
  • 0728bc6abacc07294fb96dc5cc72a7953892065d
  • master default protected
  • polkadart-stuff
  • provider-to-riverpod
  • implementLightnode
  • hugo_RML16
  • refactorOnboardingSlideshow
  • duniterV1Latest
  • scanNetwork
  • dubp_rs
  • v0.2.12+131
  • v0.2.11+130
  • v0.2.10+129
  • v0.2.9+128
  • v0.2.8+127
  • v0.2.7+125
  • v0.2.6+124
  • v0.2.5+123
  • v0.2.4+122
  • v0.2.3+119
  • v0.2.2+118
  • v0.2.1+113
  • polkawallet-sdk-latest
  • v0.1.29+111
  • v0.1.28+109
  • v0.1.27+108
  • v0.1.26+107
  • v0.1.25+106
  • v0.1.25+105
  • v0.1.24+102
30 results

common_elements.dart

Blame
  • common_elements.dart 9.54 KiB
    import 'package:dots_indicator/dots_indicator.dart';
    import 'package:easy_localization/easy_localization.dart';
    import 'package:flutter/material.dart';
    import 'package:flutter_markdown/flutter_markdown.dart';
    import 'package:gecko/globals.dart';
    import 'package:gecko/models/widgets_keys.dart';
    import 'package:gecko/providers/substrate_sdk.dart';
    import 'package:provider/provider.dart';
    
    class CommonElements {
      // Exemple de Widget
      Widget exemple(String data) {
        return const Text('Coucou');
      }
    
      Widget buildImage(String assetName,
          [double boxHeight = 440, double imageWidth = 350]) {
        return Container(
            padding: const EdgeInsets.all(0),
            width: 440,
            height: isTall ? boxHeight : boxHeight * 0.9,
            decoration: BoxDecoration(
                gradient: const LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  colors: [
                    Color(0xffd2d4cf),
                    Color(0xffeaeae7),
                  ],
                ),
                border: Border.all(color: Colors.grey[900]!)),
            child: Image.asset('assets/onBoarding/$assetName', width: imageWidth));
      }
    
      Widget buildText(String text, [double size = 20, bool isMd = false]) {
        final mdStyle = MarkdownStyleSheet(
          p: TextStyle(
              fontSize: isTall ? size : size * 0.9,
              color: Colors.black,
              letterSpacing: 0.3),
          textAlign: WrapAlignment.spaceBetween,
        );
    
        return Container(
          padding: const EdgeInsets.all(12),
          width: 440,
          decoration: BoxDecoration(
              color: Colors.white, border: Border.all(color: Colors.grey[900]!)),
          child: isMd
              ? MarkdownBody(data: text, styleSheet: mdStyle)
              : Text(text,
                  textAlign: TextAlign.justify,
                  style: TextStyle(
                      fontSize: isTall ? size : size * 0.9,
                      color: Colors.black,
                      letterSpacing: 0.3)),
        );
      }
    
      Widget nextButton(
          BuildContext context, String text, nextScreen, bool isFast) {
        return SizedBox(
          width: 380 * ratio,
          height: 60 * ratio,
          child: ElevatedButton(
            key: keyGoNext,
            style: ElevatedButton.styleFrom(
              foregroundColor: Colors.white, backgroundColor: orangeC,
              elevation: 4, // foreground
            ),