From 2816adcb307ad28a27686ac7e1b7893979a9ddfc Mon Sep 17 00:00:00 2001 From: Michele Righi Date: Sun, 2 Jan 2022 20:02:57 +0100 Subject: [PATCH] update --- app-mobile/flutter_application/lib/main.dart | 81 ------------------- .../lib/views/ViewInfo.dart | 50 +++++++++++- .../lib/views/ViewMenu.dart | 18 ++++- app-mobile/flutter_application/pubspec.lock | 56 +++++++++++++ app-mobile/flutter_application/pubspec.yaml | 1 + 5 files changed, 120 insertions(+), 86 deletions(-) diff --git a/app-mobile/flutter_application/lib/main.dart b/app-mobile/flutter_application/lib/main.dart index dd20e67..4535fe4 100644 --- a/app-mobile/flutter_application/lib/main.dart +++ b/app-mobile/flutter_application/lib/main.dart @@ -1,5 +1,4 @@ import 'dart:convert'; - import 'package:flutter/material.dart'; import 'package:roquiz/model/QuestionRepository.dart'; import 'package:roquiz/views/ViewMenu.dart'; @@ -9,40 +8,6 @@ void main() { runApp(const MyApp()); } -/*class ROquizApp extends StatefulWidget { - @override - State createState() { - return _ROquizAppState(); - } -}*/ - -/*lass _ROquizAppState extends State { - QuestionRepository qRepo; - List selectedTopics; - - _ROquizAppState() { - final file = File("assets/domande.txt"); - Stream lines = - file.openRead().transform(utf8.decoder).transform(LineSplitter()); - try { - await for (String l in lines) { - - } - } - catch (e) { - print("Error: $e"); - } - } - - @override - Widget build(BuildContext context) { - // TODO: implement build - throw UnimplementedError(); - } - - -}*/ - class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @@ -55,49 +20,3 @@ class MyApp extends StatelessWidget { ); } } -/* -Widget titleSection = Container( - padding: const EdgeInsets.all(32), - child: Column( - children: [], - ), -); - -Widget titleSection = Container( - padding: const EdgeInsets.all(32), - child: Row( - children: [ - Expanded( - /*1*/ - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - /*2*/ - Container( - padding: const EdgeInsets.only(bottom: 8), - child: const Text( - 'Oeschinen Lake Campground', - style: TextStyle( - fontWeight: FontWeight.bold, - ), - ), - ), - Text( - 'Kandersteg, Switzerland', - style: TextStyle( - color: Colors.grey[500], - ), - ), - ], - ), - ), - /*3*/ - Icon( - Icons.star, - color: Colors.red[500], - ), - const Text('41'), - ], - ), -); -*/ \ No newline at end of file diff --git a/app-mobile/flutter_application/lib/views/ViewInfo.dart b/app-mobile/flutter_application/lib/views/ViewInfo.dart index 1b013bd..1183d29 100644 --- a/app-mobile/flutter_application/lib/views/ViewInfo.dart +++ b/app-mobile/flutter_application/lib/views/ViewInfo.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:roquiz/views/ViewMenu.dart'; +import 'package:auto_size_text/auto_size_text.dart'; -class ViewInfoWidget extends StatelessWidget { - const ViewInfoWidget({Key? key}) : super(key: key); +class ViewInfo extends StatelessWidget { + const ViewInfo({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -9,9 +11,51 @@ class ViewInfoWidget extends StatelessWidget { backgroundColor: Colors.indigo[900], extendBodyBehindAppBar: true, appBar: AppBar( - title: const Text("Quiz"), + title: const Text("Info"), centerTitle: true, backgroundColor: Colors.transparent, + automaticallyImplyLeading: true, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios), + onPressed: () { + Navigator.push( + context, MaterialPageRoute(builder: (context) => ViewMenu())); + }, + ), + ), + body: SafeArea( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Center( + child: Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(25), + ), + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const AutoSizeText( + "Applicazione sviluppata da Michele Righi", + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + color: Colors.black), + ), + const AutoSizeText( + "Ciao", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.black), + ), + ], + )))), + ), ), ); } diff --git a/app-mobile/flutter_application/lib/views/ViewMenu.dart b/app-mobile/flutter_application/lib/views/ViewMenu.dart index 5db9fe6..efc753f 100644 --- a/app-mobile/flutter_application/lib/views/ViewMenu.dart +++ b/app-mobile/flutter_application/lib/views/ViewMenu.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:roquiz/constants.dart'; import 'package:roquiz/model/QuestionRepository.dart'; import 'package:roquiz/views/ViewQuiz.dart'; @@ -172,13 +173,26 @@ class ViewMenuState extends State { ), const SizedBox(height: 20), InkWell( - onTap: () {}, + onTap: () { + /*Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ViewInfo()));*/ + }, + // remove those to enable splash effects + splashColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, child: Container( alignment: Alignment.center, width: 60, // fix: fit <-> height: 60, decoration: const BoxDecoration( - gradient: kPrimaryGradient, + gradient: LinearGradient( + colors: [Color(0x8846A0AE), Color(0x8800FFCB)], + begin: Alignment.centerLeft, + end: Alignment.centerRight, + ), borderRadius: BorderRadius.all(Radius.circular(30))), child: const Icon( diff --git a/app-mobile/flutter_application/pubspec.lock b/app-mobile/flutter_application/pubspec.lock index 5ecb446..7cf6f36 100644 --- a/app-mobile/flutter_application/pubspec.lock +++ b/app-mobile/flutter_application/pubspec.lock @@ -71,6 +71,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" flutter: dependency: "direct main" description: flutter @@ -163,6 +170,48 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + package_info_plus_linux: + dependency: transitive + description: + name: package_info_plus_linux + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + package_info_plus_macos: + dependency: transitive + description: + name: package_info_plus_macos + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + package_info_plus_web: + dependency: transitive + description: + name: package_info_plus_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + package_info_plus_windows: + dependency: transitive + description: + name: package_info_plus_windows + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" path: dependency: transitive description: @@ -329,6 +378,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.3" xml: dependency: transitive description: diff --git a/app-mobile/flutter_application/pubspec.yaml b/app-mobile/flutter_application/pubspec.yaml index e846ea1..72d83a5 100644 --- a/app-mobile/flutter_application/pubspec.yaml +++ b/app-mobile/flutter_application/pubspec.yaml @@ -44,6 +44,7 @@ dependencies: get: ^4.1.4 auto_size_text: ^3.0.0 url_launcher: ^6.0.17 + package_info_plus: ^1.3.0 dev_dependencies: flutter_test: