Separacion de codigo por carpetas, cambio de estilo, clase pregon integrada
This commit is contained in:
11
.vscode/launch.json
vendored
11
.vscode/launch.json
vendored
@ -7,19 +7,22 @@
|
||||
{
|
||||
"name": "flutter_project",
|
||||
"request": "launch",
|
||||
"type": "dart"
|
||||
"type": "dart",
|
||||
"program": "lib/main/main.dart"
|
||||
},
|
||||
{
|
||||
"name": "flutter_project (profile mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "profile"
|
||||
"flutterMode": "profile",
|
||||
"program": "lib/main.dart"
|
||||
},
|
||||
{
|
||||
"name": "flutter_project (release mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "release"
|
||||
"flutterMode": "release",
|
||||
"program": "lib/main.dart"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,4 +4,5 @@
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
</manifest>
|
||||
|
||||
@ -12,10 +12,13 @@ class MyBloc extends Cubit<MyState> {
|
||||
|
||||
}
|
||||
Future<void> launchAemetURL() async {
|
||||
const url = 'https://www.aemet.es/es/eltiempo/prediccion/municipios/caspe-id50074';
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
} else {
|
||||
throw 'Could not launch $url';
|
||||
}
|
||||
}
|
||||
|
||||
const urlString = 'https://www.aemet.es/es/eltiempo/prediccion/municipios/caspe-id50074';
|
||||
final url = Uri.parse(urlString);
|
||||
|
||||
if (await canLaunchUrl(url)) {
|
||||
await launchUrl(url);
|
||||
} else {
|
||||
throw 'Could not launch $urlString';
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
return AppBar(
|
||||
title: const Text(''),
|
||||
centerTitle: true,
|
||||
backgroundColor: Color.fromARGB(255, 194, 218, 230),
|
||||
backgroundColor: Color.fromARGB(255, 78, 169, 6),
|
||||
flexibleSpace: Container(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
@ -1,16 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter\_bloc/flutter\_bloc.dart';
|
||||
|
||||
|
||||
import 'package:flutter_project/contenedores_event.dart';
|
||||
import 'package:flutter_project/contenedores_state.dart';
|
||||
|
||||
|
||||
/*
|
||||
class ContenedoresBloc extends Bloc<ContenedoresEvent, ContenedoresState> {
|
||||
ContenedoresBloc() : super(const ContenedoresState()) {
|
||||
on<SelectContenedor>((event, emit) {
|
||||
emit(ContenedoresState(currentContenedor: event.contenedor));
|
||||
});
|
||||
}
|
||||
}*/
|
||||
@ -1,8 +0,0 @@
|
||||
// This class represents the state of the ContenedoresBloc
|
||||
/*import 'package:flutter_project/contenedores_event.dart';
|
||||
|
||||
class ContenedoresState {
|
||||
final Contenedor? currentContenedor;
|
||||
|
||||
const ContenedoresState({this.currentContenedor});
|
||||
}*/
|
||||
@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_project/app_bar';
|
||||
import 'package:flutter_project/bottom_bar';
|
||||
import 'package:flutter_project/contenedores_event.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_project/bars/app_bar';
|
||||
import 'package:flutter_project/bars/bottom_bar';
|
||||
import 'package:flutter_project/BloC/contenedores_event.dart';
|
||||
import 'package:flutter_project/pregon/pregon';
|
||||
|
||||
|
||||
|
||||
|
||||
@ -54,7 +54,12 @@ class MyHomePage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const Pregon()),
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 300.0,
|
||||
child: Padding(
|
||||
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_project/contenedores_event.dart';
|
||||
import 'my_home_page.dart';
|
||||
import 'package:flutter_project/BloC/contenedores_event.dart';
|
||||
import '../homePage/my_home_page.dart';
|
||||
|
||||
void main() {
|
||||
runApp(
|
||||
41
lib/pregon/pregon
Normal file
41
lib/pregon/pregon
Normal file
@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_project/bars/app_bar';
|
||||
import 'package:flutter_project/bars/bottom_bar';
|
||||
|
||||
class Pregon extends StatelessWidget {
|
||||
const Pregon({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
List<String> datos = ['Dia 1', 'Dia 2', 'Dia 3'];
|
||||
|
||||
return Scaffold(
|
||||
appBar: const CustomAppBar(),
|
||||
bottomNavigationBar: const CustomBottomBar(),
|
||||
body: ListView.builder(
|
||||
itemCount: datos.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[200],
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Text(
|
||||
datos[index],
|
||||
style: const TextStyle(
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
@ -21,10 +21,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: bloc
|
||||
sha256: "6f1b87b6eca9041d5672b6e29273cd1594db48ebb66fd2471066e9f3c3a516bd"
|
||||
sha256: "106842ad6569f0b60297619e9e0b1885c2fb9bf84812935490e6c5275777804e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.2.1"
|
||||
version: "8.1.4"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -82,10 +82,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_bloc
|
||||
sha256: cdd1351ced09eeb46cfa7946e095b7679344af927415ca9cd972928fa6d5b23f
|
||||
sha256: f0ecf6e6eb955193ca60af2d5ca39565a86b8a142452c5b24d96fb477428f4d2
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.3.3"
|
||||
version: "8.1.5"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
||||
@ -31,7 +31,7 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
url_launcher: ^6.0.12
|
||||
flutter_bloc: ^7.0.0
|
||||
flutter_bloc: ^8.1.5
|
||||
flutter_svg: ^2.0.10+1
|
||||
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:flutter_project/main.dart';
|
||||
import 'package:flutter_project/main/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
|
||||
Reference in New Issue
Block a user