-
-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from NaadiQmmr/81-continue-pr
#81 continue pr
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{:paths ["src"] ; where your cljd files are | ||
:deps {org.clojure/clojure {:mvn/version "1.10.1"} | ||
tensegritics/clojuredart | ||
{:local/root "../../"} | ||
#_{:git/url "git@github.com:tensegritics/ClojureDartPreview.git" | ||
:sha "b4b20ee2e82af28360ea95ddd5ce3c1a71ba5b11"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
(ns sample.datatable | ||
(:require | ||
["package:flutter/material.dart" :as m] | ||
[cljd.flutter.alpha :as f])) | ||
|
||
(defn data-table [& {:keys [cols rows]}] | ||
(f/widget | ||
(m/SingleChildScrollView | ||
:scrollDirection m.Axis/horizontal | ||
:child | ||
(m/DataTable | ||
:headingTextStyle (m/TextStyle | ||
:fontWeight m.FontWeight/bold | ||
:color m.Colors/blue) | ||
;; :columnSpacing 18.0 | ||
;; :sortColumnIndex 2 | ||
;; :sortAscending true | ||
:showBottomBorder true | ||
:columns (mapv (fn [col] (m/DataColumn :label (m/Text col))) cols) | ||
:rows (mapv (fn [row] (m/DataRow :cells (mapv (fn [cell] (m/DataCell (m/Text cell))) row))) rows))))) | ||
|
||
(def demo | ||
(f/widget | ||
(m/Scaffold | ||
:appBar (m/AppBar :title (m/Text "DataTable Sample")) | ||
:body | ||
(f/nest | ||
m/Center | ||
(data-table :cols ["#" "Name" "Age" "City"] | ||
:rows [["1" "zm" "42" "guangzhou"] | ||
["2" "zrj" "10" "guangzhou"] | ||
["3" "wrp" "13" "hongkong"] | ||
["4" "wrl" "11" "guangzhou"] | ||
["5" "wrj" "10" "beijing"]]))))) | ||
|
||
(defn main | ||
[] | ||
(m/runApp | ||
(m/MaterialApp | ||
:home demo | ||
:debugShowCheckedModeBanner false))) |