From 4769f37b8a2017e36e51c0938a1d54226d561dc4 Mon Sep 17 00:00:00 2001 From: Daniel Cujba Date: Sat, 19 Nov 2022 19:09:35 +0200 Subject: [PATCH] 2 --- lib/main.dart | 62 ++++++++++++++++++++++++++++++++++++++++++++++++--- pubspec.lock | 7 ++++++ pubspec.yaml | 3 ++- 3 files changed, 68 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 8f39228..2908986 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:spannable_grid/spannable_grid.dart'; void main() { runApp(const MyApp()); @@ -29,9 +30,62 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { int _counter = 0; int _selectedIndex = 0; + int itemount = 0; + final screens = [ - Center(child: Text('Hello')), - Center(child: Text('About')), + Center(child: Text('Targets')), + SpannableGrid( + cells: [ + SpannableGridCellData( + id: 1, + column: 1, + row: 1, + columnSpan: 2, + child: Container( + child: Center(child: Text("Text 1")), + color: Color.fromRGBO(255, 255, 0, 1)), + ), + SpannableGridCellData( + id: 2, + column: 1, + row: 2, + columnSpan: 2, + child: Container( + child: Center(child: Text("Text 1")), + color: Color.fromRGBO(255, 255, 0, 1))), + SpannableGridCellData( + id: 3, + column: 1, + row: 3, + child: Container( + child: Center(child: Text("Text 1")), + color: Color.fromRGBO(255, 255, 0, 1)), + ), + SpannableGridCellData( + id: 4, + column: 1, + row: 4, + child: Container( + child: Center(child: Text("Text 1")), + color: Color.fromRGBO(255, 255, 0, 1)), + ), + SpannableGridCellData( + id: 5, + column: 2, + row: 3, + rowSpan: 2, + child: Container( + child: Center(child: Text("Text 1")), + color: Color.fromRGBO(255, 255, 0, 1)), + ), + ], + columns: 2, + rows: 4, + style: SpannableGridStyle( + spacing: 10, + ), + ), + Center(child: Text('Profile')), ]; void _onItemTapped(int index) { @@ -49,8 +103,10 @@ class _MyHomePageState extends State { body: screens[_selectedIndex], bottomNavigationBar: BottomNavigationBar( items: const [ + BottomNavigationBarItem( + label: "Targets", icon: Icon(Icons.track_changes)), BottomNavigationBarItem(label: "Home", icon: Icon(Icons.home)), - BottomNavigationBarItem(label: "Person", icon: Icon(Icons.person)), + BottomNavigationBarItem(label: "Profile", icon: Icon(Icons.person)) ], currentIndex: _selectedIndex, onTap: _onItemTapped, diff --git a/pubspec.lock b/pubspec.lock index 9ea0e42..61ca4dc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -114,6 +114,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.9.0" + spannable_grid: + dependency: "direct main" + description: + name: spannable_grid + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" stack_trace: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 70439bc..1a73832 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,10 +29,11 @@ environment: # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. dependencies: + spannable_grid: ^0.3.0 flutter: sdk: flutter - + # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2