Skip to content

Commit

Permalink
elements 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofKekesi committed Mar 18, 2021
1 parent a3bdc3d commit 6f80ed3
Show file tree
Hide file tree
Showing 9 changed files with 500 additions and 516 deletions.
12 changes: 12 additions & 0 deletions lib/loadJsonData.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

var elementData;

Future<Widget> loadJsonDataThenReturnWidget(Widget widget) async {
String rawJson = await rootBundle.loadString('lib/elements.json');
elementData = json.decode(rawJson);
return Future.value(widget);
}
6 changes: 4 additions & 2 deletions lib/widgets/build.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:elements_rework/widgets/localization.dart';
import 'package:splashscreen/splashscreen.dart';
import 'package:elements_rework/loadJsonData.dart';

import 'package:elements_rework/widgets/drawer.dart';
import 'package:elements_rework/widgets/elements.dart';
Expand All @@ -9,7 +10,7 @@ class Splash extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SplashScreen(
seconds: 2,
//seconds: 2,
title: Text(
AppLocalizations.of(context).translate('title'),
style: TextStyle(
Expand All @@ -31,7 +32,8 @@ class Splash extends StatelessWidget {
),
photoSize: 50,
loaderColor: Colors.white,
navigateAfterSeconds: Build(),
navigateAfterFuture: loadJsonDataThenReturnWidget(Build()),
//navigateAfterSeconds: Build(),
);
}
}
Expand Down
39 changes: 4 additions & 35 deletions lib/widgets/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,9 @@ class customDrawer extends StatelessWidget {
),
),
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * .03),
child: GestureDetector(
onTap: () {
_launchURL('https://crwd.in/elementsapp');
},
child: ListTile(
title: Text(
AppLocalizations.of(context).translate('translate'),
style: TextStyle(
letterSpacing: 2,
fontWeight: FontWeight.bold,
fontSize: MediaQuery.of(context).size.width * .07),
),
),
),
),
GestureDetector(
onTap: () {
_launchURL('https://www.patreon.com/KristofKekesi');
},
child: ListTile(
title: Text(
AppLocalizations.of(context).translate('support'),
style: TextStyle(
letterSpacing: 2,
fontWeight: FontWeight.bold,
fontSize: MediaQuery.of(context).size.width * .07),
),
),
),
Divider(
thickness: MediaQuery.of(context).size.height * .005,
),
GestureDetector(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * .03),
child: GestureDetector(
onTap: () {
_launchURL(
'https://github.com/KristofKekesi/Elements/blob/master/README.md#contributors-');
Expand All @@ -85,6 +53,7 @@ class customDrawer extends StatelessWidget {
),
),
),
),
GestureDetector(
onTap: () {
_launchURL(
Expand Down
Loading

0 comments on commit 6f80ed3

Please sign in to comment.