Skip to content
Snippets Groups Projects
Select Git revision
  • bbf0abd5457d42678882384216af9e83c38549bc
  • master default protected
  • 21-add-onlongpress-with-popup-on-parameters
  • 23-center-vertically-buttons
  • 30-highlight-bin-when-selecting-disabled-item
  • 1.0.7 protected
  • 1.0.6 protected
  • 1.0.5 protected
  • 1.0.4 protected
  • 1.0.3 protected
  • 1.0.2 protected
  • 1.0.0 protected
  • 0.9.1 protected
  • 0.9.0 protected
  • 0.8.4 protected
  • 0.8.3 protected
  • 0.8.2 protected
  • 0.8.1 protected
  • 0.8.0 protected
  • 0.7.0 protected
  • 0.6.1 protected
  • 0.6.0 protected
  • 0.5.0 protected
  • 0.4.0 protected
  • 0.3.0 protected
25 results

application_theme_mode_cubit.dart

Blame
  • main.dart 7.08 KiB
    import 'dart:async';
    
    import 'package:flutter/material.dart';
    import 'package:memory/data/data.dart';
    import 'package:memory/models/TileModel.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          debugShowCheckedModeBanner: false,
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: Home(),
        );
      }
    }
    
    class Home extends StatefulWidget {
      @override
      _HomeState createState() => _HomeState();
    }
    
    class _HomeState extends State<Home> {
      List<TileModel> gridViewTiles = [];
      List<TileModel> questionPairs = [];
    
      @override
      void initState() {
        super.initState();
        reStart();
      }
    
      void reStart() {
        myPairs = getPairs();
        myPairs.shuffle();
    
        gridViewTiles = myPairs;
        Future.delayed(const Duration(seconds: 3), () {
          setState(() {
            questionPairs = getQuestionPairs();
            gridViewTiles = questionPairs;
            selected = false;
          });
        });
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          backgroundColor: Colors.white,
          body: SingleChildScrollView(
            child: Container(
              padding: EdgeInsets.symmetric(horizontal: 20, vertical: 50),
              child: Column(
                children: <Widget>[
                  SizedBox(
                    height: 40,
                  ),
                  points != 800
                      ? Column(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: <Widget>[
                            Text(
                              "$points/800",
                              style: TextStyle(